Bug 68788

Summary: really big playlists eventually exhaust available process filehandles
Product: [Retired] Red Hat Linux Reporter: James Cook <bonkabonka>
Component: mpg321Assignee: Bill Nottingham <notting>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-01-24 23:10:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch that cures the leak for me
none
A (possibly) more correct patch none

Description James Cook 2002-07-14 07:11:26 UTC
I have a primitive mp3 jukebox that runs 'mpg321 -o oss -z -@ big_honkin.m3u'
everything puts along just fine (for over two days actually) before I get a
message that there are no more filehandles available and it dumps out.

In the process of looking at that, I discovered the joys of the remote mode
which makes it even easier to find the problem.  'mpg321 -R -o oss dummy_param'
and then 'load'ing a couple of songs results in the following lsof snippet:

[reddirt@kiran reddirt]$ /usr/sbin/lsof | grep music
sh       1137 reddirt  255r   REG    3,2      49    32073
/home/reddirt/music_startup.sh
mpg123   1138 reddirt    3r   REG    3,9 7273485  2179082
/music/other/Suteki_da_ne_orchestral.mp3
mpg123   1138 reddirt    5r   REG    3,9 9556953  3604483
/music/various/exodus/02-my_will__dc_talk.mp3

While the music is playing, there is an additional copy of the mp3 open but
instead of 3r or 5r, it's tagged as mem (memory-mapped access I assume). 
Anyhow, I've worked around it by 'quit'ting out and restarting the process, but
I'd rather spawn the background process once and not have to do that.

Comment 1 James Cook 2002-07-14 07:43:19 UTC
Created attachment 65285 [details]
Patch that cures the leak for me

Comment 2 James Cook 2002-07-14 07:46:39 UTC
Just a comment about the above patch.  Works for me, but since I know nothing
about the subtleties of mmaping files it may be all kinds of b0rken.

Comment 3 James Cook 2002-07-14 08:04:49 UTC
Created attachment 65286 [details]
A (possibly) more correct patch

Comment 4 James Cook 2002-07-14 08:15:45 UTC
The second patch appears to be correct.  It behaves as I would expect it to
according to lsof and it is, to my mind at least, a less invasive patch.

Comment 5 Bill Nottingham 2003-01-24 23:10:22 UTC
At this point, we probably won't fix mpg321 bugs.