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

[perl #123735] Perl_rpeep: Assertion `!(o2->op_flags & ~(3|32|128))' failed (op.c:12894)

Thread Next
From:
Brian Carpenter
Date:
February 5, 2015 04:40
Subject:
[perl #123735] Perl_rpeep: Assertion `!(o2->op_flags & ~(3|32|128))' failed (op.c:12894)
Message ID:
rt-4.0.18-25679-1423111188-1724.123735-75-0@perl.org
# New Ticket Created by  Brian Carpenter 
# Please include the string:  [perl #123735]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=123735 >


Built v5.21.9 (v5.21.8-200-ga57d3d4) using the following command line:

./Configure -des -Dusedevel -DDEBUGGING -Dcc=afl-gcc -Doptimize=-O2\ -g && AFL_HARDEN=1 make -j6 test-prep

Bug found with AFL (http://lcamtuf.coredump.cx/afl)

GDB output:
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
perl: op.c:12894: Perl_rpeep: Assertion `!(o2->op_flags & ~(3|32|128))' failed.

Program received signal SIGABRT, Aborted.
[----------------------------------registers-----------------------------------]
RAX: 0x0 
RBX: 0x7fffffffe653 --> 0x6e696d006c726570 ('perl')
RCX: 0xffffffffffffffff 
RDX: 0x6 
RSI: 0x76ee 
RDI: 0x76ee 
RBP: 0x7ffff6ea9a07 --> 0x257325732500203a (': ')
RSP: 0x7fffffffdcf8 --> 0x7ffff6d923e0 (<*__GI_abort+384>:	mov    rdx,QWORD PTR fs:0x10)
RIP: 0x7ffff6d8f165 (<*__GI_raise+53>:	cmp    rax,0xfffffffffffff000)
R8 : 0x7ffff7fdd700 (0x00007ffff7fdd700)
R9 : 0x207367616c665f70 ('p_flags ')
R10: 0x8 
R11: 0x206 
R12: 0xe77cd3 ("!(o2->op_flags & ~(3|32|128))")
R13: 0xe8c013 ("Perl_rpeep")
R14: 0x7ffff6ea9a07 --> 0x257325732500203a (': ')
R15: 0x325e ('^2')
EFLAGS: 0x206 (carry PARITY adjust zero sign trap INTERRUPT direction overflow)
[-------------------------------------code-------------------------------------]
   0x7ffff6d8f15b <*__GI_raise+43>:	movsxd rdi,eax
   0x7ffff6d8f15e <*__GI_raise+46>:	mov    eax,0xea
   0x7ffff6d8f163 <*__GI_raise+51>:	syscall 
=> 0x7ffff6d8f165 <*__GI_raise+53>:	cmp    rax,0xfffffffffffff000
   0x7ffff6d8f16b <*__GI_raise+59>:	ja     0x7ffff6d8f182 <*__GI_raise+82>
   0x7ffff6d8f16d <*__GI_raise+61>:	repz ret 
   0x7ffff6d8f16f <*__GI_raise+63>:	nop
   0x7ffff6d8f170 <*__GI_raise+64>:	test   eax,eax
[------------------------------------stack-------------------------------------]
0000| 0x7fffffffdcf8 --> 0x7ffff6d923e0 (<*__GI_abort+384>:	mov    rdx,QWORD PTR fs:0x10)
0008| 0x7fffffffdd00 --> 0xe77cd3 ("!(o2->op_flags & ~(3|32|128))")
0016| 0x7fffffffdd08 --> 0x7ffff6eab9c1 --> 0x706c6568007325 ('%s')
0024| 0x7fffffffdd10 --> 0x7fffffffdd30 --> 0x3000000018 
0032| 0x7fffffffdd18 --> 0x325e ('^2')
0040| 0x7fffffffdd20 --> 0x7fffffffde20 --> 0x7fffffffe653 --> 0x6e696d006c726570 ('perl')
0048| 0x7fffffffdd28 --> 0x7ffff6dc3fe6 (<__fxprintf+310>:	lea    rsp,[rbp-0x20])
0056| 0x7fffffffdd30 --> 0x3000000018 
[------------------------------------------------------------------------------]
Legend: code, data, rodata, value
Stopped reason: SIGABRT
0x00007ffff6d8f165 in *__GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64	../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
gdb-peda$ bt
#0  0x00007ffff6d8f165 in *__GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007ffff6d923e0 in *__GI_abort () at abort.c:92
#2  0x00007ffff6d88311 in *__GI___assert_fail (assertion=assertion@entry=0xe77cd3 "!(o2->op_flags & ~(3|32|128))", file=<optimized out>, file@entry=0xf253e2 "op.c", line=line@entry=0x325e, function=function@entry=0xe8c013 "Perl_rpeep") at assert.c:81
#3  0x00000000004962b9 in Perl_rpeep (o=0x1185b78) at op.c:12894
#4  0x000000000048b6f6 in Perl_newPROG (o=<optimized out>) at op.c:4087
#5  0x0000000000662f94 in Perl_yyparse (gramtype=<optimized out>) at perly.y:120
#6  0x000000000052d275 in S_parse_body (env=env@entry=0x0, xsinit=xsinit@entry=0x42d080 <xs_init>) at perl.c:2273
#7  0x000000000053324f in perl_parse (my_perl=<optimized out>, xsinit=0x42d080 <xs_init>, argc=<optimized out>, argv=<optimized out>, env=0x0) at perl.c:1607
#8  0x000000000042cc8c in main (argc=0x2, argv=0x7fffffffe3d8, env=0x7fffffffe3f0) at perlmain.c:114
#9  0x00007ffff6d7bead in __libc_start_main (main=<optimized out>, argc=<optimized out>, ubp_av=<optimized out>, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe3c8) at libc-start.c:244
#10 0x000000000042cfa5 in _start ()

Hexdump of the test case:
0000000 7270 6e69 0a74 796d 7228 0029          
000000b
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