nayakgi / perl-compiler

Automatically exported from code.google.com/p/perl-compiler
Other
0 stars 0 forks source link

t/CORE/op/smartkve.t lexwarn0 concat SEGV #322

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
One failing core test remaining:

perl5.14.4d-nt:
pcc -r -S -v3 -O3 -A t/CORE/op/smartkve.t -Dt

(/usr/local/lib/perl5/site_perl/5.14.3/x86_64-linux-debug/XSLoader.pm:29)   padsv(
$module)
(/usr/local/lib/perl5/site_perl/5.14.3/x86_64-linux-debug/XSLoader.pm:29)   const(
PV("::bootstrap"))
(/usr/local/lib/perl5/site_perl/5.14.3/x86_64-linux-debug/XSLoader.pm:29)   concat
Segmentation fault

0x000000000066f153 in Perl_pp_concat () at pp_hot.c:274
274     rpv = SvPV_nomg_const(right, rlen);
(gdb) p right
$1 = (SV *) 0x83b6a0 <lexwarn0>

Original issue reported on code.google.com by reini.urban on 8 May 2014 at 5:32

GoogleCodeExporter commented 9 years ago
SVOP::save for const produces a lexwarn as op->sv->save sometimes. corrupt 
symtable?
This may only happen for COP.cop_warnings

SVOP: const B::PV=SCALAR(0x3d61e80) => (SV*)lexwarn0 at blib/lib/B/C.pm line 
1564.
SVOP: const B::IV=SCALAR(0x3d62678) => (SV*)lexwarn0 at blib/lib/B/C.pm line 
1564.
SVOP: const B::PV=SCALAR(0x3d6e9b0) => (SV*)lexwarn0 at blib/lib/B/C.pm line 
1564.

Original comment by reini.urban on 8 May 2014 at 5:57

GoogleCodeExporter commented 9 years ago
Fixed by omitting objsym/savesym symtable caching for lexwarn syms.

It does not pollute lexwarn* with too many new syms, because we already cache 
those in lexwarnsym().

Fixed with commit 0ecb1a98ba848445da6dfc83600f0442f8f03271
Author: Reini Urban <rurban@cpanel.net>
Date:   Thu May 8 13:17:03 2014 -0500

    C: Fix wrong caching of internal LEXWARN symbols #322

    fixes t/CORE/op/smartkve.t regression and issue 322.

    we cached lexwarn syms twice, and the storage in the global symtable caused
    reproducible errors with t/CORE/op/smartkve.t for const->PV and ->IV as
    lexwarns, which caused a concat fail on the rhs lexwarn sym.  A lexwarn is
    no SV, it is just a special cop_warnings buffer.

Original comment by reini.urban on 8 May 2014 at 6:20