Dive into Nginx Segmentation fault
For Nginx 1.14.0
Switch to ROOT user
> sudo -s
> gdb sbin/nginx
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /usr/local/nginx-1.14.0/sbin/nginx...done.
> (gdb) run -c conf/nginx.conf
Starting program: /usr/local/nginx-1.14.0/sbin/nginx -c conf/nginx.conf
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff4e49c13 in ?? () from /opt/dynatrace/oneagent/agent/lib64/liboneagentnginx.so
Trace the logging
> (gdb) bt
#0 0x00007ffff4e49c13 in ?? () from /opt/dynatrace/oneagent/agent/lib64/liboneagentnginx.so
#1 0x00007ffff4e4be6f in ?? () from /opt/dynatrace/oneagent/agent/lib64/liboneagentnginx.so
#2 0x00000000004400c2 in ngx_http_block (cf=0x7fffffffe160, cmd=<optimized out>, conf=<optimized out>)
at src/http/ngx_http.c:308
#3 0x00000000004240fa in ngx_conf_handler (last=1, cf=0x7fffffffe160) at src/core/ngx_conf_file.c:463
#4 ngx_conf_parse (cf=0x7fffffffe160, filename=0x717cc0) at src/core/ngx_conf_file.c:319
#5 0x000000000042189e in ngx_init_cycle (old_cycle=0x7fffffffe310) at src/core/ngx_cycle.c:275
#6 0x0000000000411001 in main (argc=<optimized out>, argv=<optimized out>) at src/core/nginx.c:291
> wget https://nginx.org/download/nginx-1.14.0.tar.gz
> tar -xzf nginx-1.14.0.tar.gz
> ./configure --prefix=/home/superuser/tool/nginx-1.14.0 --with-http_ssl_module
> make
> make install
Check ubuntu version
> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise
Work
nginx-1.1.19
nginx-1.9.9
nginx-1.11.0
nginx-1.11.6
nginx-1.11.8
nginx-1.11.9
Not Work
nginx-1.14.0
nginx-1.13.6
nginx-1.12.0
nginx-1.11.13
nginx-1.11.10
It is wired that 1.11.9 works, but 1.11.10 have the issue.
Changes with nginx 1.11.10 14 Feb 2017
*) Change: cache header format has been changed, previously cached
responses will be invalidated.
*) Feature: support of "stale-while-revalidate" and "stale-if-error"
extensions in the "Cache-Control" backend response header line.
*) Feature: the "proxy_cache_background_update",
"fastcgi_cache_background_update", "scgi_cache_background_update",
and "uwsgi_cache_background_update" directives.
*) Feature: nginx is now able to cache responses with the "Vary" header
line up to 128 characters long (instead of 42 characters in previous
versions).
*) Feature: the "build" parameter of the "server_tokens" directive.
Thanks to Tom Thorogood.
*) Bugfix: "[crit] SSL_write() failed" messages might appear in logs
when handling requests with the "Expect: 100-continue" request header
line.
*) Bugfix: the ngx_http_slice_module did not work in named locations.
*) Bugfix: a segmentation fault might occur in a worker process when
using AIO after an "X-Accel-Redirect" redirection.
*) Bugfix: reduced memory consumption for long-lived requests using
gzipping.
Changes with nginx 1.11.9 24 Jan 2017
*) Bugfix: nginx might hog CPU when using the stream module; the bug had
appeared in 1.11.5.
*) Bugfix: EXTERNAL authentication mechanism in mail proxy was accepted
even if it was not enabled in the configuration.
*) Bugfix: a segmentation fault might occur in a worker process if the
"ssl_verify_client" directive of the stream module was used.
*) Bugfix: the "ssl_verify_client" directive of the stream module might
not work.
*) Bugfix: closing keepalive connections due to no free worker
connections might be too aggressive.
Thanks to Joel Cunningham.
*) Bugfix: an incorrect response might be returned when using the
"sendfile" directive on FreeBSD and macOS; the bug had appeared in
1.7.8.
*) Bugfix: a truncated response might be stored in cache when using the
"aio_write" directive.
*) Bugfix: a socket leak might occur when using the "aio_write"
directive.
References:
http://www.rebol.com/docs/unpack-tar-gz.html
https://askubuntu.com/questions/686239/how-do-i-check-the-version-of-ubuntu-i-am-running
For Nginx 1.14.0
Switch to ROOT user
> sudo -s
> gdb sbin/nginx
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /usr/local/nginx-1.14.0/sbin/nginx...done.
> (gdb) run -c conf/nginx.conf
Starting program: /usr/local/nginx-1.14.0/sbin/nginx -c conf/nginx.conf
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff4e49c13 in ?? () from /opt/dynatrace/oneagent/agent/lib64/liboneagentnginx.so
Trace the logging
> (gdb) bt
#0 0x00007ffff4e49c13 in ?? () from /opt/dynatrace/oneagent/agent/lib64/liboneagentnginx.so
#1 0x00007ffff4e4be6f in ?? () from /opt/dynatrace/oneagent/agent/lib64/liboneagentnginx.so
#2 0x00000000004400c2 in ngx_http_block (cf=0x7fffffffe160, cmd=<optimized out>, conf=<optimized out>)
at src/http/ngx_http.c:308
#3 0x00000000004240fa in ngx_conf_handler (last=1, cf=0x7fffffffe160) at src/core/ngx_conf_file.c:463
#4 ngx_conf_parse (cf=0x7fffffffe160, filename=0x717cc0) at src/core/ngx_conf_file.c:319
#5 0x000000000042189e in ngx_init_cycle (old_cycle=0x7fffffffe310) at src/core/ngx_cycle.c:275
#6 0x0000000000411001 in main (argc=<optimized out>, argv=<optimized out>) at src/core/nginx.c:291
> wget https://nginx.org/download/nginx-1.14.0.tar.gz
> tar -xzf nginx-1.14.0.tar.gz
> ./configure --prefix=/home/superuser/tool/nginx-1.14.0 --with-http_ssl_module
> make
> make install
Check ubuntu version
> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise
Work
nginx-1.1.19
nginx-1.9.9
nginx-1.11.0
nginx-1.11.6
nginx-1.11.8
nginx-1.11.9
Not Work
nginx-1.14.0
nginx-1.13.6
nginx-1.12.0
nginx-1.11.13
nginx-1.11.10
It is wired that 1.11.9 works, but 1.11.10 have the issue.
Changes with nginx 1.11.10 14 Feb 2017
*) Change: cache header format has been changed, previously cached
responses will be invalidated.
*) Feature: support of "stale-while-revalidate" and "stale-if-error"
extensions in the "Cache-Control" backend response header line.
*) Feature: the "proxy_cache_background_update",
"fastcgi_cache_background_update", "scgi_cache_background_update",
and "uwsgi_cache_background_update" directives.
*) Feature: nginx is now able to cache responses with the "Vary" header
line up to 128 characters long (instead of 42 characters in previous
versions).
*) Feature: the "build" parameter of the "server_tokens" directive.
Thanks to Tom Thorogood.
*) Bugfix: "[crit] SSL_write() failed" messages might appear in logs
when handling requests with the "Expect: 100-continue" request header
line.
*) Bugfix: the ngx_http_slice_module did not work in named locations.
*) Bugfix: a segmentation fault might occur in a worker process when
using AIO after an "X-Accel-Redirect" redirection.
*) Bugfix: reduced memory consumption for long-lived requests using
gzipping.
Changes with nginx 1.11.9 24 Jan 2017
*) Bugfix: nginx might hog CPU when using the stream module; the bug had
appeared in 1.11.5.
*) Bugfix: EXTERNAL authentication mechanism in mail proxy was accepted
even if it was not enabled in the configuration.
*) Bugfix: a segmentation fault might occur in a worker process if the
"ssl_verify_client" directive of the stream module was used.
*) Bugfix: the "ssl_verify_client" directive of the stream module might
not work.
*) Bugfix: closing keepalive connections due to no free worker
connections might be too aggressive.
Thanks to Joel Cunningham.
*) Bugfix: an incorrect response might be returned when using the
"sendfile" directive on FreeBSD and macOS; the bug had appeared in
1.7.8.
*) Bugfix: a truncated response might be stored in cache when using the
"aio_write" directive.
*) Bugfix: a socket leak might occur when using the "aio_write"
directive.
References:
http://www.rebol.com/docs/unpack-tar-gz.html
https://askubuntu.com/questions/686239/how-do-i-check-the-version-of-ubuntu-i-am-running