Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nchan_longpoll_multipart_response will crash the worker #478

Closed
mapledan opened this issue Aug 6, 2018 · 2 comments
Closed

nchan_longpoll_multipart_response will crash the worker #478

mapledan opened this issue Aug 6, 2018 · 2 comments

Comments

@mapledan
Copy link

mapledan commented Aug 6, 2018

The worker crashed when subscribe is a longpoll response that using "nchan_longpoll_multipart_response raw".
Here is nginx error log:

2018/08/06 12:25:01 [alert] 13463#0: *89 zero size buf in output t:1 r:0 f:1 0000000000002020 0000000000000000-0000000000000000 2E3141473D61675F 0-0, server: localhost
2018/08/06 12:25:01 [alert] 13457#0: worker process 13462 exited on signal 11 (core dumped)
2018/08/06 12:25:02 [alert] 13457#0: worker process 13463 exited on signal 11 (core dumped)

The coredump backtrace:

Core was generated by `nginx: worker process                                                         '.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000100000000 in ?? ()
(gdb) bt
#0  0x0000000100000000 in ?? ()
#1  0x000000000042564f in ngx_log_error_core (level=3, log=0x18fab8c, err=9, fmt=0x5dc4e6 "pread() \"%s\" failed") at src/core/ngx_log.c:149
#2  0x00000000004619d0 in ngx_read_file (file=0x190d030, buf=0x18fc2a0 "\330\022\036\252\260\177", size=18446744073683719248, offset=25832368) at src/os/unix/ngx_files.c:43
#3  0x000000000042b66c in ngx_output_chain_copy_buf (ctx=0x1910d18) at src/core/ngx_output_chain.c:595
#4  0x000000000042ac15 in ngx_output_chain (ctx=0x1910d18, in=0x190dcd0) at src/core/ngx_output_chain.c:173
#5  0x00000000004d3266 in ngx_http_copy_filter (r=0x18f9ed0, in=0x190dcd0) at src/http/ngx_http_copy_filter_module.c:152
#6  0x00000000004c340e in ngx_http_range_body_filter (r=0x18f9ed0, in=0x190dcd0) at src/http/modules/ngx_http_range_filter_module.c:628
#7  0x000000000048003f in ngx_http_output_filter (r=0x18f9ed0, in=0x190dcd0) at src/http/ngx_http_core_module.c:1986
#8  0x0000000000520793 in nchan_output_filter_generic (r=0x18f9ed0, msg=0x0, in=0x190dcd0) at /opt/nchan-1.2.1/src/util/nchan_output.c:261
#9  0x00000000005208c2 in nchan_output_filter (r=0x18f9ed0, in=0x190dcd0) at /opt/nchan-1.2.1/src/util/nchan_output.c:296
#10 0x0000000000530891 in longpoll_multipart_respond (fsub=0x18a2080) at /opt/nchan-1.2.1/src/subscribers/longpoll.c:415
#11 0x000000000053098f in longpoll_respond_status (self=0x18a2080, status_code=204, status_line=0x0, status_body=0x0) at /opt/nchan-1.2.1/src/subscribers/longpoll.c:435
#12 0x000000000053ea26 in spool_respond_general (self=0x189fd68, msg=0x0, code=204, code_data=0x0, notice=0) at /opt/nchan-1.2.1/src/store/spool.c:619
#13 0x000000000053da3a in spool_nextmsg (spool=0x174d6b8, new_last_id=0x7fb0a12c9200) at /opt/nchan-1.2.1/src/store/spool.c:279
#14 0x000000000053dcf0 in spool_fetch_msg_callback (code=5, msg=0x7fb0a12c9200, data=0x1905e30) at /opt/nchan-1.2.1/src/store/spool.c:334
#15 0x0000000000550cc2 in nchan_memstore_handle_get_message_reply (msg=0x7fb0a12c9200, findmsg_status=MSG_FOUND, data=0x18a25e0) at /opt/nchan-1.2.1/src/store/memory/memstore.c:2766
#16 0x0000000000544480 in receive_get_message_reply (sender=4, d=0x7ffcd31fe320) at /opt/nchan-1.2.1/src/store/memory/ipc-handlers.c:609
#17 0x0000000000545fca in memstore_ipc_alert_handler (sender=4, code=10, data=0x7ffcd31fe320) at /opt/nchan-1.2.1/src/store/memory/ipc-handlers.c:1062
#18 0x0000000000541dcd in ipc_read_handler (ev=0x1858f90) at /opt/nchan-1.2.1/src/store/memory/ipc.c:457
#19 0x000000000045c295 in ngx_event_process_posted (cycle=0x1745150, posted=0xb3cb00 <ngx_posted_events>) at src/event/ngx_event_posted.c:33
#20 0x00000000004599a8 in ngx_process_events_and_timers (cycle=0x1745150) at src/event/ngx_event.c:259
#21 0x0000000000468e6e in ngx_worker_process_cycle (cycle=0x1745150, data=0x3) at src/os/unix/ngx_process_cycle.c:749
#22 0x0000000000465539 in ngx_spawn_process (cycle=0x1745150, proc=0x468d87 <ngx_worker_process_cycle>, data=0x3, name=0x5dd35b "worker process", respawn=-3) at src/os/unix/ngx_process.c:198
#23 0x0000000000467c22 in ngx_start_worker_processes (cycle=0x1745150, n=12, type=-3) at src/os/unix/ngx_process_cycle.c:358
#24 0x00000000004671c8 in ngx_master_process_cycle (cycle=0x1745150) at src/os/unix/ngx_process_cycle.c:130
#25 0x0000000000422c91 in main (argc=3, argv=0x7ffcd31fe9d8) at src/core/nginx.c:375

#427

@slact
Copy link
Owner

slact commented Aug 6, 2018

Nchan version? Nginx config?

@mapledan
Copy link
Author

mapledan commented Aug 6, 2018

Nchan: 1.2.1
Nginx: 1.12.2

nginx config:

        location ~ /sub/(\w+)/msg$ {
            nchan_channel_id $1;
            nchan_subscriber;
            nchan_authorize_request /nchan-auth;
            nchan_redis_pass redis_cluster;
            nchan_longpoll_multipart_response raw;
            nchan_subscriber_compound_etag_message_id on;
        }

        location = /nchan-auth {
            internal;
            proxy_pass http://127.0.0.1/;
            proxy_pass_request_body off;
            proxy_set_header Content-Length "";
            proxy_set_header Host 'nchan-auth';
            proxy_set_header X-Original-URI $request_uri;
        }

I have emailed you the core dump file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants