slact / nchan

Fast, horizontally scalable, multiprocess pub/sub queuing server and proxy for HTTP, long-polling, Websockets and EventSource (SSE), powered by Nginx.
https://nchan.io/
Other
2.99k stars 292 forks source link

sending HUP to nginx master process crashes nginx #645

Closed limetech closed 1 year ago

limetech commented 1 year ago

nginx v1.21.6 with nchan 1.2.15 => HUP works ok

nginx v1.21.6 with nchan 1.3.1 => HUP causes nginx segfault nginx v1.23.1 with nchan 1.3.1 => HUP causes nginx segfault:

Aug 17 12:08:22 Test-1 kernel: nginx[9864]: segfault at 69 ip 00000000004f2504 sp 00007ffd667cebc8 error 6 in nginx[423000+10a000] Aug 17 12:08:22 Test-1 kernel: Code: 00 00 0f 1f 40 00 48 c7 c0 50 17 5d 00 66 0f ef c0 48 8b 10 48 8d 04 d5 00 00 00 00 48 29 d0 48 8b 15 28 21 0e 00 48 8d 04 c2 <48> c7 40 30 00 00 00 00 0f 11 00 0f 11 40 10 0f 11 40 20 31 c0 c3

nginx v1.23.1 with nchan 1.2.15 => compile error so can't test:

cc -c -O2 -fPIC -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules -I src/http/v2 -I ./nchan-1.2.15/src -I src/stream \ -o objs/addon/util/hdr_histogram.o \ ./nchan-1.2.15/src/util/hdr_histogram.c In file included from src/event/ngx_event.h:526, from src/http/ngx_http_upstream.h:14, from src/http/ngx_http.h:34, from ./nchan-1.2.15/src/nchan_module.h:17, from ./nchan-1.2.15/src/util/hdr_histogram.c:17: src/event/ngx_event_udp.h:38:27: error: field ‘pkt6’ has incomplete type 38 | struct in6_pktinfo pkt6; | ^~~~ make[1]: *** [objs/Makefile:1974: objs/addon/util/hdr_histogram.o] Error 1

limetech commented 1 year ago

An update. The combination: nginx v.1.22.0 with nchan v1.3.0 works

either updating nginx to 1.23.1 and/or nchan to v1.3.1 causes nginx to crash when sent HUP

limetech commented 1 year ago

Update: ngnix v1.22.1 with nchan v1.3.0 works ok nginx v1.22.1 with nchan v1.3.1 <= FAILS nginx v1.22.1 with nchan any version from 1.3.1 to recent release 1.3.5 <= FAILS

A change that went into nchan starting with v1.3.1 broke the nginx "reload' method.

slact commented 1 year ago

fixed with pr #659