On 2005-03-28, at 23:09:50 +0100, Dave Mitchell wrote:

> On Wed, Feb 23, 2005 at 11:40:09PM -0500, Stas Bekman wrote:
> > The scalars leaking reporting needs to be improved. At the moment if you 
> > get a scalars leaked reported and it didn't happen when you've added that 
> > new line of XS/C code you really have no idea where does it coming from. 
> > With -DDEBUG_LEAKING_SCALARS the best you can get is:
> > 
> > Scalars leaked: 1
> > leaked: sv=0x9d155d4 flags=0x0880003 refcnt=0, Perl interpreter: 0x89bdd40
> 
> The change I've committed below expands the behaviour of
>     -DDEBUG_LEAKING_SCALARS

I just ran the testsuite for one of my modules under valgrind and noticed
a new error that seems to originate from your patch.

I could reduce it to the following:

  [EMAIL PROTECTED] ~ $ valgrind --tool=memcheck bleadperl-debug -e'@a=1..2'
  ==8297== Memcheck, a memory error detector for x86-linux.
  ==8297== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
  ==8297== Using valgrind-2.4.0, a program supervision framework for x86-linux.
  ==8297== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
  ==8297== For more details, rerun with: -v
  [...]
  ==8297== Invalid read of size 2
  ==8297==    at 0x80FCDF3: S_new_SV (sv.c:214)
  ==8297==    by 0x8109A3D: Perl_newSV (sv.c:5323)
  ==8297==    by 0x80EC6D4: Perl_av_fetch (av.c:236)
  ==8297==    by 0x80B336B: Perl_pad_alloc (pad.c:423)
  ==8297==    by 0x80A0B44: Perl_fold_constants (op.c:2019)
  ==8297==    by 0x80A1AC6: Perl_newBINOP (op.c:2343)
  ==8297==    by 0x80A54BB: Perl_newASSIGNOP (op.c:3270)
  ==8297==    by 0x809A06B: Perl_yyparse (perly.y:491)
  ==8297==    by 0x80665AF: S_parse_body (perl.c:1733)
  ==8297==    by 0x80650D1: perl_parse (perl.c:1202)
  ==8297==    by 0x805FECB: main (perlmain.c:97)
  ==8297==  Address 0x1BB3A330 is 16 bytes inside a block of size 28 free'd
  ==8297==    at 0x1B903959: free (vg_replace_malloc.c:152)
  ==8297==    by 0x80D552E: Perl_safesysfree (util.c:150)
  ==8297==    by 0x809BFF3: Perl_op_free (op.c:315)
  ==8297==    by 0x809BF80: Perl_op_free (op.c:302)
  ==8297==    by 0x809BF80: Perl_op_free (op.c:302)
  ==8297==    by 0x80A0FEF: Perl_gen_constant_list (op.c:2114)
  ==8297==    by 0x809D532: Perl_list (op.c:894)
  ==8297==    by 0x809D322: Perl_listkids (op.c:849)
  ==8297==    by 0x809D54C: Perl_list (op.c:897)
  ==8297==    by 0x80A5494: Perl_newASSIGNOP (op.c:3270)
  ==8297==    by 0x809A06B: Perl_yyparse (perly.y:491)
  ==8297==    by 0x80665AF: S_parse_body (perl.c:1733)

It looks like PL_op has already been freed, but hasn't been nulled.

Marcus

-- 
If mathematically you end up with the wrong answer, try multiplying by
the page number.

Reply via email to