[New-bugs-announce] [issue34658] subprocess with preexec_fn when fork() fails could corrupt PyErr state

Gregory P. Smith report at bugs.python.org
Thu Sep 13 06:57:27 EDT 2018


New submission from Gregory P. Smith <greg at krypto.org>:

Found in the stdlib test suite while testing the fix for bpo-6721: When subprocess is called with a preexec_fn and os.register_at_fork has been used and the fork() system call fails, the Python error state is set before the "after fork in parent process" function calls that were registered were called.  So they'd call back into Python code with a pending unreturned exception set.

boom.  SystemError (or assertion failure in pydebug builds).

----------
assignee: gregory.p.smith
messages: 325238
nosy: gregory.p.smith
priority: normal
severity: normal
status: open
title: subprocess with preexec_fn when fork() fails could corrupt PyErr state
versions: Python 3.6, Python 3.7, Python 3.8

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


More information about the New-bugs-announce mailing list