develooper Front page | perl.perl5.porters | Postings from September 2016

[perl #129196] Segmentation fault: "evalbytes S"

Thread Previous
Dan Collins
September 4, 2016 18:06
[perl #129196] Segmentation fault: "evalbytes S"
Message ID:
# New Ticket Created by  Dan Collins 
# Please include the string:  [perl #129196]
# in the subject line of all future correspondence about this issue. 
# <URL: >

./miniperl -e 'CORE::evalbytes S'
Segmentation fault

==57556== Invalid read of size 4
==57556==    at 0x4BDCE7: Perl_yylex (toke.c:7033)
==57556==    by 0x4EDF1C: Perl_yyparse (perly.c:334)
==57556==    by 0x4778BC: S_parse_body (perl.c:2373)
==57556==    by 0x4778BC: perl_parse (perl.c:1689)
==57556==    by 0x4231E9: main (perlmain.c:121)
==57556==  Address 0x803fbc is not stack'd, malloc'd or (recently) free'd
==57556== Process terminating with default action of signal 11 (SIGSEGV)
==57556==  Access not within mapped region at address 0x803FBC
==57556==    at 0x4BDCE7: Perl_yylex (toke.c:7033)
==57556==    by 0x4EDF1C: Perl_yyparse (perly.c:334)
==57556==    by 0x4778BC: S_parse_body (perl.c:2373)
==57556==    by 0x4778BC: perl_parse (perl.c:1689)
==57556==    by 0x4231E9: main (perlmain.c:121)
==57556==  If you believe this happened as a result of a stack
==57556==  overflow in your program's main thread (unlikely but
==57556==  possible), you can try to increase the size of the
==57556==  main thread stack using the --main-stacksize= flag.
==57556==  The main thread stack size used in this run was 8388608.
==57556== HEAP SUMMARY:
==57556==     in use at exit: 116,564 bytes in 581 blocks
==57556==   total heap usage: 667 allocs, 86 frees, 126,756 bytes allocated
==57556== LEAK SUMMARY:
==57556==    definitely lost: 232 bytes in 1 blocks
==57556==    indirectly lost: 2,260 bytes in 27 blocks
==57556==      possibly lost: 24 bytes in 1 blocks
==57556==    still reachable: 114,048 bytes in 552 blocks
==57556==         suppressed: 0 bytes in 0 blocks
==57556== Rerun with --leak-check=full to see details of leaked memory
==57556== For counts of detected and suppressed errors, rerun with: -v
==57556== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Segmentation fault

(gdb) run
Starting program: /usr/local/perl-afl/bin/perl -e CORE::evalbytes\ S
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/".
Program received signal SIGSEGV, Segmentation fault.
0x00000000004bdce7 in Perl_yylex () at toke.c:7033
7033                            || ((PL_opargs[PL_last_lop_op] >> OASHIFT)& 7)
(gdb) bt
#0  0x00000000004bdce7 in Perl_yylex () at toke.c:7033
#1  0x00000000004edf1d in Perl_yyparse (gramtype=<optimized out>)
    at perly.c:334
#2  0x00000000004778bd in S_parse_body (env=<optimized out>,
    xsinit=<optimized out>) at perl.c:2373
#3  perl_parse (my_perl=<optimized out>, xsinit=<optimized out>,
    argc=<optimized out>, argv=<optimized out>, env=<optimized out>)
    at perl.c:1689
#4  0x00000000004231ea in main (argc=28672, argv=0xfea7, env=<optimized out>)
    at perlmain.c:121

5dc13276b282d472cc1e6c349c18352bd0db89e2 is the first new commit
commit 5dc13276b282d472cc1e6c349c18352bd0db89e2
Author: Matthew Horsfall (alh) <>
Date:   Mon Jul 2 22:20:39 2012 -0700

    For #16249 - Overwrite PL_last_lop_op when eval() is called.

    Otherwise, parsing later on down the road may use the previous value, which, if it was OP_PRINT, causes the parser to fail

:040000 040000 10996e189a33007b9736da4167b7104371638bd7 3cd150013621e1b73f35f1e75e65fde7e7e6e1a4 M      t
:100644 100644 13d7ac2cd01c993e4aa750fa5bbb34365ebe49f4 d9963a9da2eecde0c3eba44e77d3852c0069cf48 M      toke.c

Dan Collins

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About