Welcome! Log In Create A New Profile

Advanced

Re: nginx -t > Illegal instruction

Sergey Kandaurov
October 15, 2013 01:08PM
On Oct 15, 2013, at 7:39 PM, Maxim Dounin <mdounin@mdounin.ru> wrote:
> Hello!
>
> On Tue, Oct 15, 2013 at 06:14:21PM +0300, Sergey Talchuk wrote:
>
>> Всем привет!
>>
>> собрал nginx для своей системы без проблем (собирал на ней же). Только
>> похоже при запуске nginx -t не может определить тип процессора. К
>> сожалению, система находится на носителе доступном только для чтения.
>> Поэтому отдебажить системные библиотеки не представляется возможным.
>> Надеюсь на помощь.
>
> [...]
>
>> Program received signal SIGILL, Illegal instruction.
>> 0x0805dca5 in ngx_cpuid (i=0, buf=0xbffff950) at src/core/ngx_cpuinfo.c:30
>> 30 src/core/ngx_cpuinfo.c: No such file or directory.
>> in src/core/ngx_cpuinfo.c
>> (gdb) bt
>> #0 0x0805dca5 in ngx_cpuid (i=0, buf=0xbffff950) at
>> src/core/ngx_cpuinfo.c:30
>> #1 0x0805dbbb in ngx_cpuinfo () at src/core/ngx_cpuinfo.c:84
>> #2 0x0806e4f7 in ngx_os_init (log=0x80c27a8) at
>> src/os/unix/ngx_posix_init.c:60
>
> [...]
>
>> cat /proc/cpuinfo
>> processor : 0
>> vendor_id : CyrixInstead
>> cpu family : 4
>> model : 1
>> model name : Cx486SLC
>> stepping : unknown
>> fdiv_bug : no
>> hlt_bug : no
>> f00f_bug : no
>> coma_bug : no
>> fpu : no
>> fpu_exception : no
>> cpuid level : -1
>> wp : yes
>> flags :
>> bogomips : 44.33
>
> Ваш процессор настолько старый, что не поддерживает инструкцию
> cpuid. Quick and dirty workaround - добавить return в самом
> начале функции ngx_cpuinfo() в src/core/ngx_cpuinfo.c:
>
> diff --git a/src/core/ngx_cpuinfo.c b/src/core/ngx_cpuinfo.c
> --- a/src/core/ngx_cpuinfo.c
> +++ b/src/core/ngx_cpuinfo.c
> @@ -75,6 +75,8 @@ ngx_cpuinfo(void)
> u_char *vendor;
> uint32_t vbuf[5], cpu[4], model;
>
> + return;
> +
> vbuf[0] = 0;
> vbuf[1] = 0;
> vbuf[2] = 0;
>


Или что-то такое может работать:

diff -r 5483d9e77b32 src/core/ngx_cpuinfo.c
--- a/src/core/ngx_cpuinfo.c Wed Oct 02 15:07:17 2013 +0400
+++ b/src/core/ngx_cpuinfo.c Tue Oct 15 21:03:53 2013 +0400
@@ -20,6 +20,20 @@ static ngx_inline void ngx_cpuid(uint32_
static ngx_inline void
ngx_cpuid(uint32_t i, uint32_t *buf)
{
+ uint32_t cpu_vendor[4];
+
+ __asm__ (
+
+ " movl $0x4778654e, (%0);" // store vendor string
+ " movl $0x72446e65, 4(%0);"
+ " movl $0x6e657669, 8(%0);"
+ " movl $0, 12(%0);"
+
+ : : "D" (cpu_vendor) );
+
+ if (ngx_strcmp(cpu_vendor, "CyrixInstead") == 0) {
+ return;
+ }

/*
* we could not use %ebx as output parameter if gcc builds PIC,

--
Sergey Kandaurov
pluknet@nginx.com



_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

nginx -t > Illegal instruction

Sergey Talchuk October 15, 2013 11:16AM

Re: nginx -t > Illegal instruction

Maxim Dounin October 15, 2013 11:40AM

Re: nginx -t > Illegal instruction

Sergey Kandaurov October 15, 2013 01:08PM

Re: nginx -t > Illegal instruction

Gena Makhomed October 15, 2013 01:38PM

Re: nginx -t > Illegal instruction

Igor Sysoev October 15, 2013 02:02PM

Re: nginx -t > Illegal instruction

Gena Makhomed October 15, 2013 03:20PM

Re: nginx -t > Illegal instruction

Sergey Talchuk October 18, 2013 02:44AM

Re: nginx -t > Illegal instruction

Maxim Dounin October 15, 2013 02:10PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 171
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready