Bug#389571: libvorbis-perl: 'make test' failure: double free or coruption

Niko Tyni ntyni at iki.fi
Tue Sep 26 13:54:33 UTC 2006


Package: libvorbis-perl
Version: 0.05-2
Severity: important

While preparing a new version of libvorbis-perl, I noticed the
following:

% make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl
ok 1
[...]
ok 12
*** glibc detected *** double free or corruption (!prev): 0x0816ab78 ***
make: *** [test_dynamic] Aborted

The tests aren't currently run from debian/rules, so this doesn't make
the package FTBFS.

It looks like quite a real problem, though. The open() method takes an
already open input filehandle, and the documentation says clear() must
be called for cleanup afterwards. Now, clear() just calls ov_clear() from
libvorbisfile, whose documentation [1] says that it will close the file.

Perl doesn't know that ov_clear() has closed the file, and when it
tries to close it (explicitly via close() or implicitly at the end of
the program), the result is a double free.

I'm not very experienced with XS programming; any help is welcome.
Is there a way to tell Perl that the filehandle is now closed and it
should forget it?

[1] /usr/share/doc/libvorbis-dev/html/vorbisfile/ov_clear.html

Cheers,
-- 
Niko Tyni	ntyni at iki.fi




More information about the pkg-perl-maintainers mailing list