New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signals not cleared by fork #11061
Comments
From philipgwyn@gmail.comCreated by philipgwyn@gmail.comPerl_csighandler() (the sigaction() signal handler) sets a flag in This introduces a race condition for pp_fork(): The quick fix: There is a problem with this though: Unless I mis-understand how signal The hard fix (the shared-nothing model): Included is a short script that exercises the problem. This script has #!/usr/bin/perl use strict; use POSIX ":sys_wait_h"; my print "my pid=$$ parent pid=$parent - this is the master control process, the only forker\n"; $SIG{CHLD} = sub { # NB - waitpid() < 0 is legal on MSWin32. sub forker { while ($todo > 0) { # Child here. Trigger SIGCHLD in the parent. # Parent. One fewer child to fork. # Known that this spins. Perl Info
|
From philipgwyn@gmail.comHere is a test case (from Rocco Caputo) that triggers the problem using #!/usr/bin/perl use strict; use POSIX ":sys_wait_h"; my print "my pid=$$ parent pid=$parent - this is the master control $SIG{USR1} = sub { $SIG{CHLD} = sub { # NB - waitpid() < 0 is legal on MSWin32. sub forker { while ($todo > 0) { # Child here. Trigger SIGCHLD in the parent. # Parent. One fewer child to fork. # Known that this spins. |
philipgwyn@gmail.com - Status changed from 'new' to 'open' |
From blgl@stacken.kth.se2011-01-21 kl. 22.37 skrev Philip Gwyn:
You misunderstand. It's ignored signals that are lost, not blocked ones. /Bo Lindbergh |
From philipgwyn@gmail.comOn Sun Jan 23 04:44:57 2011, blgl@stacken.kth.se wrote:
A short test shows that while CHLD makes it through, waitpid() will
|
From philipgwyn@gmail.comhttp://search.cpan.org/dist/IPC-SafeFork/ |
From @LeontOn Tue Jan 25 12:06:00 2011, Leolo wrote:
Perl reaps processes when closing filehandles created through «open Leon |
From @LeontOn Tue Apr 17 04:09:16 2012, LeonT wrote:
There's a patch that fixes this in the smoke-me/leont/signals-fork Leon |
From @cpansproutFixed in eb3d0a5. |
@cpansprout - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#82580 (status was 'resolved')
Searchable as RT82580$
The text was updated successfully, but these errors were encountered: