# Nginx worker segfault, NULL pool

**URL:** <https://www.ruby-forum.com/t/nginx-worker-segfault-null-pool/220414>\
**Category:** NGINX\
**Created:** [June 8, 2012, 2:41pm UTC](https://www.ruby-forum.com/t/nginx-worker-segfault-null-pool/220414 "2012-06-08T14:41:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [June 8, 2012, 2:41pm UTC](https://www.ruby-forum.com/t/nginx-worker-segfault-null-pool/220414/1 "2012-06-08T14:41:31Z")

</div>

Hi,

Running nginx on ARM I’m having it segfault at about any request (those  
known not to crash are /status/nginx and /status/php-fpm).  
Attaching it with GDB I get the following trace:

Program received signal SIGSEGV, Segmentation fault.  
ngx\_alloc\_chain\_link (pool=0x0) at src/core/ngx\_buf.c:52  
52 src/core/ngx\_buf.c: No such file or directory.  
in src/core/ngx\_buf.c  
(gdb) backtrace  
#0 ngx\_alloc\_chain\_link (pool=0x0) at src/core/ngx\_buf.c:52  
#1 0x00012290 in ngx\_chain\_writer (data=0x525b24, in=)  
at src/core/ngx\_output\_chain.c:626  
#2 0x0001202c in ngx\_output\_chain (ctx=0x525ae4, in=0x5260a4) at  
src/core/ngx\_output\_chain.c:66  
#3 0x0004a6d0 in ngx\_http\_upstream\_send\_request (r=0x524c18,  
u=0x525a9c) at src/http/ngx\_http\_upstream.c:1394  
#4 0x0004aeec in ngx\_http\_upstream\_init\_request (r=0x524c18) at  
src/http/ngx\_http\_upstream.c:645  
#5 ngx\_http\_upstream\_init (r=0x524c18) at  
src/http/ngx\_http\_upstream.c:446  
#6 0x000427a4 in ngx\_http\_read\_client\_request\_body (r=0x524c18,  
post\_handler=0x4ac80 \<ngx\_http\_upstream\_init\>) at  
src/http/ngx\_http\_request\_body.c:59  
#7 0x000612e0 in ngx\_http\_fastcgi\_handler (r=0x524c18) at  
src/http/modules/ngx\_http\_fastcgi\_module.c:636  
#8 0x00036d18 in ngx\_http\_core\_content\_phase (r=0x524c18, ph=0x54ce08)  
at src/http/ngx\_http\_core\_module.c:1396  
#9 0x00032458 in ngx\_http\_core\_run\_phases (r=0x524c18) at  
src/http/ngx\_http\_core\_module.c:877  
#10 0x00037848 in ngx\_http\_internal\_redirect (r=0x524c18, uri=, args=) at src/http/ngx\_http\_core\_module.c:2545  
#11 0x0004dad0 in ngx\_http\_index\_handler (r=0x524c18) at  
src/http/modules/ngx\_http\_index\_module.c:277  
#12 0x00036d38 in ngx\_http\_core\_content\_phase (r=0x524c18, ph=0x54ce08)  
at src/http/ngx\_http\_core\_module.c:1403  
#13 0x00032458 in ngx\_http\_core\_run\_phases (r=0x524c18) at  
src/http/ngx\_http\_core\_module.c:877  
#14 0x0003bccc in ngx\_http\_process\_request (r=0x524c18) at  
src/http/ngx\_http\_request.c:1688  
#15 0x0003c6e0 in ngx\_http\_process\_request\_line (rev=0x40a5b10c) at  
src/http/ngx\_http\_request.c:932  
#16 0x000397b8 in ngx\_http\_init\_request (rev=0x40a5b10c) at  
src/http/ngx\_http\_request.c:519  
#17 0x0002bf70 in ngx\_epoll\_process\_events (cycle=,  
timer=, flags=) at  
src/event/modules/ngx\_epoll\_module.c:679  
#18 0x00023d0c in ngx\_process\_events\_and\_timers (cycle=0x51ec18) at  
src/event/ngx\_event.c:247  
#19 0x0002a278 in ngx\_worker\_process\_cycle (cycle=,  
data=) at src/os/unix/ngx\_process\_cycle.c:806  
#20 0x00028920 in ngx\_spawn\_process (cycle=0x51ec18, proc=0,  
data=0x40096918, name=0x69d00 “worker process”, respawn=-3) at  
src/os/unix/ngx\_process.c:198  
#21 0x0002a6f0 in ngx\_start\_worker\_processes (cycle=0x51ec18, n=1,  
type=-3) at src/os/unix/ngx\_process\_cycle.c:365  
#22 0x0002acb0 in ngx\_master\_process\_cycle (cycle=0x51ec18) at  
src/os/unix/ngx\_process\_cycle.c:137  
#23 0x0000eb64 in main (argc=, argv=) at  
src/core/nginx.c:410

