STINNER Victor added the comment:

> The deadlock is between a CRT thread initialization lock and Windows's 
> process-wide module initialization lock. So if anything is being loaded on 
> demand by the watchdog thread, it's probably locked too (and that could be 
> within the CRT or the OS, so not easy to identify).

Basically, on timeout, the faulthandler thread uses the write() syscall and 
reads memory in the Python process. It's designed to be super safe. The code 
only uses async-signal safe functions, since the same code is used in signal 
handlers.

https://hg.python.org/cpython/file/688c6b16228e/Modules/faulthandler.c#l540

But the watchdog is trigerred by PyThread_acquire_lock_timed() which indirectly 
calls WaitForSingleObjectEx() on Windows. In expect that the wait times out 
before the lock is released on this buildbot.

Maybe Windows provides a safer function to implement a watchdog? Basically, the 
required function is a wait that can be interrupted.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26624>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to