Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 101059 - pyvorbis-1.4 crashes due to closing a file descriptor twice
Summary: pyvorbis-1.4 crashes due to closing a file descriptor twice
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 78194
  Show dependency tree
 
Reported: 2005-08-01 21:35 UTC by int19h
Modified: 2005-11-13 16:26 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
pyvorbisfile.c.patch (pyvorbisfile.c.patch,564 bytes, patch)
2005-09-05 12:58 UTC, Ian Leitch (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description int19h 2005-08-01 21:35:18 UTC
OVERVIEW:

Instances of VorbisFile class in pyvorbis-1.4 close the file descriptor twice in 
destructor. This makes any applications which use pyvorbis to play Vorbis files 
(e.g. media-sound/quodlibet) unusable.

STEPS TO REPRODUCE:

$ python -c "import ogg.vorbis; ogg.vorbis.VorbisFile('foo.ogg')"

ACTUAL RESULTS:

Crashes and displays a "double free or corruption" glibc error message.

EXPECTED RESULTS:

No output, successful termination.

DETAILS:

See pyvorbisfile.c, line 195. A file descriptor is fclose'd in destructor, after 
calling ov_clear. However, libvorbis docs specifically state that any file 
descriptor passed to ov_open should be closed by ov_clear, and that fclose 
should not be used on it.

PROPOSED SOLUTION:

Remove the offending fclose call before compiling.
Comment 1 int19h 2005-09-01 01:37:32 UTC
Since pyvorbis-1.3 works fine as well, and 1.4 is broken badly, perhaps you 
could just as well hardmask 1.4.

Also see http://sacredchao.net/quodlibet/wiki/FAQ, second question under 
"General".
Comment 2 Ian Leitch (RETIRED) gentoo-dev 2005-09-05 12:58:07 UTC
Created attachment 67693 [details, diff]
pyvorbisfile.c.patch

I came across this problem and created a patch in bug #78194 (before seeing
this bug). My diagnosis was exactly the same as yours.

Please test and apply.
Comment 3 Ian Leitch (RETIRED) gentoo-dev 2005-09-16 05:36:24 UTC
Can we get this into CVS, please?
Comment 4 Ian Leitch (RETIRED) gentoo-dev 2005-11-13 09:58:17 UTC
In CVS.
Comment 5 Ian Leitch (RETIRED) gentoo-dev 2005-11-13 16:26:20 UTC
fixed.