System is Gentoo on ARM (armv5tel), nginx -V (applied patch:  
forward-ported  
ipv6-geoip support patch as attached):

nginx version: nginx/1.2.1  
TLS SNI support enabled  
configure arguments: --prefix=/usr --conf-path=/etc/nginx/nginx.conf  
–error-log-path=/var/log/nginx/error\_log --pid-path=/var/run/nginx.pid  
–lock-path=/var/lock/nginx.lock --with-cc-opt=-I/usr/include  
–with-ld-opt=-L/usr/lib --http-log-path=/var/log/nginx/access\_log  
–http-client-body-temp-path=/var/tmp/nginx/client  
–http-proxy-temp-path=/var/tmp/nginx/proxy  
–http-fastcgi-temp-path=/var/tmp/nginx/fastcgi  
–http-scgi-temp-path=/var/tmp/nginx/scgi  
–http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --with-file-aio  
–with-aio\_module --with-ipv6 --with-pcre --without-http\_browser\_module  
–without-http\_charset\_module --without-http\_empty\_gif\_module  
–without-http\_memcached\_module --without-http\_proxy\_module  
–without-http\_referer\_module --without-http\_scgi\_module  
–without-http\_split\_clients\_module --without-http\_userid\_module  
–without-http\_uwsgi\_module --with-http\_geoip\_module  
–with-http\_stub\_status\_module --with-http\_xslt\_module  
–with-http\_realip\_module  
–add-module=/var/tmp/portage/www-servers/nginx-1.2.1/work/agentzh-headers-more-nginx-module-3580526  
–without-http-cache --with-http\_ssl\_module --without-mail\_imap\_module  
–without-mail\_pop3\_module --without-mail\_smtp\_module --user=nginx  
–group=nginx

Having a look at the code it means that  
ngx\_http\_upstream\_t-\>output-\>filter\_ctx-\>pool is NULL  
but still being dereferenced…

I have seen equivalent crash behavior for nginx-1.2.0 (no analysed or  
check exact  
cause with gdb and debug symbols) on the same host but have not seen  
crashes  
on an x86 system with 1.2.0.  
Note, config might help trigger the issue, quoted below:

############ nginx.conf ###############  
user nginx nginx;  
daemon off;  
worker\_processes 1;  
worker\_cpu\_affinity 0001;  
worker\_rlimit\_nofile 65535;

error\_log /var/log/nginx/error\_log info;

events {  
accept\_mutex off;  
worker\_connections 10240;  
use epoll;  
}

