[issue33725] Python crashes on macOS after fork with no exec

STINNER Victor report at bugs.python.org
Tue May 28 08:54:25 EDT 2019


STINNER Victor <vstinner at redhat.com> added the comment:

As soon as the "fork" start method "just works" on Linux, I'm not sure why you want to use "spawn" by default on Linux.

I don't buy the "consistency" argument here. I'm not surprised that such "low level" module like multiprocessing behaves differently depending on the platform to get the "native" and most efficient way to spawn subprocesses.

In general, fork is bad, but it's also convenient and people rely on it to prepare data in a main process and then "duplicate" the process to inherit cooked data.

If someone wants to more away from fork by default, I would suggest to *first* enhance multiprocessing documentation to list issues caused by fork(), and maybe also described when fork is safe (never doesn't sound like a good answer, since so far, I'm not aware of tons of bug reports on Linux caused by fork :-)).

----------

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


More information about the Python-bugs-list mailing list