develooper Front page | perl.perl5.porters | Postings from December 2017

Re: [perl #115814] open ${\$x} leaks

Thread Previous | Thread Next
Dave Mitchell
December 11, 2017 11:53
Re: [perl #115814] open ${\$x} leaks
Message ID:
On Sun, Dec 10, 2017 at 08:27:42PM -0800, Father Chrysostomos wrote:
> Well this one is my fault.  It’s a good thing I added a test!  Fixed in d269f58.

With v5.27.6-189-gd269f58, t/op/svleak.t is SEGVing on my system.
Reducing it to just the final test,

    leak 2,1,sub{XS::APItest::PerlIO_exportFILE(*STDIN,"");0},
                                      'T_STDIO in default typemap';

valgrind is giving me a whole bunch of:

    ==21957== Invalid read of size 4
    ==21957==    at 0x5C25FA0: fileno (in /usr/lib64/
    ==21957==    by 0x78811E: PerlIOStdio_fileno (perlio.c:2885)
    ==21957==    by 0x784D88: Perl_PerlIO_fileno (perlio.c:1391)
    ==21957==    by 0x7893F3: PerlIO_exportFILE (perlio.c:3742)
    ==21957==    by 0xD274D40: XS_XS__APItest_PerlIO_exportFILE (APItest.c:7295)
    ==21957==    by 0x5FCB2B: Perl_pp_entersub (pp_hot.c:5241)
    ==21957==    by 0x587203: Perl_runops_debug (dump.c:2495)
    ==21957==    by 0x46DBB2: S_run_body (perl.c:2717)
    ==21957==    by 0x46CF22: perl_run (perl.c:2633)
    ==21957==    by 0x41C356: main (perlmain.c:123)
    ==21957==  Address 0xd0a2730 is 0 bytes inside a block of size 552 free'd
    ==21957==    at 0x4C29D6A: free (in /usr/lib64/valgrind/
    ==21957==    by 0x5C1D9A2: fclose@@GLIBC_2.2.5 (in /usr/lib64/
    ==21957==    by 0x788E04: PerlIOStdio_close (perlio.c:3314)
    ==21957==    by 0x784C94: PerlIO__close (perlio.c:1365)
    ==21957==    by 0x784CE0: Perl_PerlIO_close (perlio.c:1378)
    ==21957==    by 0x720E89: Perl_io_close (doio.c:1523)
    ==21957==    by 0x49261A: Perl_gp_free (gv.c:2676)
    ==21957==    by 0x6399E5: Perl_sv_clear (sv.c:6765)
    ==21957==    by 0x63C348: Perl_sv_free2 (sv.c:7136)
    ==21957==    by 0x6A7791: S_SvREFCNT_dec_NN (inline.h:202)
    ==21957==    by 0x6A8170: Perl_free_tmps (scope.c:216)
    ==21957==    by 0x5DB002: Perl_pp_nextstate (pp_hot.c:52)

I haven't looked more closely.

In my day, we used to edit the inodes by hand.  With magnets.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About