cpanel / perl-compiler

cPanel's custom implementation of B::C
https://cpanel.net
Other
8 stars 3 forks source link

SEGV at compile time from B #60

Open atoomic opened 7 years ago

atoomic commented 7 years ago
> gdb perl -ex 'b perl_run' -ex 'run -MO=C,-v,-oop/lexsub.c op/lexsub.t'
Starting program: /usr/local/cpanel/3rdparty/perl/524/bin/perl -MO=C,-v,-oop/lexsub.c op/lexsub.t
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[verbose] NULL::save for sv = 0 called from (eval)

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff77d1e43 in Perl_Gv_AMupdate (stash=0x8fa160, destructing=false) at gv.c:2728
warning: Source file is more recent than executable.
2728                    HvNAME_HEK(CvNAMED(cv) ? CvSTASH(cv) : GvSTASH(CvGV(cv)));
(gdb) bt
#0  0x00007ffff77d1e43 in Perl_Gv_AMupdate (stash=0x8fa160, destructing=false) at gv.c:2728
#1  0x00007fffef8daebb in XS_B__HV_Gv_AMG (cv=0x77d750) at C.xs:395
#2  0x00007ffff7891e4f in Perl_pp_entersub () at pp_hot.c:3987
#3  0x00007ffff7883887 in Perl_runops_standard () at run.c:41
#4  0x00007ffff77c35dd in Perl_call_sv (sv=0x6b4140, flags=13) at perl.c:2809
#5  0x00007ffff77c8c33 in Perl_call_list (oldscope=1, paramList=0x6dd4b0) at perl.c:4988
#6  0x00007ffff77c12d9 in perl_parse (my_perl=0x603010, xsinit=0x400ff4 <xs_init>, argc=3, argv=0x7fffffffdcb8, env=0x0) at perl.c:1658
#7  0x0000000000400f47 in main (argc=3, argv=0x7fffffffdcb8, env=0x7fffffffdcd8) at perlmain.c:114

The CV has not the CvNAMED flag and no GV.. so calling STASH on it generate the SEGV

Flags value: 0xd = 13
Type:  13 - SVt_PVCV
(gdb) p CvGV(cv)
$4 = (GV *) 0x0