Skip Menu |

This queue is for tickets about the POE-Test-Loops CPAN distribution.

Report information
The Basics
Id: 45158
Status: resolved
Priority: 0/
Queue: POE-Test-Loops

People
Owner: Nobody in particular
Requestors: dolmen [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 1.005
  • 1.020
Fixed in: 1.021



Subject: 30_loops/*/sbk_signal_init.t failure ($SIG{ALRM} not preserved after "use POE")
perl 5.8.0 on HP-UX B.11.11 with POE 1.004 See also ticket 19529. $ perl -Iblib/lib t/30_loops/select/sbk_signal_init.t 1..1 not ok 1 - normal SIGALRM dispatched # Failed test (/produits/supervision/agent/cpan/lib/perl5/POE/Test/Loops/sbk_signal_init.pm at line 34) # Looks like you failed 1 tests of 1. $ perl -Iblib/lib t/30_loops/io_poll/sbk_signal_init.t 1..1 not ok 1 - normal SIGALRM dispatched # Failed test (/produits/supervision/agent/cpan/lib/perl5/POE/Test/Loops/sbk_signal_init.pm at line 34) # Looks like you failed 1 tests of 1.
Can you reproduce the problem on a version of Perl newer than 5.8.0? Perl 5.8.0 has a number of issues, and I'm hoping that a later release has already resolved this one. If the problem turns out to be a platform-specific issue with HP-UX, then a resolution may take a lot longer. I don't have an HP-UX machine to test against. On Mon Apr 20 08:29:06 2009, DOLMEN wrote: Show quoted text
> perl 5.8.0 on HP-UX B.11.11 with POE 1.004 > See also ticket 19529. > > > > $ perl -Iblib/lib t/30_loops/select/sbk_signal_init.t > 1..1 > not ok 1 - normal SIGALRM dispatched > # Failed test >
(/produits/supervision/agent/cpan/lib/perl5/POE/Test/Loops/sbk_signal_init.pm Show quoted text
> at line 34) > # Looks like you failed 1 tests of 1.
Le Mar. Avr. 21 00:17:32 2009, RCAPUTO a écrit : Show quoted text
> Can you reproduce the problem on a version of Perl newer than 5.8.0? > Perl 5.8.0 has a number of issues, and I'm hoping that a later release > has already resolved this one.
I'm confirming on another HP-UX machine with perl 5.8.8. Show quoted text
> If the problem turns out to be a platform-specific issue with HP-UX, > then a resolution may take a lot longer. I don't have an HP-UX > machine > to test against.
I will do my best to help you to help me. I can provide any information you need, except a direct access to a machine. Note that I have some issues with RT: I've not found where I can change the preferences to be always mailed when my bugs are updated.
On Tue May 05 09:21:47 2009, DOLMEN wrote: Show quoted text
> Le Mar. Avr. 21 00:17:32 2009, RCAPUTO a écrit :
> > Can you reproduce the problem on a version of Perl newer than 5.8.0? > > Perl 5.8.0 has a number of issues, and I'm hoping that a later release > > has already resolved this one.
> > I'm confirming on another HP-UX machine with perl 5.8.8.
Do you mean that you have confirmed it with HP-UX and Perl 5.8.8? POE should not touch $SIG{ALRM}. If Perl 5.8.8 also exhibits the problem, then I suspect the test itself is at fault. Perhaps try rearranging the code to read: # ... everything before ... my $signal_dispatched = 0; sub dispatch_normal_signal { $signal_dispatched = 1 } BEGIN { $SIG{ALRM} = \&dispatch_normal_signal; } # ... everything after ... Perhaps something is going wrong when $SIG{ALRM} is initialized to refer to a subroutine that does not exist yet? Show quoted text
> Note that I have some issues with RT: I've not found where I can change > the preferences to be always mailed when my bugs are updated.
I'm sorry, but I don't know rt.cpan.org well enough to say if that is an option. Please ask rt-cpan-admin@bestpractical.com
Le Sam. Mai. 30 16:18:04 2009, RCAPUTO a écrit : Show quoted text
> Do you mean that you have confirmed it with HP-UX and Perl 5.8.8?
Yes. Show quoted text
> POE should not touch $SIG{ALRM}. If Perl 5.8.8 also exhibits the > problem, then I suspect the test itself is at fault. Perhaps try > rearranging the code to read: > > # ... everything before ... > > my $signal_dispatched = 0; > sub dispatch_normal_signal { $signal_dispatched = 1 } > BEGIN { > $SIG{ALRM} = \&dispatch_normal_signal; > } > > # ... everything after ...
It looks like that SIGALRM dispatching is not working event without POE involved, as I tried without the "use POE" and it fails too. The perldoc for 'alarm' says: It is usually a mistake to intermix "alarm" and "sleep" calls. ("sleep" may be internally implemented in your system with "alarm") Also the HP-UX sleep(3C) says: http://www.docs.hp.com/en/B2355-90695/sleep.3C.html If a SIGALRM is generated for a multi-threaded process, it may not be delivered to a thread currently in sleep(). See sigwait(2) man page for details. In a multi-threaded process delivery of a SIGALRM to a thread in sleep() simply causes sleep() to return without invoking the SIGALRM handler. So we can consider that this test is not reliable/portable. The test should be skipped if alarm+sleep is not reliable.
Does this patch fix it? =================================================================== --- lib/POE/Test/Loops/sbk_signal_init.pm (revision 2596) +++ lib/POE/Test/Loops/sbk_signal_init.pm (working copy) @@ -29,7 +29,7 @@ use POE; alarm(1); -sleep 5; +select(undef, undef, undef, 5); ok($signal_dispatched, "normal SIGALRM dispatched");
I committed the previous patch as revision 2599. I'll be releasing 1.021 shortly.
Le Ven. Jul. 24 11:36:41 2009, RCAPUTO a écrit : Show quoted text
> Does this patch fix it?
Yes, I verified that the patch fixes the problem on HP-UX (POE::Test::Loop 1.005 patched and POE 1.006). However, could you add a comment in the source code to point to this bug? Using "select" instead of "sleep" is quite strange and deserves an explanation (not for me, but for your followers).
Le Mar. Jul. 28 02:58:38 2009, DOLMEN a écrit : Show quoted text
> Le Ven. Jul. 24 11:36:41 2009, RCAPUTO a écrit :
> > Does this patch fix it?
> > Yes, I verified that the patch fixes the problem on HP-UX > (POE::Test::Loop 1.005 patched and POE 1.006).
Verified on HP-UX (POE::Test::Loop 1.021 and POE 1.006) Show quoted text
> However, could you add a comment in the source code to point to this > bug? Using "select" instead of "sleep" is quite strange and deserves an > explanation (not for me, but for your followers).
Comment in 1.021 is perfect.