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";