http {  
include /etc/nginx/mime.types;  
#default\_type application/octet-stream;  
server\_names\_hash\_bucket\_size 64;

```
    geoip_country /usr/share/GeoIP/GeoIPv6.dat;

    log_format main
            '$remote_addr $host $remote_user [$time_local] '
            '"$request" $status $bytes_sent '
            '"$http_referer" "$http_user_agent" $request_time 

```

“$gzip\_ratio” -’;  
log\_format main\_ssl  
'$remote\_addr $host $remote\_user [$time\_local] ’  
'"$request" $status $bytes\_sent ’  
‘"$http\_referer" “$http\_user\_agent” $request\_time  
“$gzip\_ratio” $ssl\_protocol’;

```
    client_header_timeout 10m;
    client_body_timeout 10m;
    send_timeout 10m;

    connection_pool_size 256;
    client_header_buffer_size 1k;
    large_client_header_buffers 4 2k;
    request_pool_size 4k;

    gzip on;
    gzip_min_length 1100;
    gzip_buffers 4 8k;
    gzip_types text/plain application/xhtml+xml text/css 

```

application/javascript application/xml application/json;

```
    output_buffers 1 32k;
    postpone_output 1460;

    sendfile off;
    tcp_nopush on;
    tcp_nodelay on;

    keepalive_timeout 75 20;

    ignore_invalid_headers on;

    index index.html;

    # HTTP catch-all
    server {
listen <local_addr-v4>:80 default_server;
listen [<local_addr-v6]:80 default_server;

            access_log /var/log/nginx/access_log main;
            error_log /var/log/nginx/error_log info;
            rewrite_log off;

            return 410;
    }

    ########## include-1-start ###############

```

server {  
#  
# HTTP access not wanted, redirect to HTTPS!  
#  
listen \<local\_addr-v4\>:80;  
listen [\<local\_addr-v6]:80;  
include listen;  
server\_name armbox.tld;

```
      access_log /var/log/nginx/sheeva.log main;
      error_log /var/log/nginx/sheeva.elog info;
      rewrite_log off;

      ########## include-2-start ###############
            allow <subnet-v6>; # replaced subnet with placeholder
allow <subnet-v6>;
allow <subnet-v4>;
allow <subnet-v4>;
deny all;

root /home/www/htdocs;
index index.php index.html;

error_page 400 /error400.php;
error_page 403 /error403.php;
error_page 404 /error404.php;
error_page 500 /error500.php;
error_page 502 /error502.php;
error_page 503 /error503.php;

rewrite ^/$ /status.html redirect;

# Status monitoring pages
location ~ ^/status/php-fpm$ {
        include fastcgi_params;
        fastcgi_buffer_size 8k;
        fastcgi_buffers 16 4k;
        fastcgi_param SCRIPT_FILENAME /dev/null;
        fastcgi_param REDIRECT_STATUS 200;
        fastcgi_pass unix:/run/php-fpm/fpm.socket;
}
location = /status/nginx {
        stub_status on;
}

# Remaining pages
location ~ ^/(?<page>.*)\.html$ {
        # Rewrite non-html pages to php
        if (-f $request_filename) { break; }
        if (-f $document_root/$page.php ) { rewrite ^ /$page.php 

```

last; }  
}  
rewrite ^/rrdgraph.(png|svg|pdf|eps)$ /rrdgraph.php last;  
location ~ ^/(?.\*/)?error(?[0-9]+).php$ {  
# Handle error pages  
if (!-f $document\_root/$path/error.php) { rewrite ^  
/error404.txt last; }  
if ($ecode !~ [0-9]+) { set $ecode 200; }  
include fastcgi\_params;  
fastcgi\_buffer\_size 8k;  
fastcgi\_buffers 16 4k;  
fastcgi\_param SCRIPT\_FILENAME  
$document\_root/$path/error.php;  
fastcgi\_param REDIRECT\_STATUS $ecode;  
fastcgi\_pass unix:/var/run/php-fpm/fpm.socket;  
}  
location ~ .php$ {  
# Handle PHP pages  
if (!-f $request\_filename) { rewrite ^ /error404.php last; }  
include fastcgi\_params;  
fastcgi\_buffer\_size 8k;  
fastcgi\_buffers 16 4k;  
fastcgi\_param SCRIPT\_FILENAME $request\_filename;  
fastcgi\_param REDIRECT\_STATUS 200;  
fastcgi\_pass unix:/var/run/php-fpm/fpm.socket;  
}  
location /img/ {  
expires 1h;  
}  
location /css/ {  
expires 1h;  
}  
location /js/ {  
expires 1h;  
}  
########## include-2-end ###############  
}  
########## include-1-end ###############  
}

---

<div class="post-metadata">

