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

Re: [perl #50528] Perl 5.10.0 segfaults on Format with my variables

Thread Previous
June 25, 2009 14:50
Re: [perl #50528] Perl 5.10.0 segfaults on Format with my variables
Message ID:
On Tuesday 05 February 2008 16:29:12 Dave Mitchell wrote:

> The bug is due to the fact that in the presence of prototypes, after the
> real sub is compiled, its body is physically copied across to a new CV,
> which messes the CvOUTSIDE field of any child anon or format subs.
> The anon subs are fixed up by looking through the parent's pad for any
> '&' entries which point to the children that need fixing. There isn't a
> similar way to find formats, so they can't be fixed up.
> The two solutions seem to be:
> a) have pointers in parent pads to formats, or
> b) rejig newATTRSUB in such a way that it doesn't have to do the
> abomination of copying the CV body.
> Don't really have time to look at this further yet.

I don't think b) is tractable.  If anything's taken a reference to a sub 
prototype, it points to the first CV.  If you stuff a new CV (a properly mangled 
PL_compcv, for example) in the GV (or wherever), you break at least an 
AutoLoader test in the core, and some expectations elsewhere.  My failed 
attempt produced failures in:


... along these lines:

not ok 41
# Failed at t/op/method.t line 136
#      got 'B: In B::e, 2'
# expected 'C: In C::e, 1'
not ok 42
# Failed at t/op/method.t line 138
#      got 'B: In A::ee, 3'
# expected 'B: In A::ee, 2'
not ok 43
# Failed at t/op/method.t line 139
#      got 'B: In A::ee, 3'
# expected 'B: In A::ee, 2'

-- c

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