[issue25666] Python unexpectedly ignores a signal after fork

2015-12-10 Thread Martin Panter
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: . It looks like main_pid gets updated inside PyOS_AfterFork(), bu

[issue25666] Python unexpectedly ignores a signal after fork

2015-11-19 Thread Martin Panter
Martin Panter added the comment: Here is a modified version of the script that is not a slow fork bomb. In the original, if time.sleep(600) fails to be interrupted, the children end up continuing the loop and forking more children. I tried Python 3.5, 2.7 and 3.4. I am seeing the signal comple

[issue25666] Python unexpectedly ignores a signal after fork

2015-11-19 Thread R. David Murray
R. David Murray added the comment: Are you sure this is a python issue and not an OS issue? That is, does an equivalent C program work correctly? Since the operation is a fork, I don't think there's anything that python does that would cause the signal to be ignored. The comment block in th

[issue25666] Python unexpectedly ignores a signal after fork

2015-11-19 Thread jon orebro
New submission from jon orebro: Description: I found a slight problem with signal handling. It seems that if you have a signal handler setup for a signal, right after a fork the child ignores that signal for a short time. This is regardless of what the signal handler is setup to do. This can c