# Nginx segfault problem

**URL:** <https://www.ruby-forum.com/t/nginx-segfault-problem/201311>\
**Category:** NGINX\
**Created:** [January 5, 2011, 4:31am UTC](https://www.ruby-forum.com/t/nginx-segfault-problem/201311 "2011-01-05T04:31:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [January 5, 2011, 4:31am UTC](https://www.ruby-forum.com/t/nginx-segfault-problem/201311/1 "2011-01-05T04:31:25Z")

</div>

My server enviroment:nginx 0.8.40+fastcgi,and recently have this problem  
in /var/messages which cause my nginx down:

[color=#9999FF]localhost kernel: nginx[31052]: segfault at  
0000000000000008 rip 0000000000466456 rsp 00007fffa6c110a0 error  
6[/color]

This problem is a little bit frequently,someone know what’s  
problem?Appreciate!

Posted at Nginx Forum:

> **[nginx segfault problem](https://forum.nginx.org/read.php?2,163596,163596#msg-163596)**
>
> My server enviroment:nginx 0.8.40+fastcgi,and recently have this problem in /var/messages which cause my nginx down: \[b\]\[color=#9999FF\]localhost kernel: nginx\[31052\]: segfault at 0000000000000008 rip 0000000000466456 rsp 00007fffa6c110a0 error...

---

<div class="post-metadata">

**Author:** ![andyhuax](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/838e76/32.png) [@andyhuax](https://www.ruby-forum.com/u/andyhuax)\
**Post date:** [January 5, 2011, 4:33am UTC](https://www.ruby-forum.com/t/nginx-segfault-problem/201311/2 "2011-01-05T04:33:19Z")

</div>

this log messages is found at /var/log/messages

Posted at Nginx Forum:

> **[Re: nginx segfault problem](https://forum.nginx.org/read.php?2,163596,163597#msg-163597)**
>
> My server enviroment:nginx 0.8.40+fastcgi,and recently have this problem in /var/messages which cause my nginx down: \[b\]\[color=#9999FF\]localhost kernel: nginx\[31052\]: segfault at 0000000000000008 rip 0000000000466456 rsp 00007fffa6c110a0 error...

---

<div class="post-metadata">

**Author:** ![andyhuax](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/838e76/32.png) [@andyhuax](https://www.ruby-forum.com/u/andyhuax)\
**Post date:** [January 5, 2011, 4:41am UTC](https://www.ruby-forum.com/t/nginx-segfault-problem/201311/3 "2011-01-05T04:41:32Z")

</div>

andyhuax at 2011-1-5 11:32 wrote:

> this log messages is found at /var/log/messages

1. Get the core dump, use gdb to print the stacktrace.
2. Print your Nginx version: ./nginx -V
3. Put your Nginx’s config file.

> Posted at Nginx Forum:  
> [http://forum.nginx.org/read.php?2,163596,163597#msg-163597](http://forum.nginx.org/read.php?2,163596,163597#msg-163597)
> 
> * * *
> 
> nginx mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [mailman.nginx.org archive](http://nginx.org/mailman/listinfo/nginx)

–  
Weibin Y.

---

<div class="post-metadata">

**Author:** ![andyhuax](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/838e76/32.png) [@andyhuax](https://www.ruby-forum.com/u/andyhuax)\
**Post date:** [January 5, 2011, 5:31am UTC](https://www.ruby-forum.com/t/nginx-segfault-problem/201311/4 "2011-01-05T05:31:47Z")

</div>

Hello!

On Tue, Jan 04, 2011 at 10:30:09PM -0500, andyhuax wrote:

> My server enviroment:nginx 0.8.40+fastcgi,and recently have this problem  
> in /var/messages which cause my nginx down:
> 
> [color=#9999FF]localhost kernel: nginx[31052]: segfault at  
> 0000000000000008 rip 0000000000466456 rsp 00007fffa6c110a0 error  
> 6[/color]
> 
> This problem is a little bit frequently,someone know what’s  
> problem?Appreciate!

See here for debugging instructions:

> **[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki...](https://github.com/nginxinc/nginx-wiki)**
>
> ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com

Note well that 0.8.40 is rather old, it’s probably good idea to  
upgrade to at least 0.8.54 (or better 0.9.3).

Maxim D.

---

<div class="post-metadata">

**Author:** ![andyhuax](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/838e76/32.png) [@andyhuax](https://www.ruby-forum.com/u/andyhuax)\
**Post date:** [January 5, 2011, 7:51am UTC](https://www.ruby-forum.com/t/nginx-segfault-problem/201311/5 "2011-01-05T07:51:27Z")

</div>

Thanks all,  
1. Get the core dump, use gdb to print the stacktrace.  
I have no idea how to do this,i will try later

2. Print your Nginx version: ./nginx -V

[color=#9933FF]nginx version: nginx/0.8.40  
TLS SNI support disabled  
configure arguments: --user=nginx --group=nginx  
–prefix=/usr/local/nginx-0.8.40  
–sbin-path=/usr/local/nginx-0.8.40/bin/nginx  
–conf-path=/usr/local/nginx-0.8.40/conf/nginx.conf  
–pid-path=/var/run/nginx.pid --with-pcre=…/pcre-7.8  
–with-http\_stub\_status\_module --with-http\_sub\_module  
–with-http\_ssl\_module --add-module=…/nginx\_http\_push\_module-0.692/  
–add-module=…/agentzh-chunkin-nginx-module-0f492bf/[/color]

3. Put your Nginx’s config file.

[color=#9933FF]user nobody nobody;

worker\_processes 10;

#error\_log /var/logs/error.log;  
#error\_log /var/logs/error.log notice;  
#error\_log /var/logs/error.log info;  
pid /var/run/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by  
this process.  
worker\_rlimit\_nofile 51200;

events  
{  
use epoll;  
#maxclient = worker\_processes \* worker\_connections / cpu\_number  
worker\_connections 51200;  
}

http  
{  
include mime.types;  
default\_type application/octet-stream;

```
   log_format main '$remote_addr - $remote_user [$time_local]

```

$request ’  
'“$status” $body\_bytes\_sent “$http\_referer” ’  
‘“$http\_user\_agent” “$http\_x\_forwarded\_for”’  
‘“$gzip\_ratio”’;

```
    log_format download '$remote_addr - $remote_user [$time_local]

```

’  
'“$request” $status $bytes\_sent ’  
'“$http\_referer” “$http\_user\_agent” ’  
‘“$http\_range”  
“$sent\_http\_content\_range”’;

```
   sendfile on;
   tcp_nopush on;
   tcp_nodelay on;
   #send_lowat 12000;

   keepalive_timeout 75 20;
   request_pool_size 4k;
   connection_pool_size 256;

   client_header_timeout 3m;
   client_body_timeout 3m;
   send_timeout 3m;

   client_header_buffer_size 1k;
   large_client_header_buffers 4 2k;

   output_buffers 4 32k;
   postpone_output 1460;
   client_max_body_size 10m;
   client_body_buffer_size 256k;
   client_body_temp_path /dev/shm/client_body_temp;
   proxy_temp_path /usr/local/nginx/proxy_temp;
   fastcgi_temp_path /usr/local/nginx/fastcgi_temp;

   #gzip
   gzip on;
   gzip_http_version 1.1;
   gzip_comp_level 2;
   gzip_proxied any;
   gzip_types text/plain text/css application/x-javascript text/xml

```

application/xml application/xml+rss text/javascript;  
gzip\_min\_length 1100;  
gzip\_buffers 4 8k;

```
   # The following includes are specified for virtual hosts
   include vhosts/host1.conf;

```

}[/color]

###############################################################  
host1.conf:

[color=#9933FF]###host1 setting start,add by script###########  
server {  
listen 80;  
server\_name host1 [www.dhaxx.com](http://www.dhaxx.com);  
index index.html index.htm index.php;  
root /data/wwwroot/host1/webroot;

#error\_page 404 /404error/404.html;  
#error\_page 500 502 503 504 /404error/50x.html;  
location = /favicon.ico {  
log\_not\_found off;  
}

```
location ~ .*\.php?$
{
include fastcgi_params;
fastcgi_pass 127.0.0.1:10080;
#fastcgi_pass unix:/usr/local/php/etc/php-cgi.socket;
fastcgi_index index.php;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME

```

/data/wwwroot/host1/webroot$fastcgi\_script\_name;  
}

location /intime {  
push\_channel\_group pushmodule\_chat;

```
location /intime/publish {
    set $push_channel_id $arg_id; #static channel id
    push_publisher;
    push_message_timeout 5m;
    push_message_buffer_length 0;
}
location /intime/subscribe {

```

#push\_authorized\_channels\_only on;  
set $push\_channel\_id $arg\_id; #static channel id  
push\_subscriber;  
send\_timeout 3600; #so that nginx won’t drop connections  
willy-nilly  
}  
}  
location ~\* ^/(?!intime) {  
if (!-e $request\_filename) {  
rewrite ^/(.+)$ /index.php?kohana\_uri=$1 last;  
}  
}  
location ~ ^/upload/ {  
root /data/upload/host1/upload;  
expires 30d;  
}

location ~\* /upload/.\*.php$ {  
deny all;  
}

location ~ ^/cache/ {  
root /data/upload/host1/upload;  
}

location ~ ^/weblogs/ {  
root /data/weblogs/host1;  
allow 218.5.2.219;  
allow 220.250.21.82;  
allow 121.207.254.240/28;  
deny all;  
auth\_basic “Restricted”;  
auth\_basic\_user\_file passwd/weblogs;  
}

location ~\* .(gif|jpg|jpeg|css|js|bmp|png)$ {  
expires max;  
}

if (-d $request\_filename) {  
rewrite ^/(.\*)([^/])$ http://$host/$1$2/ permanent;  
}  
rewrite ^/slr/([0-9A-Za-z]+)/?$ /slr/yourls-go.php?id=$1 last;  
rewrite ^/slr/([0-9A-Za-z]+)+/?$ /slr/yourls-infos.php?id=$1 last;  
rewrite ^/slr/([0-9A-Za-z]+)+all/?$ /slr/yourls-infos.php?id=$1&all=1  
last;

error\_log /data/httplogs/host1-error.log;  
access\_log /data/httplogs/host1-aceess.log main;

}  
###setting start,add by script###########  
server {  
listen 443;  
server\_name host1 momo.im www.momo.im;  
index index.html index.htm index.php;  
root /data/wwwroot/host1/webroot;  
ssl on;  
#ssl\_protocols SSLv3 TLSv1;  
#ssl\_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;

#ssl\_prefer\_server\_ciphers on;  
ssl\_session\_timeout 5m;  
ssl\_certificate /usr/local/nginx/conf/ssl/momo\_im.pem;  
ssl\_certificate\_key /usr/local/nginx/conf/ssl/momo.im.new.key;  
#error\_page 404 /404error/404.html;  
#error\_page 500 502 503 504 /404error/50x.html;  
location = /favicon.ico {  
log\_not\_found off;  
}

```
location ~ .*\.php?$
{
include fastcgi_params;
fastcgi_pass 127.0.0.1:10080;
#fastcgi_pass unix:/usr/local/php/etc/php-cgi.socket;
fastcgi_index index.php;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME

```

/data/wwwroot/host1/webroot$fastcgi\_script\_name;  
}

location /intime {  
push\_channel\_group pushmodule\_chat;

```
location /intime/publish {
    set $push_channel_id $arg_id; #static channel id
    push_publisher;
    push_message_timeout 5m;
    push_message_buffer_length 0;
}
location /intime/subscribe {

```

#push\_authorized\_channels\_only on;  
set $push\_channel\_id $arg\_id; #static channel id  
push\_subscriber;  
send\_timeout 3600; #so that nginx won’t drop connections  
willy-nilly  
}  
}  
location ~\* ^/(?!intime) {  
if (!-e $request\_filename) {  
rewrite ^/(.+)$ /index.php?kohana\_uri=$1 last;  
}  
}  
location ~ ^/upload/ {  
root /data/upload/host1/upload;  
expires 30d;  
}

location ~\* /upload/.\*.php$ {  
deny all;  
}

location ~ ^/cache/ {  
root /data/upload/host1/upload;  
}

location ~ ^/weblogs/ {  
root /data/weblogs/host1;  
allow 218.5.2.219;  
allow 220.250.21.82;  
allow 121.207.254.240/28;  
deny all;  
auth\_basic “Restricted”;  
auth\_basic\_user\_file passwd/weblogs;  
}

location ~\* .(gif|jpg|jpeg|css|js|bmp|png)$ {  
expires max;  
}

if (-d $request\_filename) {  
rewrite ^/(.\*)([^/])$ http://$host/$1$2/ permanent;  
}  
rewrite ^/slr/([0-9A-Za-z]+)/?$ /slr/yourls-go.php?id=$1 last;  
rewrite ^/slr/([0-9A-Za-z]+)+/?$ /slr/yourls-infos.php?id=$1 last;  
rewrite ^/slr/([0-9A-Za-z]+)+all/?$ /slr/yourls-infos.php?id=$1&all=1  
last;

error\_log /data/httplogs/host1-error.log;  
access\_log /data/httplogs/host1-aceess.log main;

}[/color]

Posted at Nginx Forum:

> **[Re: nginx segfault problem](https://forum.nginx.org/read.php?2,163596,163616#msg-163616)**
>
> My server enviroment:nginx 0.8.40+fastcgi,and recently have this problem in /var/messages which cause my nginx down: \[b\]\[color=#9999FF\]localhost kernel: nginx\[31052\]: segfault at 0000000000000008 rip 0000000000466456 rsp 00007fffa6c110a0 error...
