nayakgi / perl-compiler

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

global destruction -O3 CC 5.8: test 22 free xpvio #303

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
on 5.8 t/testcc.sh 22 46 fail in global destruction
in Perl_sv_clean_objs freeing a static xpvio of the FileHandle objects.
We need to protect them somehow, see Perl_sv_clear()

we can change the type to TYPEMASK e.g.

#0  0x00007ffff6f59474 in __GI___libc_free (mem=0x8008c0 <xpvio_list>) at 
malloc.c:2906
#1  0x00007ffff7efc606 in Perl_safesysfree (where=0x8008c0 <xpvio_list>) at 
util.c:154
#2  0x00007ffff7f2faa5 in Perl_sv_clear (sv=0x800bb0 <sv_list+80>) at sv.c:5348
#3  0x00007ffff7f2fca9 in Perl_sv_free (sv=0x800bb0 <sv_list+80>) at sv.c:5429
#4  0x00007ffff7ea01ea in Perl_gp_free (gv=0x8393f0) at gv.c:1343
#5  0x00007ffff7f2f7a3 in Perl_sv_clear (sv=0x8393f0) at sv.c:5253
#6  0x00007ffff7f2fca9 in Perl_sv_free (sv=0x8393f0) at sv.c:5429
#7  0x00007ffff7f22d23 in do_clean_named_objs (sv=0x8393f0) at sv.c:448
#8  0x00007ffff7f229dc in S_visit (f=0x7ffff7f22b5c <do_clean_named_objs>, 
flags=13, mask=255)
    at sv.c:368
#9  0x00007ffff7f22d5f in Perl_sv_clean_objs () at sv.c:469
#10 0x000000000054ad14 in fast_perl_destruct (my_perl=0x81f010) at 
cccode22.c:117430
#11 0x000000000054b5e0 in main (argc=1, argv=0x7fffffffe8a8, env=0x7fffffffe8b8)
    at cccode22.c:117594

Original issue reported on code.google.com by reini.urban on 19 Feb 2014 at 1:56

GoogleCodeExporter commented 9 years ago
Fixed with 1.45_05

commit 205fbbcae2f461197a960e4d9a7a5b31f5f0574e
Author: Reini Urban <rurban@cpanel.net>
Date:   Wed Feb 19 09:20:13 2014 -0600

    C 1.43_05: Special-case io_close() on -O3 or B::CC for 5.8 (#303)

    add my_io_close to @static_free on 5.8 and blessed filehandles
    to close the static file or dir before sv_clean_objs() tries to free the static xpvio.
    Fixes testcc 22

Original comment by reini.urban on 19 Feb 2014 at 3:20

GoogleCodeExporter commented 9 years ago

Original comment by reini.urban on 19 Feb 2014 at 4:15

GoogleCodeExporter commented 9 years ago

Original comment by reini.urban on 19 Feb 2014 at 4:15