develooper Front page | perl.perl5.porters | Postings from November 2015

[perl #124097] Attempt to free unreferenced scalar: SV 0x5eb03f8(memory corruption)

Thread Next
From:
Tony Cook via RT
Date:
November 26, 2015 04:24
Subject:
[perl #124097] Attempt to free unreferenced scalar: SV 0x5eb03f8(memory corruption)
Message ID:
rt-4.0.18-3080-1448511862-1138.124097-15-0@perl.org
On Tue Mar 17 09:50:02 2015, davem wrote:
> On Tue, Mar 17, 2015 at 03:24:58AM -0700, Brian Carpenter wrote:
> > ==18863== Invalid write of size 8
> > ==18863==    at 0xAF06A0: Perl_leave_scope (scope.c:1231)
> > ==18863==    by 0xEA90B0: Perl_pp_sort (pp_sort.c:1763)
> > ==18863==    by 0x7CA22E: Perl_runops_debug (dump.c:2234)
> > ==18863==    by 0x53C088: perl_run (perl.c:2441)
> > ==18863==    by 0x42B167: main (perlmain.c:116)
> 
> on code basically like:
> 
>     @a = sort{ *a=0; 1} 0..1;
> 
> basically its deleting the *a glob then trying to restore the old value of
> $a on scope exit. I suspect sort needs to hold a ref count on *a and *b or
> something like that.

Like the attached?

Tony



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

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