wandenberg / nginx-push-stream-module

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

Can't use include in the configuration file #82

Closed kghost closed 10 years ago

kghost commented 11 years ago

if include is used in configure file, function ngx_http_push_stream_create_main_conf will be called multiple times, and the variable ngx_http_push_stream_module_main_conf will be set to a wrong value, become a dangling pointer.

Breakpoint 6, ngx_http_push_stream_create_main_conf (cf=0x7fffffffe820)
    at /root/nginx-1.3.15/debian/modules/nginx-push-stream-module-0.3.5/src/ngx_http_push_stream_module_setup.c:411
411     in /root/nginx-1.3.15/debian/modules/nginx-push-stream-module-0.3.5/src/ngx_http_push_stream_module_setup.c
(gdb) bt
#0  ngx_http_push_stream_create_main_conf (cf=0x7fffffffe820)
    at /root/nginx-1.3.15/debian/modules/nginx-push-stream-module-0.3.5/src/ngx_http_push_stream_module_setup.c:411
#1  0x0000000000445d6c in ngx_http_block (cf=0x7fffffffe820, cmd=<optimized out>, conf=<optimized out>)
    at src/http/ngx_http.c:197
#2  0x000000000042d402 in ngx_conf_handler (last=1, cf=0x7fffffffe820) at src/core/ngx_conf_file.c:387
#3  ngx_conf_parse (cf=cf@entry=0x7fffffffe820, filename=filename@entry=0xbb06f0) at src/core/ngx_conf_file.c:243
#4  0x000000000042ace0 in ngx_init_cycle (old_cycle=old_cycle@entry=0x7fffffffe9e0) at src/core/ngx_cycle.c:268
#5  0x000000000041c7c9 in main (argc=<optimized out>, argv=<optimized out>) at src/core/nginx.c:333
(gdb) cont
Continuing.

Breakpoint 6, ngx_http_push_stream_create_main_conf (cf=0x7fffffffe820)
    at /root/nginx-1.3.15/debian/modules/nginx-push-stream-module-0.3.5/src/ngx_http_push_stream_module_setup.c:411
411     in /root/nginx-1.3.15/debian/modules/nginx-push-stream-module-0.3.5/src/ngx_http_push_stream_module_setup.c
(gdb) bt
#0  ngx_http_push_stream_create_main_conf (cf=0x7fffffffe820)
    at /root/nginx-1.3.15/debian/modules/nginx-push-stream-module-0.3.5/src/ngx_http_push_stream_module_setup.c:411
#1  0x0000000000445d6c in ngx_http_block (cf=0x7fffffffe820, cmd=<optimized out>, conf=<optimized out>)
    at src/http/ngx_http.c:197
#2  0x000000000042d402 in ngx_conf_handler (last=1, cf=0x7fffffffe820) at src/core/ngx_conf_file.c:387
#3  ngx_conf_parse (cf=cf@entry=0x7fffffffe820, filename=filename@entry=0x7fffffffe530)
    at src/core/ngx_conf_file.c:243
#4  0x000000000042d7d3 in ngx_conf_include (cf=0x7fffffffe820, cmd=<optimized out>, conf=<optimized out>)
    at src/core/ngx_conf_file.c:754
#5  0x000000000042d402 in ngx_conf_handler (last=0, cf=0x7fffffffe820) at src/core/ngx_conf_file.c:387
#6  ngx_conf_parse (cf=cf@entry=0x7fffffffe820, filename=filename@entry=0xbb06f0) at src/core/ngx_conf_file.c:243
#7  0x000000000042ace0 in ngx_init_cycle (old_cycle=old_cycle@entry=0x7fffffffe9e0) at src/core/ngx_cycle.c:268
#8  0x000000000041c7c9 in main (argc=<optimized out>, argv=<optimized out>) at src/core/nginx.c:333
wandenberg commented 11 years ago

Hi,

I tried to reproduce the problem, but my ngx_http_push_stream_create_main_conf was called once. Can you send me a small configuration, and a step by step how to reproduce the problem.

Regards

wandenberg commented 11 years ago

Hi @kghost can you help me debug this problem? If it really exist.

wandenberg commented 10 years ago

This was solved on tag 0.4.0 3d3a204177d3a7ab8a2858e04e792a6d11bf133f