develooper Front page | perl.perl5.porters | Postings from July 2010

Re: [perl #76138] perl inadvertently destroys signal handlers asof f746176000

Thread Previous
From:
Zefram
Date:
July 26, 2010 14:02
Subject:
Re: [perl #76138] perl inadvertently destroys signal handlers asof f746176000
Message ID:
20100726210242.GD10983@lake.fysh.org
??var Arnfj??r?? Bjarmason wrote:
>As of f746176000 (Bareword sub lookups) by Zefram there's a regression
>in how perl handles signals:

Turns out this commit is not actually introducing a new bug.  It's making
an old bug happen in more circumstances than previously.  Here's a
shorter test for the new situation:

$ perl5.13.3 -lwe '$SIG{ALRM} = sub { warn "OK\n" }; eval "sub x {Y::SIG->z};1"; alarm 1; sleep 2'
Signal SIGALRM received, but no signal handler set.
$ perl5.10.1 -lwe '$SIG{ALRM} = sub { warn "OK\n" }; eval "sub x {Y::SIG->z};1"; alarm 1; sleep 2'
OK

And here's the equivalent test for a closely related situation:

$ perl5.13.3 -lwe '$SIG{ALRM} = sub { warn "OK\n" }; eval "sub x {\@Y::SIG->z};1"; alarm 1; sleep 2'
Signal SIGALRM received, but no signal handler set.
$ perl5.10.1 -lwe '$SIG{ALRM} = sub { warn "OK\n" }; eval "sub x {\@Y::SIG->z};1"; alarm 1; sleep 2'
Signal SIGALRM received, but no signal handler set.
$ perl5.004 -lwe '$SIG{ALRM} = sub { warn "OK\n" }; eval "sub x {\@Y::SIG->z};1"; alarm 1; sleep 2' 
Signal SIGALRM received, but no signal handler set.

-zefram

Thread Previous


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