develooper Front page | perl.perl5.porters | Postings from March 2014

[perl #121366] valgrind errors in t/op/vec.t

Thread Next
From:
Tony Cook via RT
Date:
March 26, 2014 03:38
Subject:
[perl #121366] valgrind errors in t/op/vec.t
Message ID:
rt-4.0.18-20184-1395805089-405.121366-15-0@perl.org
On Sun Mar 23 21:15:44 2014, tonyc wrote:
> This is happening when using vec() to modify an undef sv, eg:
> 
> $ valgrind -q ./perl -e 'vec($Foo, 0, 1) = 1'
> ==814== Conditional jump or move depends on uninitialised value(s)
> ==814==    at 0x5190C7: Perl_sv_pvn_force_flags (sv.c:9505)
> ==814==    by 0x580C9B: Perl_do_vecset (doop.c:927)
> ==814==    by 0x4D30AD: Perl_magic_setvec (mg.c:2305)
> ==814==    by 0x4CE522: Perl_mg_set (mg.c:279)
> ==814==    by 0x4EB417: Perl_pp_sassign (pp_hot.c:223)
> ==814==    by 0x4C42C9: Perl_runops_debug (dump.c:2425)
> ==814==    by 0x44BEC4: perl_run (perl.c:2449)
> ==814==    by 0x422934: main (perlmain.c:112)
>  ==814==
> 
> The error is on this line:
> 
> >>> if (s != SvPVX_const(sv)) {     /* Almost, but not quite,
> >>> sv_setpvn() */
> if (SvROK(sv))
>     sv_unref(sv);
> 
> where we examine sv->sv_u.svu_pv when it hasn't been initialized yet.

Pushed the fix as e14119056960dbe28537c9870667b5b920d9d731.

Tony

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=121366

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