https://bugs.winehq.org/show_bug.cgi?id=54807
--- Comment #9 from Zeb Figura z.figura12@gmail.com --- Oh, actually, this is probably it?
0178: terminate_thread( handle=01cc, exit_code=0 ) 01b0: *killed* exit_code=0 01b0: *sent signal* signal=3 0178: terminate_thread() = 0 { self=0 } 0170: get_thread_info( handle=fffffffe, access=00000000 ) 0170: get_thread_info() = 0 { pid=00e8, tid=0170, teb=7ff70000, entry_point=6fffffcc1cd0, affinity=0000000f, exit_code=259, priority=0, last=0, suspend_count=0, dbg_hidden=0, desc_len=44, desc=L"" } 0170: terminate_thread( handle=fffffffe, exit_code=0 ) 0170: terminate_thread() = 0 { self=1 } 0170: select( flags=2, cookie=7fffff5fda7c, timeout=0, size=0, prev_apc=0000, result={}, data={}, contexts={} ) 0170: select() = TIMEOUT { apc_handle=0000, signaled=1, call={}, contexts={} } 0170: *killed* exit_code=0 01ac: *killed* exit_code=0 019c: *killed* exit_code=0 0198: *killed* exit_code=0 0178: *killed* exit_code=0 0188: *wakeup* signaled=0 0180: *wakeup* signaled=0 0058: *wakeup* signaled=1
0170 (which isn't part of the same process actually) terminates itself cleanly, but then 01ac and the following 3 threads seem to have been killed externally. It threw me off originally because I assumed those are all from the same process.
That does point to the TerminateThread() being the problem. I guess 01b0 is in the middle of an NtClose() when it dies? It'd certainly be left holding the fd cache mutex in that case.
In that case unwinding won't be enough, I think. I think the only way is to mask off SIGQUIT.