openresty / echo-nginx-module

An Nginx module for bringing the power of "echo", "sleep", "time" and more to Nginx's config file
http://wiki.nginx.org/NginxHttpEchoModule
BSD 2-Clause "Simplified" License
1.17k stars 254 forks source link

Using `$echo_timer_elapsed` under locations without any echo directives causes coredump #23

Closed duhoobo closed 10 years ago

duhoobo commented 10 years ago

sample config:

    location /echo {
        if ($echo_timer_elapsed) {}
    }

core file:

    Core was generated by `sbin/nginx'.
    Program terminated with signal 11, Segmentation fault.
    #0  0x00000000004fc1d2 in ngx_http_echo_timer_elapsed_variable (r=0x2739770, v=0x273a1b0, data=0)
        at ../echo-nginx-module-0.49/src/ngx_http_echo_timer.c:25
    25      if (ctx->timer_begin.sec == 0) {
    (gdb) p ctx
    $1 = (ngx_http_echo_ctx_t *) 0x0
agentzh commented 10 years ago

Thanks for the report! Already committed a fix in git master. Could you try it out again?

duhoobo commented 10 years ago

That's swift! My problem seems already fixed. Closing this one.