develooper Front page | perl.perl5.porters | Postings from February 2018

[perl #132920] Assertion `SvTYPE(sv) != (svtype)SVTYPEMASK' failed

Thread Previous
From:
Brian Carpenter
Date:
February 28, 2018 02:03
Subject:
[perl #132920] Assertion `SvTYPE(sv) != (svtype)SVTYPEMASK' failed
Message ID:
rt-4.0.24-14912-1519783434-1018.132920-75-0@perl.org
# New Ticket Created by  Brian Carpenter 
# Please include the string:  [perl #132920]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=132920 >


This assertion failure is triggered in Perl v5.27.9 (v5.27.8-408-ga0da1e1.

./perl -e '($a)=map[split//],G0;$0=map abs($0[$a++]),@$a'

perl: sv.c:6508: void Perl_sv_clear(SV *const): Assertion `SvTYPE(sv) !=
(svtype)SVTYPEMASK' failed.

Testing against the installed v5.22.1 on Ubuntu with valgrind, I see this:

==26560== Invalid read of size 1
==26560==    at 0x4C3008: ??? (in /usr/bin/perl)
==26560==    by 0x4C31AD: Perl_sv_unmagic (in /usr/bin/perl)
==26560==    by 0x4C216A: Perl_sv_clear (in /usr/bin/perl)
==26560==    by 0x4C2ABC: Perl_sv_free2 (in /usr/bin/perl)
==26560==    by 0x4F17CF: Perl_leave_scope (in /usr/bin/perl)
==26560==    by 0x4F934F: Perl_pp_mapwhile (in /usr/bin/perl)
==26560==    by 0x4B62C5: Perl_runops_standard (in /usr/bin/perl)
==26560==    by 0x443BC8: perl_run (in /usr/bin/perl)
==26560==    by 0x41CB2A: main (in /usr/bin/perl)
==26560==  Address 0xff00000012 is not stack'd, malloc'd or (recently)
free'd
==26560==
==26560==
==26560== Process terminating with default action of signal 11 (SIGSEGV)
==26560==  Access not within mapped region at address 0xFF00000012
==26560==    at 0x4C3008: ??? (in /usr/bin/perl)
==26560==    by 0x4C31AD: Perl_sv_unmagic (in /usr/bin/perl)
==26560==    by 0x4C216A: Perl_sv_clear (in /usr/bin/perl)
==26560==    by 0x4C2ABC: Perl_sv_free2 (in /usr/bin/perl)
==26560==    by 0x4F17CF: Perl_leave_scope (in /usr/bin/perl)
==26560==    by 0x4F934F: Perl_pp_mapwhile (in /usr/bin/perl)
==26560==    by 0x4B62C5: Perl_runops_standard (in /usr/bin/perl)
==26560==    by 0x443BC8: perl_run (in /usr/bin/perl)
==26560==    by 0x41CB2A: main (in /usr/bin/perl)
==26560==  If you believe this happened as a result of a stack
==26560==  overflow in your program's main thread (unlikely but
==26560==  possible), you can try to increase the size of the
==26560==  main thread stack using the --main-stacksize= flag.
==26560==  The main thread stack size used in this run was 8388608.
Segmentation fault


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About