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

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

Thread Previous | Thread Next
Father Chrysostomos
August 15, 2010 13:30
Re: [perl #76138] perl inadvertently destroys signal handlers as of f746176000
Message ID:

On Aug 9, 2010, at 11:13 AM, Jesse Vincent wrote:

> On Mon, Aug 09, 2010 at 12:03:33PM +0200, Rafael Garcia-Suarez wrote:
>> On 1 August 2010 21:08, Father Chrysostomos <> wrote:
>>> I could fix this either by making the %SIG initialisation less destructive (have it check whether each elem exists before assigning undef). Or I could stop all this magic from leaking into packages other than main (except for %OVERLOAD, etc.), breaking the JAPH above. Which is preferable?
>> I'd favor the second one, since unqualified %SIG is forced into main:: anyway.
> I'm a little bit concerned about breaking that bit of bugward
> compatibility,

It probably won’t be the first time I’ve regretted fixing a bug. :-) Try running this in 5.8:

$_ = "\n,rekcah lreP rehtona tsuJ"; sub a{chop}
print "${[bless[]]}[0]->a . reverse $_";

(B::Deparse is no help in deciphering it.)

> but if we're going to do it, it would make sense to try
> it earlier (nowish) in the blead cycle and step it back than to wait
> until the last minute.

Here’s a patch. All tests pass, except for cpan/CGI/t/http.t, which always fails. Attached also is a file with perldelta entries.

The diff may be a bit confusing. I moved the cases for ISA and OVERLOAD up into a new switch block that only applies to packages other than main. diff found a different way of looking at it.

For posterity, every test in leaky-magic.t fails without the gv.c changes, except for qw< %! %+ %- $/ $: $0 >, which seem to be unaffected by this bug.

Here’s a commit message:

Stop magic applied to $!, %SIG, et al. from applying to similarly-named variables in other packages.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About