On Wed, Dec 01, 2004 at 10:15:55PM +0000, Nicholas Clark wrote:
> On Wed, Dec 01, 2004 at 11:59:13PM +0200, Jarkko Hietaniemi wrote:
> > Jarkko Hietaniemi wrote:

> > > Now I know more - useithreads matters.  The breakage happens
> > > with the combination of -Duseithreads and the UTF-8 locales.
> > > Fun.  Could we get MakeMaker in there somehow? :-)
> 
> Aha. I didn't have ithreads. I've recompiled with ithreads.

Not actually a UTF8 bug. valgrind still screams without any UTF8.
It's something ithreads.

> ==26752== Invalid read of size 1
> ==26752==    at 0x1B904788: strlen (mac_replace_strmem.c:189)
> ==26752==    by 0x8100325: Perl_sv_setpv (sv.c:4839)
> ==26752==    by 0x1C00C9B4: XS_B__GV_FILE (B.c:3823)

3rd to last line of

XS(XS_B__GV_FILE)
{
    dXSARGS;
    if (items != 1)
        Perl_croak(aTHX_ "Usage: B::GV::FILE(gv)");
    {
        B__GV   gv;
        char *  RETVAL;
        dXSTARG;

        if (SvROK(ST(0))) {
            IV tmp = SvIV((SV*)SvRV(ST(0)));
            gv = INT2PTR(B__GV,tmp);
        }
        else
            croak("gv is not a reference");

        RETVAL = GvFILE(gv);
        sv_setpv(TARG, RETVAL); XSprePUSH; PUSHTARG;
    }
    XSRETURN(1);
}

> ==26752==    by 0x80F3C7C: Perl_pp_entersub (pp_hot.c:2826)
> ==26752==  Address 0x1BBBFE60 is 0 bytes inside a block of size 20 free'd
> ==26752==    at 0x1B905460: free (vg_replace_malloc.c:153)
> ==26752==    by 0x8130A4D: Perl_leave_scope (scope.c:727)
> ==26752==    by 0x812E701: Perl_pop_scope (scope.c:125)
> ==26752==    by 0x80F1823: Perl_pp_leavesub (pp_hot.c:2411)

==27064==    by 0x80CCAA5: Perl_runops_debug (dump.c:1572)
==27064==    by 0x80679D4: S_call_body (perl.c:2155)
==27064==    by 0x80674CA: Perl_call_sv (perl.c:2074)
==27064==    by 0x806CF17: S_call_list_body (perl.c:4597)
==27064==    by 0x806C982: Perl_call_list (perl.c:4526)
==27064==    by 0x80A6FE3: Perl_newATTRSUB (op.c:4481)
==27064==    by 0x80A1FAA: Perl_utilize (op.c:3038)
==27064==    by 0x8096BA1: Perl_yyparse (perly.y:379)
==27064==    by 0x8066025: S_parse_body (perl.c:1636)
==27064==    by 0x8064CC3: perl_parse (perl.c:1139)
==27064==    by 0x805FE6B: main (perlmain.c:96)

So it's in the use B...;

Line in question is the PerlMemShared_free in

        case SAVEt_SHARED_PVREF:                /* shared pv */
            str = (char*)SSPOPPTR;
            ptr = SSPOPPTR;
            if (*(char**)ptr != str) {
#ifdef NETWARE
                PerlMem_free(*(char**)ptr);
#else
                PerlMemShared_free(*(char**)ptr);
#endif
                *(char**)ptr = str;
            }
            break;



Does this give anyone a hunch as to the cause?

Nicholas Clark

Reply via email to