nayakgi / perl-compiler

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

reg_numbered_buff_fetch and more cause realloc on static PVs #269

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
e.g. with lc() in threaded perls

Original issue reported on code.google.com by reini.urban on 3 Jan 2014 at 5:26

GoogleCodeExporter commented 9 years ago
5.14.4 threaded: 
./ccode90i_c_3 => 19 0x00000000006183d0 in Perl_safesysrealloc ()
#20 0x000000000064a429 in Perl_sv_grow ()
---Type <return> to continue, or q <return> to quit---
#21 0x000000000064ca0b in Perl_sv_setpvn ()
#22 0x00000000005fcbf7 in Perl_reg_numbered_buff_fetch ()
#23 0x00000000006211fc in Perl_magic_get ()
#24 0x000000000061fde2 in Perl_mg_get ()
#25 0x00000000005db788 in Perl_try_amagic_bin ()
#26 0x0000000000636bf2 in Perl_pp_concat ()

./ccode71i_1 =>
#19 0x0000000000477570 in Perl_safesysrealloc ()
#20 0x00000000004a95c9 in Perl_sv_grow ()
---Type <return> to continue, or q <return> to quit---
#21 0x00000000004abbab in Perl_sv_setpvn ()
#22 0x000000000045bd97 in Perl_reg_numbered_buff_fetch ()
#23 0x000000000048039c in Perl_magic_get ()
#24 0x000000000047ef82 in Perl_mg_get ()
#25 0x00000000004c3430 in Perl_pp_lc ()

Original comment by reini.urban on 3 Jan 2014 at 5:30

GoogleCodeExporter commented 9 years ago
5.14.4 threaded more:
./ccode90i_ep_14 =>
#19 0x00000000004a82b0 in Perl_safesysrealloc ()
#20 0x00000000004da309 in Perl_sv_grow ()
---Type <return> to continue, or q <return> to quit---
#21 0x00000000004dc716 in Perl_sv_setpv ()
#22 0x00000000004b0ae5 in Perl_magic_get ()
#23 0x00000000004afcc2 in Perl_mg_get ()
#24 0x000000000046b668 in Perl_try_amagic_bin ()
#25 0x00000000004c6e0f in Perl_pp_eq ()

Original comment by reini.urban on 3 Jan 2014 at 5:31

GoogleCodeExporter commented 9 years ago
5.14.4 threaded more:
./ccode90i_ep_15 =>
#19 0x0000000000624560 in Perl_safesysrealloc ()
#20 0x00000000006565b9 in Perl_sv_grow ()
---Type <return> to continue, or q <return> to quit---
#21 0x00000000006589c6 in Perl_sv_setpv ()
#22 0x000000000062cd95 in Perl_magic_get ()
#23 0x000000000062bf72 in Perl_mg_get ()
#24 0x000000000065c957 in Perl_sv_2nv_flags ()
#25 0x00000000004c6518 in pp_main ()

Original comment by reini.urban on 3 Jan 2014 at 5:32

GoogleCodeExporter commented 9 years ago
Fixed with commit 6619aad7f9b2f62e9540203f81a4d5cac6d81ac3
Author: Reini Urban <rurban@cpanel.net>
Date:   Fri Jan 3 11:29:21 2014 -0600

    C: unify empty PVs to ptr_undef

    do not manually handle NULL vs &PL_sv_undef as this is already defined by ptr_undef.
    ptr_undef can always be initialized statically, so we can remove the init handling.
    This fixes #269 with threaded perls, the PV being initialized to &PL_sv_undef, which
    cannot be realloced.

Original comment by reini.urban on 3 Jan 2014 at 5:33