Open splitice opened 11 years ago
after a bit of debugging, I beleive the error occurs when an error is thrown within the named location.
Such as file not found, or any proxy_pass connection error. e.g if you use "location @test { proxy_pass http://10.0.0.1; }" presuming 10.0.0.1 doesnt exist on your network.
and another backtrace generated that looks a bit different.
buf=0x8c9d480 "{ibootleg.org:46.17.96.109} ibootleg.org 79.161.51.12 - - [30/Jan/2013:08:25:44 +0400] \"GET /search/valkyria%20chronicles%202 HTTP/1.0\" 504 250 \"-\" \"Mozilla/5.0 (compatible; MJ12bot/v1.4.3; http://www"..., len=229)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:510
conf = 0x8c9d565
ctx = 0x8e22b0c
map = 0xfe
i = 23
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:381
line = 0x8c9d480 "{ibootleg.org:46.17.96.109} ibootleg.org 79.161.51.12 - - [30/Jan/2013:08:25:44 +0400] \"GET /search/valkyria%20chronicles%202 HTTP/1.0\" 504 250 \"-\" \"Mozilla/5.0 (compatible; MJ12bot/v1.4.3; http://www"...
len = 229
i = 2
l = 5
log = 0x1
lcf = 0x8d80860
conf = 0x8d80b8c
map = 0x8d80c1c
fmt = 0x8d6e96c
i = 1
n = 2
log_handler = 0x8dde11c
cmcf = 0x8d6e644
at src/http/ngx_http_request.c:3229
log = 0x8cefcd8
pool = 0xb7bae3a0
linger = {l_onoff = -1212488768, l_linger = 8}
cln = 0x0
ctx = 0xbf8959b8
clcf = 0xb7ad9d8c
at src/http/ngx_http_request.c:3181
c = 0xb26ed138
at src/http/ngx_http_request.c:3048
n = 0
timer = 30
c = 0xb26ed138
r = 0x8dafba8
clcf = 0x1388
buffer = "F\251\276\267\250\002\317\b\210\003\317\b\000\000\000\000\070\251\277\267\250\002\317\b8\251\277\267XZ\211\277\250\252\276\267\210x\314\b\f\000\000\000\210x\314\bd,\322\267(\362\311\b\300\336\310\b\300\303\306\b\f\000\000\000(\362\311\b\300\336\310\b\254Q\337\b8\251\277\267\210\365\316\b\300\303\306\b\230Z\211\277y\361\276\267\300\303\306\b\000\000\000\000\210x\314\bQ\255\251\267\002\000\211\277\340X\367\267&\210\274\267\250\002\317\b\200\303\306\b\300\336\310\bP\363\311\b8\251\277\267\000\000\000\000\360\327\330\b8[\211\277\066\267\276\267\210\365\316\b\300\303\306\b\360\327\330\bH\242\314\b(\362\311\b\310\247\314\b8[\211\277\002\337\307\267\000\000\000\000\n\000\000\000\350Z\211\277/\247\251\267\000\257\277\267p\330\330\b\300\303\306\b\000\000\000\000\000\000\000\000\250\002\317\b\000\000\000\000\300\303\306\b\000\000\000\0
00\000\000\000\000\250\002\317\b", '\000' <repeats 12 times>"\360, \327\330\b\210\365\316\bH\000\000\000\270\343\272\267\071\000\000\000\000\000\000\000\240\343\272\267\364\317\272\267\240\343\272\267\070\251\277\267\210\365\316\b\360\327\330\b\310[\211\277b\312\276\267\360\327\330\b\200\246\314\b\001\000\000\000\270r\314\b(\362\311\b", '\000' <repeats 20 times>"\253, \347\306\267\070\251\277\267\210\365\316\b`\324\330\b\026f\255\267\062T\275\267", '\000' <repeats 12 times>"\210, \365\316\b\030)\277\267xv\277\267\300\303\306\b\000\000\000\000\000\000\000\000"...
at src/event/ngx_event_posted.c:40
ev = 0x8e295c0
flags = 3
timer = 5000
delta = 40
at src/os/unix/ngx_process_cycle.c:807
worker = 0
i = 0
c = 0xbf896aa8
proc=0x807376e <ngx_worker_process_cycle>, data=0x0, name=0x80f7408 "worker process",
respawn=-4) at src/os/unix/ngx_process.c:198
on = 1
pid = 0
s = 3
at src/os/unix/ngx_process_cycle.c:362
i = 0
ch = {command = 1, pid = 148164076, slot = 147169076, fd = 135288024}
at src/os/unix/ngx_process_cycle.c:249
title = 0x8d58288 "master process /usr/sbin/nginx"
p = 0x8d582a6 ""
size = 31
i = 1
n = 0
sigio = 0
set = {__val = {0 <repeats 32 times>}}
itv = {it_interval = {tv_sec = -1208631004, tv_usec = 134681366}, it_value = {
tv_sec = 13, tv_usec = -1081513056}}
live = 1
delay = 0
ls = 0x6
ccf = 0x8d4cdec
i = 57
log = 0x810d894
cycle = 0x8c596f8
init_cycle = {conf_ctx = 0x0, pool = 0x8c590b0, log = 0x810d894, new_log = {
log_level = 0, file = 0x0, connection = 0, handler = 0, data = 0x0,
action = 0x0}, files = 0x0, free_connections = 0x0, free_connection_n = 0,
reusable_connections_queue = {prev = 0x0, next = 0x0}, listening = {elts = 0x0,
nelts = 0, size = 0, nalloc = 0, pool = 0x0}, paths = {elts = 0x0, nelts = 0,
size = 0, nalloc = 0, pool = 0x0}, open_files = {last = 0x0, part = {elts = 0x0,
nelts = 0, next = 0x0}, size = 0, nalloc = 0, pool = 0x0}, shared_memory = {
last = 0x0, part = {elts = 0x0, nelts = 0, next = 0x0}, size = 0, nalloc = 0,
pool = 0x0}, connection_n = 0, files_n = 0, connections = 0x0, read_events = 0x0,
write_events = 0x0, old_cycle = 0x0, conf_file = {len = 21,
data = 0x80f46f2 "/etc/nginx/nginx.conf"}, conf_param = {len = 0, data = 0x0},
conf_prefix = {len = 11, data = 0x80f46f2 "/etc/nginx/nginx.conf"}, prefix = {
len = 5, data = 0x80f46ec "/usr/"}, lock_file = {len = 0, data = 0x0},
hostname = {len = 0, data = 0x0}}
ccf = 0x8c59f34
Thx for bug report.
Can you attach minimal nginx.conf which reproduces bug, please? I can't reproduce bug just using named locations and error_page
directive.
I found some wrong code related with this issue (which I'm fixing for now), but it does not segfaults nginx.
Sure stripping down my testing config now for you.
upstream does_not_exist {
server 10.1.77.99;
}
server {
#just to make timeout quicker
proxy_read_timeout 2s;
proxy_connect_timeout 2s;
listen 88;
location @e504 {
internal;
proxy_pass http://does_not_exist;
}
location / {
root /does_not_exists/;
}
error_page 404 @e504;
}
That should do it.
If you require further assistance Ill give you access to a local testing server.
I think I fix a bug. If it does not work for you, let me know.
This issue appears to be fixed :) Ill deploy it on a live server tomorrow to confirm but its working fine on my testing server.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
---Type
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
---Type
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
---Type
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
---Type
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
---Type
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
---Type
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
---Type
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
---Type
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
---Type
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
No locals.
p=0xbfd0bea0 "\343\305\266\t", p_len=1920)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:501
....
Do you have error_page
directive in your production server?
Yes, the only difference between the two servers is that its proxy_pass call actually works, and that it gets a lot of traffic.
Im currently pushing out a temporary hack fix of
""" if(r->connection->log->handler != ngx_http_syslog_error_handler) ngx_http_syslog_ctx->old_handler = r->connection->log->handler; """
That I think should work temporarily as it does on my testing server, im pushing it to a production server now to confirm.
The config on the production server is something along the lines of """ location / { proxy_pass http://10.0.92.118; } location @e504 {
rewrite ^ /client/timeout.html break;
proxy_pass http://5.9.192.118;
} error_page 504 @e504 """
That should probably replicate it, I dont have a version without my modification compiled to confirm atm.
EDIT: Crappy hack of a patch by me does seem to work for now as far as I can tell.
Something that might be related now that I think of it, my production server has multiple http blocks with their own full configurations (error_page, logging etc)
e.g
http {
} http {
}
maybe that is causing double initialization?
Oh, looks like I found a problem. Trying to fix now.
Sounds good, and FYI heres another crash that happened while I was away. This is with my error logging patch applied and appears to be to do with acess_log. Although I havent got any replication instructions at this time.
(gdb) bt full
source=<value optimized out>, level=6, buf=<value optimized out>, len=299)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:518
conf = 0x40
ctx = 0x973c050
i = 21
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:389
line = 0x96f38fc "{web.dnstracks.com:46.17.97.53} web.dnstracks.com 213. 126.105.98 - - [31/Jan/2013:10:51:07 +0400] \"POST /web/xmlfeed.php HTTP/1.1\" 2 00 64 \"-\" \"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Triden"...
len = <value optimized out>
i = <value optimized out>
l = <value optimized out>
lcf = 0x96c4884
fmt = <value optimized out>
at src/http/ngx_http_request.c:3276
i = 1
n = 2
cmcf = <value optimized out>
at src/http/ngx_http_request.c:3229
---Type
at src/http/ngx_http_request.c:2658
tcp_nodelay = <value optimized out>
rev = 0x9795b64
b = <value optimized out>
i = 25
f = <value optimized out>
wev = 0x96f3858
c = 0x974bc6c
hc = 0x9737a30
at src/http/ngx_http_request.c:2348
clcf = 0x96c4734
at src/http/ngx_http_request.c:2256
c = 0x974bc6c
pr = 0x804f13c
u=0x96aa4ac, rc=0) at src/http/ngx_http_upstream.c:3116
---Type
do_write=<value optimized out>) at src/http/ngx_http_upstream.c:2457
size = <value optimized out>
n = <value optimized out>
rc = <value optimized out>
downstream = 0x974bc6c
upstream = 0x974b564
u = 0x96aa4ac
clcf = 0x96aa620
r=0x96a9d08) at src/http/ngx_http_upstream.c:2388
wev = <value optimized out>
c = <value optimized out>
u = 0x96aa4ac
at src/http/ngx_http_upstream.c:2161
c = <value optimized out>
clcf = 0x96c4734
tcp_nodelay = 134795845
n = <value optimized out>
rc = <value optimized out>
p = <value optimized out>
---Type
at src/http/ngx_http_upstream.c:1657
n = <value optimized out>
rc = <value optimized out>
c = <value optimized out>
at src/http/ngx_http_upstream.c:950
c = 0x974bc6c
r = 0xef9fa94f
u = 0x6
flags=1) at src/event/modules/ngx_epoll_module.c:683
events = 1
revents = 5
instance = 0
i = 0
level = <value optimized out>
err = <value optimized out>
rev = 0x6
wev = <value optimized out>
queue = <value optimized out>
c = <value optimized out>
---Type
at src/os/unix/ngx_process_cycle.c:807
i = 0
c = 0x1
proc=0x8068e5f <ngx_worker_process_cycle>, data=0x1,
name=0x80c534a "worker process", respawn=1)
at src/os/unix/ngx_process.c:198
on = 1
pid = 0
s = 1
at src/os/unix/ngx_process_cycle.c:619
i = 1
n = 3
ch = {command = 2, pid = 7579, slot = 1, fd = -1}
ccf = 0x3
at src/os/unix/ngx_process_cycle.c:180
---Type
i = <value optimized out>
log = 0x80d98f4
cycle = 0x9640678
init_cycle = {conf_ctx = 0x0, pool = 0x96400b0, log = 0x80d98f4,
new_log = {log_level = 0, file = 0x0, connection = 0, handler = 0,
data = 0x0, action = 0x0}, files = 0x0, free_connections = 0x0,
free_connection_n = 0, reusable_connections_queue = {prev = 0x0,
next = 0x0}, listening = {elts = 0x0, nelts = 0, size = 0,
nalloc = 0, pool = 0x0}, paths = {elts = 0x0, nelts = 0, size = 0,
nalloc = 0, pool = 0x0}, open_files = {last = 0x0, part = {
---Type
I think it may be reload related. Since my config gets auto reloaded every 10 minutes if there is a change and its on that its crashing at the moment.
Try latest commit, please.
I havent seen a crash with it yet, tomorrow ill be AFK but Ill let you know if it does.
Its crashing when a syslog message is being sent while being cycled (reloaded).
(gdb) backtrace full
source=<value optimized out>, level=6, buf=<value optimized out>, len=336)
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:553
conf = 0x40
ctx = 0x9321bf0
i = 21
at /var/x4b/nginx-syslog-module/ngx_http_syslog_module.c:401
line = 0x90c81b9 "{adv.dnstracks.com:46.17.97.53} adv.dnstracks.com 149.172.180.246 - - [31/Jan/2013:15:17:00 +0400] \"POST /web/xmlfeeds.php HTTP/1.1\" 200 64 \"-\" \"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW6"...
len = <value optimized out>
i = <value optimized out>
l = <value optimized out>
lcf = 0x90f2cdc
fmt = <value optimized out>
ctx = <value optimized out>
at src/http/ngx_http_request.c:3276
i = 1
n = 2
cmcf = <value optimized out>
---Type
at src/http/ngx_http_request.c:2658
tcp_nodelay = <value optimized out>
rev = 0x924a7b0
b = <value optimized out>
i = 25
f = <value optimized out>
wev = 0x90f04ac
c = 0x9201308
hc = 0x90f23e0
at src/http/ngx_http_request.c:2348
clcf = 0x90f2b8c
at src/http/ngx_http_request.c:2256
c = 0x9201308
pr = 0x804f13c
---Type
do_write=<value optimized out>) at src/http/ngx_http_upstream.c:2457
size = <value optimized out>
n = <value optimized out>
rc = <value optimized out>
downstream = 0x9201308
upstream = 0x9202adc
u = 0x90efccc
clcf = 0x90efe40
r=0x90ef528) at src/http/ngx_http_upstream.c:2388
wev = <value optimized out>
c = <value optimized out>
u = 0x90efccc
at src/http/ngx_http_upstream.c:2161
c = <value optimized out>
clcf = 0x90f2b8c
tcp_nodelay = 0
n = <value optimized out>
rc = <value optimized out>
---Type
at src/http/ngx_http_upstream.c:1657
n = <value optimized out>
rc = <value optimized out>
c = <value optimized out>
at src/http/ngx_http_upstream.c:950
c = 0x9201308
r = 0x35463838
u = 0x6
at src/event/ngx_event_posted.c:40
ev = 0x35463838
at src/event/ngx_event.c:276
flags = 3
timer = <value optimized out>
delta = 2421355341
at src/os/unix/ngx_process_cycle.c:807
i = 0
c = 0x2
---Type
proc=0x8068e5f <ngx_worker_process_cycle>, data=0x1,
name=0x80c544a "worker process", respawn=-4)
at src/os/unix/ngx_process.c:198
on = 1
pid = 0
s = 2
at src/os/unix/ngx_process_cycle.c:362
i = 1
ch = {command = 1, pid = 24533, slot = 1, fd = 59}
at src/os/unix/ngx_process_cycle.c:249
title = 0x80dbde0 "\327_"
p = <value optimized out>
size = 6
i = 6
n = <value optimized out>
sigio = 0
set = {__val = {0 <repeats 32 times>}}
itv = {it_interval = {tv_sec = 0, tv_usec = 1}, it_value = {
tv_sec = -1208792149, tv_usec = 54}}
live = 1
---Type
i = <value optimized out>
log = 0x80d99f4
cycle = 0x90a8688
init_cycle = {conf_ctx = 0x0, pool = 0x90a80b0, log = 0x80d99f4,
new_log = {log_level = 0, file = 0x0, connection = 0, handler = 0,
data = 0x0, action = 0x0}, files = 0x0, free_connections = 0x0,
free_connection_n = 0, reusable_connections_queue = {prev = 0x0,
next = 0x0}, listening = {elts = 0x0, nelts = 0, size = 0,
nalloc = 0, pool = 0x0}, paths = {elts = 0x0, nelts = 0, size = 0,
nalloc = 0, pool = 0x0}, open_files = {last = 0x0, part = {
elts = 0x0, nelts = 0, next = 0x0}, size = 0, nalloc = 0,
pool = 0x0}, shared_memory = {last = 0x0, part = {elts = 0x0,
nelts = 0, next = 0x0}, size = 0, nalloc = 0, pool = 0x0},
connection_n = 0, files_n = 0, connections = 0x0, read_events = 0x0,
write_events = 0x0, old_cycle = 0x0, conf_file = {len = 21,
data = 0x80c1fa1 "/etc/nginx/nginx.conf"}, conf_param = {len = 0,
data = 0x0}, conf_prefix = {len = 11,
data = 0x80c1fa1 "/etc/nginx/nginx.conf"}, prefix = {len = 5,
data = 0x80c1f9b "/usr/"}, lock_file = {len = 0, data = 0x0},
hostname = {len = 0, data = 0x0}}
---Type
Hmmm. Can you reproduce it on testing environment. I've tried, but I can't reproduce it using siege
and nc
. Attaching with gdb to a single worker and then reload. It is not crashing...
Ill try to create a minimum working config on saturday for replication. It definately has something to do with a syslog being sent while the process is being reloaded.
Ok replication instructions.
CONFIG:
syslog_target x4b {
10.0.0.1;
}
log_format combined_syslog '{$host:$server_addr} $host $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer"';
syslog_map access x4b combined_syslog;
server {
#just to make timeout quicker
proxy_read_timeout 10s;
proxy_connect_timeout 10s;
listen 88;
location / {
proxy_set_header Host ibootleg.org;
proxy_pass http://46.17.96.109;
}
}
Steps:
It is definately annoying to replicate and syslogs attempted to being sent during a reload.
I'm still out of luck. Running it for hours and can't get even one crash at reload.
I'm running out of ideas...
What ./configuration
options did you use to build nginx
?
--prefix=/usr --conf-path=/etc/nginx/nginx.conf --sbin-path=/usr/sbin --with-http_sub_module --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --http-client-body-temp-path=/var/lib/nginx/body --http-proxy-temp-path=/var/lib/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --without-http_uwsgi_module --without-http_scgi_module --without-http_memcached_module --with-http_xslt_module --add-module=/var/x4b/nginx-syslog-module
Its a pain to reproduce even for me (it happens on my production server about once every three hours). lll try and find some better reproduction steps that always work.
Additionally i get socket leakage on reload, that much is always reproducible and may be relevant?
By the way I by leaked sockets I am refering to messages like
2013/02/04 18:59:19 [alert] 3404#0: open socket #13 left in connection 5
2013/02/04 18:59:19 [alert] 3404#0: aborting
This problem seems to get worse over time as I had a server this morning dropping every incomming connection.
I'm trying to fix this issue (leaked udp sockets) right now, but I don't see how it possible could be linked with segfault. Moreover, I don't see how reloading could be linked with this issue, because of while reloading process data is not modified by some way, it's just a HUP signal that arrive to a process.
hmm well it only seems to occur when events are processed from within the ngx_worker_process_cycle context. Im trying to find a more reliable replication instruction but atm are unable to find something that causes the issue consistantly.
I can provide full GDB cores if it will help (to get locals and stuff).
Backtrace:
Occurs when error_page is used, tested on a 504 error with config similar to:
nginx version: nginx/1.3.11