[New-bugs-announce] [issue39763] Hang after fork due to logging trying to reacquire the module lock in an atfork() handler

Elad Lahav report at bugs.python.org
Wed Feb 26 14:18:35 EST 2020


New submission from Elad Lahav <e2lahav at gmail.com>:

The attached code causes the child processes to hang on QNX. The hang is caused by the logging module trying to acquire the module lock while in an atfork() handler. In a system where semaphore state is kept in user mode and is thus inherited from the parent on fork() the semaphore may appear to have a value of 0, and thus will never be posted to in the single-threaded child.
I don't know how it works on other systems - may be pure chance.

----------
components: Library (Lib)
files: fork_mt.py
messages: 362717
nosy: Elad Lahav
priority: normal
severity: normal
status: open
title: Hang after fork due to logging trying to reacquire the module lock in an atfork() handler
versions: Python 3.8
Added file: https://bugs.python.org/file48917/fork_mt.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39763>
_______________________________________


More information about the New-bugs-announce mailing list