Bug 859257
Summary: | Defered signal handling doesn't work correctly when interrupted by another signal | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Justin Washington <jwjw9922> |
Component: | perl | Assignee: | perl-maint-list |
Status: | CLOSED NOTABUG | QA Contact: | BaseOS QE - Apps <qe-baseos-apps> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.3 | CC: | ppisar, psabata |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2012-09-24 10:49:34 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Justin Washington
2012-09-20 23:05:21 UTC
Here are 3 some other tests: 1). Script t1.pl: #!/usr/bin/perl use POSIX; our $i = 0; if (1) { my $sigaction = POSIX::SigAction->new(\&sighandler, POSIX::SigSet->new()); $sigaction->safe(1); POSIX::sigaction(&POSIX::SIGCHLD, $sigaction); } kill CHLD => $$; exit; sub sighandler { exit if $i == 6; print ++$i, ": processing", "\n"; kill CHLD => $$; print $i, ": done", "\n"; } Output: 1: processing 1: done 2: processing 2: done 2). Script t2.pl #!/usr/bin/perl use POSIX; our $i = 0; if (1) { my $sigaction = POSIX::SigAction->new(\&sighandler, POSIX::SigSet->new()); #$sigaction->safe(1); POSIX::sigaction(&POSIX::SIGCHLD, $sigaction); } kill CHLD => $$; exit; sub sighandler { exit if $i == 6; print ++$i, ": processing", "\n"; kill CHLD => $$; print $i, ": done", "\n"; } Output: 1: processing 1: done 2: processing 2: done 3: processing 3: done 4: processing 4: done 5: processing 5: done 6: processing 6: done 3). Script t3.pl: #!/usr/bin/perl use POSIX; our $i = 0; my $sigaction = POSIX::SigAction->new(\&sighandler, POSIX::SigSet->new()); $sigaction->safe(1); POSIX::sigaction(&POSIX::SIGCHLD, $sigaction); kill CHLD => $$; exit; sub sighandler { exit if $i == 6; print ++$i, ": processing", "\n"; kill CHLD => $$; print $i, ": done", "\n"; } Output: 1: processing 1: done 2: processing 2: done 3: processing 3: done 4: processing 4: done 5: processing 5: done 6: processing 6: done The output of script t1.pl is not correct. Where you get confidence that all 6 signals get processed or even emitted before the code reaches exit call in the main program? Adding while ($i < 6) {sleep 1;} just before `exit' in the t1.pl as well as in the code from comment #1 does fix your problem. I'm really keen to say your code is missing a synchronization. |