Skip Menu |

This queue is for tickets about the IO-Async CPAN distribution.

Report information
The Basics
Id: 104413
Status: open
Priority: 0/
Queue: IO-Async

People
Owner: Nobody in particular
Requestors: barrie.perry [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Infinite wait if $SIG{'INT'} is set to a custom function before calling $loop->run
Date: Wed, 13 May 2015 17:17:46 -0400
To: bug-IO-Async [...] rt.cpan.org
From: Barrie Perry <barrie.perry [...] gmail.com>
If $SIG{'INT'} is defined before calling $loop->run the script enter an infinite wait. CTRL-C is not able to terminate the script. Using -d:Trace it looks like perl is stuck here: IO/Async/Loop/Select.pm:223: my $ret = select( $rvec, $wvec, $evec, $timeout ); *Environment:* Windows 7 Perl v5.20.2, built for MSWin32-x86-multi-thread-64int (ie: portable strawberry-perl-5.20.2.1-32bit-PDL) IO-Async-0.66 *Example* use v5.018; use strict; use warnings; use IO::Async::Loop; sub signal_handler { die shift; } $SIG{'INT'} = \&signal_handler; # comment out this line and CTRL-C can terminate the script in $loop->run my $loop = IO::Async::Loop->new; # # CTRL-C is working here # for (1..100) { # select(undef, undef, undef, 0.250); # } # The loop itself isn't working here, even CTRL-C won't terminate the script $loop->run; die "END";
On Wed May 13 17:18:01 2015, barrie.perry@gmail.com wrote: Show quoted text
> If $SIG{'INT'} is defined before calling $loop->run the script enter an > infinite wait. CTRL-C is not able to terminate the script. > > Using -d:Trace it looks like perl is stuck here: > IO/Async/Loop/Select.pm:223: my $ret = select( $rvec, $wvec, $evec, > $timeout ); > > > *Environment:* > Windows 7
Ah. At this point I'm afraid I don't know enough about Windows and signals, to know if this sort of thing is expected to work or not. I do know that signals aren't as big or powerful a thing generally on Windows as they are on the POSIXes, and there's a lot of abilities that just don't exist. I'm afraid I'll have to defer this to anyone who might know more about Windows and signals to suggest what can be done about it. -- Paul Evans