wandenberg / nginx-push-stream-module

A pure stream http push technology for your Nginx setup. Comet made easy and really scalable.
Other
2.21k stars 295 forks source link

segfault at `ngx_shmtx_lock(subscription->channel->mutex)` #280

Closed vadv closed 4 years ago

vadv commented 5 years ago

nginx v1.14.0 + nginx-push-stream-module v0.5.4:

#0  ngx_shmtx_lock (mtx=0x6d726f663d656d61) at src/core/ngx_shmtx.c:78
#1  0x00007fcbc9541529 in ngx_http_push_stream_worker_subscriber_cleanup (r=<value optimized out>)
    at modules/nginx_push_stream_module/src/ngx_http_push_stream_module_utils.c:1554
#2  ngx_http_push_stream_cleanup_request_context (r=<value optimized out>)
    at modules/nginx_push_stream_module/src/ngx_http_push_stream_module_utils.c:1528
#3  0x00007fcbc953ee29 in ngx_http_push_stream_run_cleanup_pool_handler (r=0x8cc7050)
    at modules/nginx_push_stream_module/src/ngx_http_push_stream_module_utils.c:863
#4  ngx_http_push_stream_send_response_finalize_for_longpolling_by_timeout (r=0x8cc7050)
    at modules/nginx_push_stream_module/src/ngx_http_push_stream_module_utils.c:900
#5  0x0000000000432c72 in ngx_event_expire_timers () at src/event/ngx_event_timer.c:94
#6  0x0000000000432501 in ngx_process_events_and_timers (cycle=0x269c000) at src/event/ngx_event.c:256
#7  0x0000000000439d48 in ngx_worker_process_cycle (cycle=0x269c000, data=<value optimized out>)
    at src/os/unix/ngx_process_cycle.c:750
#8  0x000000000043813a in ngx_spawn_process (cycle=0x269c000, proc=0x439d10 <ngx_worker_process_cycle>, data=0x17,
    name=0x4d39f6 "worker process", respawn=-4) at src/os/unix/ngx_process.c:199
#9  0x000000000043953c in ngx_start_worker_processes (cycle=0x269c000, n=24, type=-4) at src/os/unix/ngx_process_cycle.c:359
#10 0x000000000043a5bc in ngx_master_process_cycle (cycle=0x269c000) at src/os/unix/ngx_process_cycle.c:244
#11 0x00000000004144bc in main (argc=<value optimized out>, argv=<value optimized out>) at src/core/nginx.c:382

I hope this helps you find the error !

vadv commented 5 years ago

nginx config:

load_module /opt/restream/nginx/lib/modules/ngx_http_vhost_traffic_status_module.so;
load_module /opt/restream/nginx/lib/modules/ngx_http_push_stream_module.so;
load_module /opt/restream/nginx/lib/modules/ngx_http_image_filter_module.so;

push_stream_shared_memory_size                  512M;

    location /publish {
        push_stream_publisher       admin;
        push_stream_channels_path $arg_channel;
        push_stream_store_messages  off;
        default_type    text/plain;
        keepalive_timeout 0;
    }

    location ~ ^/subscribe {
        push_stream_subscriber              long-polling;
        push_stream_channels_path           $arg_channel;
        push_stream_longpolling_connection_ttl      1200s;
    }
vadv commented 5 years ago

push_stream_channels_statistics:

{"hostname": "<>", "time": "2018-09-23T09:27:28", "channels": "300927", "broadcast_channels": "0", "published_messages": "18681351", "stored_messages": "0", "messages_in_trash": "2605", "channels_in_trash": "1190", "subscribers": "494657", "uptime": "302579", "by_worker": [
{"pid": "21447", "subscribers": "20440", "uptime": "302579"},
{"pid": "21448", "subscribers": "20824", "uptime": "302579"},
{"pid": "21449", "subscribers": "20375", "uptime": "302579"},
{"pid": "21450", "subscribers": "20620", "uptime": "302579"},
{"pid": "21452", "subscribers": "20775", "uptime": "302579"},
{"pid": "21453", "subscribers": "21150", "uptime": "302579"},
{"pid": "21454", "subscribers": "20619", "uptime": "302579"},
{"pid": "21455", "subscribers": "20568", "uptime": "302579"},
{"pid": "21456", "subscribers": "20409", "uptime": "302579"},
{"pid": "21457", "subscribers": "20820", "uptime": "302579"},
{"pid": "21458", "subscribers": "20359", "uptime": "302579"},
{"pid": "21459", "subscribers": "20555", "uptime": "302579"},
{"pid": "21460", "subscribers": "20585", "uptime": "302579"},
{"pid": "21461", "subscribers": "20453", "uptime": "302579"},
{"pid": "21462", "subscribers": "20679", "uptime": "302579"},
{"pid": "21463", "subscribers": "20546", "uptime": "302579"},
{"pid": "21464", "subscribers": "20484", "uptime": "302579"},
{"pid": "21465", "subscribers": "20478", "uptime": "302579"},
{"pid": "21466", "subscribers": "20599", "uptime": "302579"},
{"pid": "21467", "subscribers": "20567", "uptime": "302579"},
{"pid": "21468", "subscribers": "20792", "uptime": "302579"},
{"pid": "21469", "subscribers": "20537", "uptime": "302579"},
{"pid": "21470", "subscribers": "20671", "uptime": "302579"},
{"pid": "21471", "subscribers": "20752", "uptime": "302579"}
]}
wandenberg commented 4 years ago

Fixed with 1cdc01521ed