[KinoSearch] memory leak in KinoSearch::Util::BitVector (v .15)

Marvin Humphrey marvin at rectangular.com
Thu Aug 16 05:48:27 PDT 2007




On Aug 15, 2007, at 5:00 PM, Matthew Berk wrote:

> Just doing a bit of digging. Would adding sv_2mortal make a  
> difference?
>
> PPCODE:
>     out_av = Kino_BitVec_to_array(bit_vec);
>     /* XPUSHs(sv_2mortal(newRV_noinc( (SV*)out_av ))); */
>     XPUSHs(sv_2mortal(newRV_noinc( (SV*)out_av )));
>     XSRETURN(1);

This originally confused me, because the commented-out line is  
identical to the one that follows.  In the real text, though, the  
sv_2mortal is indeed missing.

     XPUSHs(newRV_noinc( (SV*)out_av ));

The Valgrind testing I do before each release did not pick this up. : 
(  Presumably Perl reclaims the leaked elements during global  
destruction, at least under PERL_DESTRUCT_LEVEL=2.

Your assessment and remedy are both correct, Matthew.  I am swamped  
right now, but I will release KS 0.16 with this fix when I get a  
moment.  Thank you.

Marvin Humphrey
Rectangular Research
http://www.rectangular.com/



_______________________________________________
KinoSearch mailing list
KinoSearch at rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch




More information about the kinosearch mailing list