[issue47245] potential undefined behavior with subprocess using vfork() on Linux?

Марк Коренберг report at bugs.python.org
Fri Apr 8 06:47:24 EDT 2022


Марк Коренберг <socketpair at gmail.com> added the comment:

So, finally: 

1. Regarding vfork() and stack - everything is nice. No bugs because libc has nasty hacks for stack restoration.

2. Having the ability to turn off vfork using environment variables is NICE. At least, one can easily compare the performance.

3. We have to fix error-path in order not to change heap state (contents and allocations), possibly do not touch locks. During vfork() child execution - the only parent THREAD (not the process) is blocked. For example, it's not allowed to touch GIL. Child process may die unexpectedly and leave GIL locked. Is it possible to rewrite children path for vfork() case without any Py* calls ? As an idea, we can prepare all low-level things (all the pointers to strings and plain values) before vfork(), so child code will use only that data.

----------

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


More information about the Python-bugs-list mailing list