develooper Front page | perl.perl5.porters | Postings from June 2009

Re: [PATCH] Re: 5.10.0 regressions that need fixing

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
June 26, 2009 07:09
Subject:
Re: [PATCH] Re: 5.10.0 regressions that need fixing
Message ID:
20090626140858.GD18688@iabyn.com
On Sun, Jun 21, 2009 at 01:54:29PM +0200, Rafael Garcia-Suarez wrote:
> 2009/1/5 Ben Morrow <ben@morrow.me.uk>:
> > Quoth davem@iabyn.com (Dave Mitchell):
> >>
> >> Date: Tue, 02 Sep 2008 12:33:34 -0700
> >> Subject: [perl #58530] Bus error with constant + overload + stash manipulation
> >>         + bless
> >>
> >>     Appears to be a 5.8.8 regression. fails on maint + bleed
> >
> > The test case in the bug report is equivalent to
> >
> >    sub foo { 1 }
> >    use overload q/""/ => \&foo;
> >    delete $main::{foo};
> >    bless [];
> >
> > and deleting stashes has always been able to produce segfaults; for
> > instance,
> >
> >    use Devel::Peek;
> >    my $x = \&{"foo"};
> >    delete $main::{foo};
> >    Dump $x;
> >
> > which has segfaulted since at least 5.6. I don't really understand why
> > overloading didn't tickle this under 5.8--I suspect the glob was being
> > kept around when it shouldn't have been--but in any case the attached
> > patches fix most of this class of segfaults by making a sub CvANON when
> > its stash entry gets deleted.
> >
> > The first is the fix, which requires regen_headers; the second is the
> > output of regen_headers; the third is the test cases. Clearing or
> > deleting an entire stash will still leave any anon subs in that stash
> > prone to causing segfaults, but I don't see any way of finding them.
> > I've included TODO tests anyway... :).
> 
> Thanks, I've applied :
> 1. the test patch as d018fae575c7e183deffddccedc84f1f5d7ddacb
> 2. the code change as f1c32fec87699aee2eeb638f44135f21217d2127
> 3. regeneration of headers + compilation fix to get it working with a
> threaded perl as 4fec321675757b1adbfc9b8317737404d211664f

This fix makes me twitch. There are a whole bunch of semantics tied up
with anon CVs in addition to them just being things not pointed to by a glob.
Since the underlying problem is not a 5.10.0 regression, I think I'm going
to leave this change out of 5.10.1, and review it later.

-- 
Indomitable in retreat, invincible in advance, insufferable in victory
    -- Churchill on Montgomery

Thread Previous | Thread Next


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