Welcome! Log In Create A New Profile

Advanced

Re: Exception with ngx_event_timer_init() in win32

Maxim Dounin
July 13, 2011 09:14AM
Hello!

On Wed, Jul 13, 2011 at 04:19:52AM -0400, bigplum wrote:

> Hi,
>
> 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
> only?
>
> for (n = 0; ngx_modules[n]; n++) {
> if (ngx_modules[n]->init_process) {
> if (ngx_modules[n]->init_process(cycle) == NGX_ERROR) {
> /* fatal */
> exit(2);
> }
> }
> }

Single process mode isn't something that is expected to work
flawlesly. Under unix it mostly works (except some problems with
configuration reloading) and may be used for debugging. Under
windows it'll try to use threads and won't work at all as a
result.

Fixing this particular problem won't help as there are plenty
other thread-related problems. Please also note it's listed in
"possible future enchancements" list[1], and this future isn't
here right now. :)

[1] http://nginx.org/en/docs/windows.html#possible_future_enhancements

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Exception with ngx_event_timer_init() in win32

bigplum July 13, 2011 04:19AM

Re: Exception with ngx_event_timer_init() in win32

Maxim Dounin July 13, 2011 09:14AM

Re: Exception with ngx_event_timer_init() in win32

bigplum July 13, 2011 10:57PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 89
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready