develooper Front page | perl.perl5.porters | Postings from May 2013

[perl #22735] Losing signals using sigprocmask

From:
James E Keenan via RT
Date:
May 27, 2013 12:45
Subject:
[perl #22735] Losing signals using sigprocmask
Message ID:
rt-3.6.HEAD-2650-1369658736-1464.22735-15-0@perl.org
On Thu Jun 19 01:33:15 2003, paulb@grover.be.ubizen.com wrote:
> 
> To: perlbug@perl.org
> Subject: Signals are lost when using sigprocmask
> Cc: paul.busse@ubizen.com
> Reply-To: paul.busse@ubizen.com
> Message-Id: <5.8.0_5018_1056010067@devcpu.be.ubizen.com>
> 
> This is a bug report for perl from paul.busse@ubizen.com,
> generated with the help of perlbug 1.34 running under perl v5.8.0.
> 
> 
> -----------------------------------------------------------------
> 
> #!/usr/bin/perl -w
> 
> use POSIX;
> use Data::Dumper;
> 
> $SIG{HUP} =  sub { print "in HUP handler\n";};
> my $blockset = POSIX::SigSet->new(SIGHUP);
> my $set = POSIX::SigSet->new(SIGHUP);
> sigprocmask(SIG_BLOCK, $blockset, $set)
>     or $::ENV->error("Can't block SIGHUP : $!");
> #open FH, "cat|" or die "cat|$!\n";
> print "TEST\n";
> <>; # Comment
> #<FH>;
> print "TEST2\n";
> #close FH;
> sigprocmask(SIG_UNBLOCK, $blockset, $set)
>     or $::ENV->error("Can't unblock SIGHUP : $!");
> print "TEST3\n";
> 
> The program as listed above runs as expected: i.e.
> When I sent a SIGHUP to the process while it is waiting for
> input, the line "in HUP handler" appears between TEST2 and TEST3.
> 
> However if I uncomment the commented lines and comment the line
> marked with '#Comment' and I sent a SIGHUP to the perl process
> (i.e. not the cat) while the process is waiting for the <FH>
>  I never see the "in HUP handler" line.
> So, apparently the signal gets lost.
> 


List:  Is there someone familiar with sending signals to processes who
could review this older ticket?

Thank you very much.
Jim Keenan



---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=22735



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About