[docs] [issue25666] Python unexpectedly ignores a signal after fork

Martin Panter report at bugs.python.org
Fri Dec 11 01:25:13 EST 2015


Martin Panter added the comment:

I think I figured out the problem. The signal module has a “main_pid” variable which it checks inside the low-level handler: <https://hg.python.org/cpython/file/v3.5.1/Modules/signalmodule.c#l300>. It looks like main_pid gets updated inside PyOS_AfterFork(), but I guess there is a race with a signal being received before main_pid is updated.

Maybe there should be some signal masking/blocking or something in the critical section between fork() and PyOS_AfterFork()?

----------
versions:  -Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25666>
_______________________________________


More information about the docs mailing list