Exception with ngx_event_timer_init() in win32

bigplum nginx-forum at nginx.us
Wed Jul 13 12:19:52 MSD 2011


In win32 native api file: ngx_process_cycle.c init_process will call
ngx_event_timer_init(), but the function ngx_mutex_init() does not
implement for  win32 now, so ngx_event_timer_mutex will be set to 1.

And this function ngx_event_timer_init() will be called again in
ngx_worker_thread(). The statement will access a invalid memory:

        ngx_event_timer_mutex->log = log;
Setting deamon and master_process to off in nginx.conf, this exception
will be reproduced.

So why ngx_modules[n]->init_process called twice in
ngx_single_process_cycle(), but ngx_worker_process_cycle called once

    for (n = 0; ngx_modules[n]; n++) {
        if (ngx_modules[n]->init_process) {
            if (ngx_modules[n]->init_process(cycle) == NGX_ERROR) {
                /* fatal */

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,212322,212322#msg-212322

More information about the nginx mailing list