**Author:** ![SSBruno\_PrSSmontSS\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b4bc9f/32.png) [@SSBruno\_PrSSmontSS\_S](https://www.ruby-forum.com/u/SSBruno_PrSSmontSS_S)\
**Post date:** [June 8, 2012, 5:32pm UTC](https://www.ruby-forum.com/t/nginx-worker-segfault-null-pool/220414/2 "2012-06-08T17:32:12Z")

</div>

Hello!

On Fri, Jun 08, 2012 at 02:40:52PM +0200, Bruno Prémont wrote:

> Running nginx on ARM I’m having it segfault at about any request (those  
> known not to crash are /status/nginx and /status/php-fpm).  
> Attaching it with GDB I get the following trace:

[…]

> ```
> geoip_country /usr/share/GeoIP/GeoIPv6.dat;
> 
> ```

Is it works for you if you don’t use GeoIP?

[…]

Maxim D.

---

<div class="post-metadata">

**Author:** ![SSBruno\_PrSSmontSS\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b4bc9f/32.png) [@SSBruno\_PrSSmontSS\_S](https://www.ruby-forum.com/u/SSBruno_PrSSmontSS_S)\
**Post date:** [June 8, 2012, 11:41pm UTC](https://www.ruby-forum.com/t/nginx-worker-segfault-null-pool/220414/3 "2012-06-08T23:41:33Z")

</div>

Hello Maxim,

> > Is it works for you if you don’t use GeoIP?
> 
> Just disabling it config side makes no difference.
> 
> I will try disabling it at configure time and see if it changes  
> anything, though I doubt it will.

Exact same result when geoip support is not built at all.

Looking more exactly at the URLs I tested, static file like images  
don’t crash the worker, just those that get handled by php-fpm upstream  
do (e.g. /collectd/ which implies /collectd/index.php).

For the static files the result browser side looks the same, connection  
closed before getting any content but that time around nginx logs  
something  
to error log:  
2012/06/08 23:30:42 [alert] 20638#0: \*2 pread() read only 400 of 32768  
from “/home/www/htdocs/collectd/add.png” while sending response to  
client, client: 123.123.123.123, server: arm.tld, request: “GET  
/collectd/add.png HTTP/1.1”, host: “arm.tld”

Tough stat on that file returns:  
File: `/home/www/htdocs/collectd/add.png’  
Size: 400 Blocks: 8 IO Block: 4096 regular file  
Device: b302h/45826d Inode: 33 Links: 1  
Access: (0644/-rw-r–r–) Uid: ( 0/ root) Gid: ( 0/ root)  
Access: 2010-02-26 17:31:32.899120476 +0100  
Modify: 2010-02-26 17:31:32.899120476 +0100  
Change: 2011-05-07 01:19:21.440005750 +0200  
Birth: -

Toogling SendFile back to “on” seems to get file access to work again  
(a few days ago with 1.2.0 turning it of made it work for a day or  
so)???

Bruno

---

<div class="post-metadata">

**Author:** ![SSBruno\_PrSSmontSS\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b4bc9f/32.png) [@SSBruno\_PrSSmontSS\_S](https://www.ruby-forum.com/u/SSBruno_PrSSmontSS_S)\
**Post date:** [June 8, 2012, 9:44pm UTC](https://www.ruby-forum.com/t/nginx-worker-segfault-null-pool/220414/4 "2012-06-08T21:44:41Z")

</div>

Hello Maxim,

On Fri, 08 June 2012 Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On Fri, Jun 08, 2012 at 02:40:52PM +0200, Bruno Prémont wrote:
> 
> > Running nginx on ARM I’m having it segfault at about any request (those  
> > known not to crash are /status/nginx and /status/php-fpm).  
> > Attaching it with GDB I get the following trace:
> 
> […]
> 
> > ```
> > geoip_country /usr/share/GeoIP/GeoIPv6.dat;
> > 
> > ```
> 
> Is it works for you if you don’t use GeoIP?

Just disabling it config side makes no difference.

I will try disabling it at configure time and see if it changes  
anything, though I doubt it will.

Oh, and in case it is important, my fastcgi\_params include  
some extra options:

fastcgi\_param QUERY\_STRING $query\_string;  
fastcgi\_param REQUEST\_METHOD $request\_method;  
fastcgi\_param CONTENT\_TYPE $content\_type;  
fastcgi\_param CONTENT\_LENGTH $content\_length;

fastcgi\_param SCRIPT\_NAME $fastcgi\_script\_name;  
fastcgi\_param REQUEST\_URI $request\_uri;  
fastcgi\_param DOCUMENT\_URI $document\_uri;  
fastcgi\_param DOCUMENT\_ROOT $document\_root;  
fastcgi\_param SERVER\_PROTOCOL $server\_protocol;  
fastcgi\_param HTTPS $https if\_not\_empty;  
fastcgi\_param SSL\_CIPHER $ssl\_cipher if\_not\_empty;  
fastcgi\_param SSL\_PROTOCOL $ssl\_protocol if\_not\_empty;  
fastcgi\_param SSL\_SESSION\_ID $ssl\_session\_id if\_not\_empty;  
fastcgi\_param SSL\_CLIENT\_SERIAL $ssl\_client\_serial if\_not\_empty;  
fastcgi\_param SSL\_CLIENT\_S\_DN $ssl\_client\_s\_dn if\_not\_empty;  
fastcgi\_param SSL\_CLIENT\_I\_DN $ssl\_client\_i\_dn if\_not\_empty;  
fastcgi\_param SSL\_CLIENT\_CERT $ssl\_client\_cert if\_not\_empty;  
fastcgi\_param SSL\_CLIENT\_RAW\_CERT $ssl\_client\_raw\_cert if\_not\_empty;  
fastcgi\_param SSL\_CLIENT\_VERIFY $ssl\_client\_verify if\_not\_empty;

# disabled as requested

#fastcgi\_param GEOIP\_COUNTRY\_CODE $geoip\_country\_code;  
#fastcgi\_param GEOIP\_COUNTRY\_NAME $geoip\_country\_name;

fastcgi\_param GATEWAY\_INTERFACE CGI/1.1;  
fastcgi\_param SERVER\_SOFTWARE nginx/$nginx\_version;

fastcgi\_param REMOTE\_ADDR $remote\_addr;  
fastcgi\_param REMOTE\_PORT $remote\_port;  
fastcgi\_param SERVER\_ADDR $server\_addr;  
fastcgi\_param SERVER\_PORT $server\_port;  
fastcgi\_param SERVER\_NAME $server\_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect

fastcgi\_param REDIRECT\_STATUS 200;

> […]
> 
> Maxim D.

Bruno

---

<div class="post-metadata">

**Author:** ![SSBruno\_PrSSmontSS\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b4bc9f/32.png) [@SSBruno\_PrSSmontSS\_S](https://www.ruby-forum.com/u/SSBruno_PrSSmontSS_S)\
**Post date:** [June 9, 2012, 4:55pm UTC](https://www.ruby-forum.com/t/nginx-worker-segfault-null-pool/220414/5 "2012-06-09T16:55:06Z")

</div>

Hallo Maxim,

On Sat, 09 June 2012 Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > >
> > 
> > Looking more exactly at the URLs I tested, static file like images  
> > immediate exit on SIGBUS when unaligned access happens. You may  
> > get proper behaviour with
> 
> echo 4 \> /proc/cpu/alignment
> 
> This should allow to trace a root of your problems.
> 
> See [http://lecs.cs.ucla.edu/wiki/index.php/XScale\_alignment](http://lecs.cs.ucla.edu/wiki/index.php/XScale_alignment) for  
> more details.

Thanks for the pointer, will read trough it!

Seems to be that one, after echoing 4 to /proc/cpu/alignment nginx  
does not even start anymore (and `nginx -t` fails as well), each time  
with  
SIGBUS.

e.g. for `nginx -t` the first SIGBUS happens at

#0 0x0000d64c in ngx\_set\_cpu\_affinity (cf=0xbe892358, cmd=, conf=) at src/core/nginx.c:1275  
#1 0x0001cafc in ngx\_conf\_handler (last=13909340, cf=0xbe892358) at  
src/core/ngx\_conf\_file.c:394  
#2 ngx\_conf\_parse (cf=0xbe892358, filename=0xd43d70) at  
src/core/ngx\_conf\_file.c:244  
#3 0x0001aba4 in ngx\_init\_cycle (old\_cycle=0xbe8923c0) at  
src/core/ngx\_cycle.c:268  
#4 0x0000e29c in main (argc=, argv=) at  
src/core/nginx.c:331

as backtraced with gdb.

Thanks,  
Bruno

---

<div class="post-metadata">

**Author:** ![SSBruno\_PrSSmontSS\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b4bc9f/32.png) [@SSBruno\_PrSSmontSS\_S](https://www.ruby-forum.com/u/SSBruno_PrSSmontSS_S)\
**Post date:** [June 9, 2012, 3:48pm UTC](https://www.ruby-forum.com/t/nginx-worker-segfault-null-pool/220414/6 "2012-06-09T15:48:28Z")

</div>

Hello!

On Fri, Jun 08, 2012 at 11:40:46PM +0200, Bruno Prémont wrote:

> > > > ```
> > > > geoip_country /usr/share/GeoIP/GeoIPv6.dat;
> > > > 
> > > > ```
> 
> Looking more exactly at the URLs I tested, static file like images  
> don’t crash the worker, just those that get handled by php-fpm upstream  
> do (e.g. /collectd/ which implies /collectd/index.php).

You’ve claimed above “/status/php-fpm” works ok too. Is it was  
mistake?

Anyway, please make sure you have aligment problems properly  
reported by a kernel. It looks like the linux kernel has an  
unfortunate default to silently ignore alignment problems on arm,  
which results in data corruption on unaligned accesses instead of  
immediate exit on SIGBUS when unaligned access happens. You may  
get proper behaviour with

echo 4 \> /proc/cpu/alignment

This should allow to trace a root of your problems.

See [http://lecs.cs.ucla.edu/wiki/index.php/XScale\_alignment](http://lecs.cs.ucla.edu/wiki/index.php/XScale_alignment) for  
more details.

Maxim D.

---

<div class="post-metadata">

**Author:** ![SSBruno\_PrSSmontSS\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b4bc9f/32.png) [@SSBruno\_PrSSmontSS\_S](https://www.ruby-forum.com/u/SSBruno_PrSSmontSS_S)\
**Post date:** [June 10, 2012, 2:03am UTC](https://www.ruby-forum.com/t/nginx-worker-segfault-null-pool/220414/7 "2012-06-10T02:03:50Z")

</div>

Hello!

On Sat, Jun 09, 2012 at 04:54:01PM +0200, Bruno Prémont wrote:

> > > > > […]  
> > > > > Exact same result when geoip support is not built at all.  
> > > > > reported by a kernel. It looks like the linux kernel has an  
> > > > > more details.  
> > > > > #1 0x0001cafc in ngx\_conf\_handler (last=13909340, cf=0xbe892358) at  
> > > > > src/core/ngx\_conf\_file.c:394  
> > > > > #2 ngx\_conf\_parse (cf=0xbe892358, filename=0xd43d70) at  
> > > > > src/core/ngx\_conf\_file.c:244  
> > > > > #3 0x0001aba4 in ngx\_init\_cycle (old\_cycle=0xbe8923c0) at  
> > > > > src/core/ngx\_cycle.c:268  
> > > > > #4 0x0000e29c in main (argc=, argv=) at  
> > > > > src/core/nginx.c:331
> 
> as backtraced with gdb.

Ok, this looks sensisble.

Could you please provide ./configure output and test if the  
following patch fixes things for you?

diff --git a/auto/os/conf b/auto/os/conf  
— a/auto/os/conf  
+++ b/auto/os/conf  
@@ -93,6 +93,7 @@ case “$NGX\_MACHINE” in  
;;

```
 *)

```

- 

```
   have=NGX_ALIGNMENT value=16 . auto/define
   NGX_MACH_CACHE_LINE=32

```

;;

Maxim D.

---

<div class="post-metadata">

**Author:** ![SSBruno\_PrSSmontSS\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/b4bc9f/32.png) [@SSBruno\_PrSSmontSS\_S](https://www.ruby-forum.com/u/SSBruno_PrSSmontSS_S)\
**Post date:** [June 10, 2012, 12:50pm UTC](https://www.ruby-forum.com/t/nginx-worker-segfault-null-pool/220414/8 "2012-06-10T12:50:31Z")

</div>

Hello Maxim,

On Sun, 10 June 2012 Maxim D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > >
> 
> Ok, this looks sensisble.  
> \*)
> 
> - 
> 
> ```
> have=NGX_ALIGNMENT value=16 . auto/define
> NGX_MACH_CACHE_LINE=32
> 
> ```
> 
> ;;

The patch seems to fix things, `nginx -t` does not die on SIGBUS  
anymore,  
it also runs properly for the requests that made it fail (  
/proc/cpu/alignment does not account any new alignment traps).

Thanks!  
Bruno

Full configure output (as well as first few lines of make which shows  
used CFLAGS – compiler does not generate any warnings):

checking for OS

- Linux 2.6.37-00003-g924cf4c armv5tel  
checking for C compiler … found
- using GNU C compiler  
checking for --with-ld-opt=“-L/usr/lib” … found  
checking for gcc builtin atomic operations … found  
checking for C99 variadic macros … found  
checking for gcc variadic macros … found  
checking for unistd.h … found  
checking for inttypes.h … found  
checking for limits.h … found  
checking for sys/filio.h … not found  
checking for sys/param.h … found  
checking for sys/mount.h … found  
checking for sys/statvfs.h … found  
checking for crypt.h … found  
checking for Linux specific features  
checking for epoll … found  
checking for sendfile() … found  
checking for sendfile64() … found  
checking for sys/prctl.h … found  
checking for prctl(PR\_SET\_DUMPABLE) … found  
checking for sched\_setaffinity() … found  
checking for crypt\_r() … found  
checking for sys/vfs.h … found  
checking for poll() … found  
checking for /dev/poll … not found  
checking for kqueue … not found  
checking for crypt() … not found  
checking for crypt() in libcrypt … found  
checking for F\_READAHEAD … not found  
checking for posix\_fadvise() … found  
checking for O\_DIRECT … found  
checking for F\_NOCACHE … not found  
checking for directio() … not found  
checking for statfs() … found  
checking for statvfs() … found  
checking for dlopen() … not found  
checking for dlopen() in libdl … found  
checking for sched\_yield() … found  
checking for SO\_SETFIB … not found  
checking for SO\_ACCEPTFILTER … not found  
checking for TCP\_DEFER\_ACCEPT … found  
checking for TCP\_KEEPIDLE, TCP\_KEEPINTVL, TCP\_KEEPCNT … found  
checking for TCP\_INFO … found  
checking for accept4() … found  
checking for kqueue AIO support … not found  
checking for Linux AIO support … found  
checking for int size … 4 bytes  
checking for long size … 4 bytes  
checking for long long size … 8 bytes  
checking for void \* size … 4 bytes  
checking for uint64\_t … found  
checking for sig\_atomic\_t … found  
checking for sig\_atomic\_t size … 4 bytes  
checking for socklen\_t … found  
checking for in\_addr\_t … found  
checking for in\_port\_t … found  
checking for rlim\_t … found  
checking for uintptr\_t … uintptr\_t found  
checking for system endianess … little endianess  
checking for size\_t size … 4 bytes  
checking for off\_t size … 8 bytes  
checking for time\_t size … 4 bytes  
checking for AF\_INET6 … found  
checking for setproctitle() … not found  
checking for pread() … found  
checking for pwrite() … found  
checking for sys\_nerr … found  
checking for localtime\_r() … found  
checking for posix\_memalign() … found  
checking for memalign() … found  
checking for mmap(MAP\_ANON|MAP\_SHARED) … found  
checking for mmap(“/dev/zero”, MAP\_SHARED) … found  
checking for System V shared memory … found  
checking for POSIX semaphores … not found  
checking for POSIX semaphores in libpthread … found  
checking for struct msghdr.msg\_control … found  
checking for ioctl(FIONBIO) … found  
checking for struct tm.tm\_gmtoff … found  
checking for struct dirent.d\_namlen … not found  
checking for struct dirent.d\_type … found  
checking for sysconf(\_SC\_NPROCESSORS\_ONLN) … found  
checking for openat(), fstatat() … found  
configuring additional modules  
adding module in  
/var/tmp/portage/www-servers/nginx-1.2.1/work/agentzh-headers-more-nginx-module-3580526
- ngx\_http\_headers\_more\_filter\_module was configured  
checking for PCRE library … found  
checking for PCRE JIT support … found  
checking for OpenSSL library … found  
checking for zlib library … found  
checking for libxslt … found  
checking for libexslt … found  
creating objs/Makefile

Configuration summary

- using system PCRE library
- using system OpenSSL library
- md5: using OpenSSL library
- sha1: using OpenSSL library
- using system zlib library

nginx path prefix: “/usr”  
nginx binary file: “/usr/sbin/nginx”  
nginx configuration prefix: “/etc/nginx”  
nginx configuration file: “/etc/nginx/nginx.conf”  
nginx pid file: “/var/run/nginx.pid”  
nginx error log file: “/var/log/nginx/error\_log”  
nginx http access log file: “/var/log/nginx/access\_log”  
nginx http client request body temporary files:  
“/var/tmp/nginx/client”  
nginx http fastcgi temporary files: “/var/tmp/nginx/fastcgi”

make -j2 ‘LINK=armv5tel-softfloat-linux-gnueabi-gcc -Wl,-O1  
-Wl,–as-needed’ ‘OTHERLDFLAGS=-Wl,-O1 -Wl,–as-needed’  
make -f objs/Makefile  
make[1]: Entering directory  
`/var/tmp/portage/www-servers/nginx-1.2.1/work/nginx-1.2.1’  
armv5tel-softfloat-linux-gnueabi-gcc -c -O2 -march=armv5te -mtune=xscale  
-pipe -Wall -ggdb -I/usr/include -I src/core -I src/event -I  
src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs   
-o objs/src/core/nginx.o   
src/core/nginx.c  
…
