Welcome! Log In Create A New Profile

Advanced

Re: nginx worker segfault, NULL pool

Maxim Dounin
June 09, 2012 08:04PM
Hello!

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

> Hallo Maxim,
>
> On Sat, 09 June 2012 Maxim Dounin <mdounin@mdounin.ru> wrote:
> > On Fri, Jun 08, 2012 at 11:40:46PM +0200, Bruno Prémont wrote:
> > > > On Fri, 08 June 2012 Maxim Dounin <mdounin@mdounin.ru> 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.
> > >
> > > 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).
> >
> > 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 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=<optimized out>, conf=<optimized out>) 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=<optimized out>, argv=<optimized out>) 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 Dounin

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

nginx worker segfault, NULL pool

Bruno Prémont June 08, 2012 08:42AM

Re: nginx worker segfault, NULL pool

Maxim Dounin June 08, 2012 11:32AM

Re: nginx worker segfault, NULL pool

Bruno Prémont June 08, 2012 03:46PM

Re: nginx worker segfault, NULL pool

Bruno Prémont June 08, 2012 05:42PM

Re: nginx worker segfault, NULL pool

Maxim Dounin June 09, 2012 09:50AM

Re: nginx worker segfault, NULL pool

Bruno Prémont June 09, 2012 10:56AM

Re: nginx worker segfault, NULL pool

Maxim Dounin June 09, 2012 08:04PM

Re: nginx worker segfault, NULL pool

Bruno Prémont June 10, 2012 06:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 193
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