Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 101059

Summary: pyvorbis-1.4 crashes due to closing a file descriptor twice
Product: Gentoo Linux Reporter: int19h <me>
Component: Current packagesAssignee: Python Gentoo Team <python>
Status: RESOLVED FIXED    
Severity: critical    
Priority: High    
Version: 2005.0   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 78194    
Attachments: pyvorbisfile.c.patch

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.