http://bugs.winehq.org/show_bug.cgi?id=13227
--- Comment #1 from Akhilesh mritun@gmail.com 2008-05-14 17:02:44 --- I have done some more investigation.
The tracing (on a live case, using dtrace) leads me to the following case:
1. in main_loop (server/fd.c), the poll gets woken up immediately without waiting. DTrace output tells that timeout is being properly set (and decremented every second), but poll wakes up immediately. On being woken up it looks for the fd on which the event happened, and fires fd_poll_event().
2. fd_poll_event ultimately leads to rserver/equest.c::receive_fd - Here the it tries to recvmsg() from socket (confirmed by dtrace - see attached backtrace) but receives 0 sized message (return value confirmed). So then it tries to kill the process by issuing a call to kill_process(process, 0).
3. server/process.c::kill_process - Does the following-
grab_object(..) while((ptr == list_head(&process->thread_list))) { ... kill_thread(...) } release_object(..)
grab_object and release_object are being called (confirmed by dtrace backtrace), but kill_thread() is NEVER getting called.
So I suspect that somehow the call to list_head is failing. I'm not able to trace the call to list_head() as it's being inlined in this build. But this the only way the loop would not get executed.
I am investigating why list_head() is returning a NULL value.