Re: 5.9.1 release now integrated into ponie

[email protected] (Dave Mitchell) Thu, 8 Apr 2004 19:44:31 +0100
Newsgroups perl.ponie.dev
Message-ID <[email protected]>
On Thu, Apr 08, 2004 at 04:22:09PM +0100, Nicholas Clark wrote:
> We're in parts of perl I don't know. The save stack is getting restored:
> 
> 	case SAVEt_COMPPAD:
> 	    PL_comppad = (PAD*)SSPOPPTR;
> 	    if (PL_comppad)
> 		PL_curpad = AvARRAY(PL_comppad);
> 	    else
> 		PL_curpad = Null(SV**);
> 	    break;
> 
> and the crash is because PL_comppad has just been reloaded with this:
> 
> (gdb) print *PL_comppad
> $13 = {
>   sv_any = 0x101e7c0, 
>   sv_refcnt = 0, 
>   sv_flags = 255, 
>   sv_is_pmc = 1 '\001'
> }
> 
> so that AvARRAY() kicks in. Should that if(PL_comppad) be checking the
> SvFLAGS?  And silently treating type 0xFF the same way as PL_comppad of
> NULL? Or is this a (perl) bug and it should be pitching a fit?

I don't know anything about the Ponie side of things, but from a purely
Perl perspective, PL_comppad should at all times ether point to a valid AV
or be null.  This looks like it's pointing to a freed something (type ==
SVTYPEMASK, refcnt == 0).

My suspcicians would point to the handling of the parent padlist AV, which
is an AV of AVs (rather than the usual AV of RVs to AVs) The padlist AV
does not have the AvREAL flag set, so the individual elements within the
padlist aren't refcounted, and the freeing is explicitly handled by the
pad code itself.  If Ponie isn't properly handling AVs where AvREAL is
turned off, that might explain what you're seeing.

Dave.

-- 
A power surge on the Bridge is rapidly and correctly diagnosed as a faulty
capacitor by the highly-trained and competent engineering staff.
    -- Things That Never Happen in "Star Trek" #9