delay_delete_ev will crash nginx
datastream opened this issue · 0 comments
datastream commented
I notices in ngx_http_upsync_event_init, detele event will delay NGX_DELAY_DELETE msec.
nginx-upsync-module/src/ngx_http_upsync_module.c
Line 3261 in e67784c
In addtion, add some tcp connection check logic, but not every tcp connection was checked.
nginx-upsync-module/src/ngx_http_upsync_module.c
Line 3288 in e67784c
nginx-upsync-module/src/ngx_http_upsync_module.c
Line 3319 in e67784c
this while loop will be cause nginx crash.
#0 ngx_event_connect_peer (pc=pc@entry=0x561fcc2ff3b8) at src/event/ngx_event_connect.c:41
warning: Source file is more recent than executable.
41 s = ngx_socket(pc->sockaddr->sa_family, type, 0);
(gdb) bt
#0 ngx_event_connect_peer (pc=pc@entry=0x561fcc2ff3b8) at src/event/ngx_event_connect.c:41
#1 0x0000561fc4ab07fb in ngx_http_upstream_connect (r=0x561fcb9f8860, u=0x561fcc2ff3a8) at src/http/ngx_http_upstream.c:1520
#2 0x0000561fc4ab13ec in ngx_http_upstream_init_request (r=0x561fcb9f8860) at src/http/ngx_http_upstream.c:801
#3 0x0000561fc4aa46a0 in ngx_http_read_client_request_body (r=r@entry=0x561fcb9f8860, post_handler=0x561fc4ab2960 <ngx_http_upstream_init>)
at src/http/ngx_http_request_body.c:147
#4 0x0000561fc4aea791 in ngx_http_proxy_handler (r=0x561fcb9f8860) at src/http/modules/ngx_http_proxy_module.c:930
#5 0x0000561fc4a95c32 in ngx_http_core_content_phase (r=0x561fcb9f8860, ph=<optimized out>) at src/http/ngx_http_core_module.c:1169
#6 0x0000561fc4a901cd in ngx_http_core_run_phases (r=0x561fcb9f8860) at src/http/ngx_http_core_module.c:858
#7 0x0000561fc4a996d6 in ngx_http_run_posted_requests (c=0x7ff1beff79f8) at src/http/ngx_http_request.c:2285
#8 0x0000561fc4a82b5c in ngx_epoll_process_events (cycle=0x561fc9dc0760, timer=<optimized out>, flags=<optimized out>) at src/event/modules/ngx_epoll_module.c:902
#9 0x0000561fc4a77b3a in ngx_process_events_and_timers (cycle=cycle@entry=0x561fc9dc0760) at src/event/ngx_event.c:242
#10 0x0000561fc4a80955 in ngx_worker_process_cycle (cycle=cycle@entry=0x561fc9dc0760, data=data@entry=0x0) at src/os/unix/ngx_process_cycle.c:750
#11 0x0000561fc4a7ed6f in ngx_spawn_process (cycle=cycle@entry=0x561fc9dc0760, proc=proc@entry=0x561fc4a80900 <ngx_worker_process_cycle>, data=data@entry=0x0,
name=name@entry=0x561fc4b6b163 "worker process", respawn=respawn@entry=-4) at src/os/unix/ngx_process.c:199
#12 0x0000561fc4a80000 in ngx_start_worker_processes (cycle=cycle@entry=0x561fc9dc0760, n=4, type=type@entry=-4) at src/os/unix/ngx_process_cycle.c:359
#13 0x0000561fc4a81952 in ngx_master_process_cycle (cycle=0x561fc9dc0760) at src/os/unix/ngx_process_cycle.c:244
#14 0x0000561fc4a55918 in main (argc=<optimized out>, argv=<optimized out>) at src/core/nginx.c:382