[New-bugs-announce] [issue40091] Crash in logging._after_at_fork_child_reinit_locks()

STINNER Victor report at bugs.python.org
Fri Mar 27 13:02:43 EDT 2020


New submission from STINNER Victor <vstinner at python.org>:

test_threading.ThreadJoinOnShutdown.test_reinit_tls_after_fork() does crash randomly on AIX in logging._after_at_fork_child_reinit_locks():
https://bugs.python.org/issue40068#msg365028

This function ends by releasing a lock:

    _releaseLock()  # Acquired by os.register_at_fork(before=.

But it is not safe to use a lock after fork (see bpo-6721 and bpo-40089).

The purpose of _after_at_fork_child_reinit_locks() is already to fix locks used by logging handles: see bpo-36533 and commit 64aa6d2000665efb1a2eccae176df9520bf5f5e6. But the global logging._lock is not reset after fork.

Attached PR fix the issue.

----------
components: Library (Lib)
messages: 365170
nosy: vstinner
priority: normal
severity: normal
status: open
title: Crash in logging._after_at_fork_child_reinit_locks()
versions: Python 3.9

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


More information about the New-bugs-announce mailing list