libesd leaks pipe file descriptors

Bug #183411 reported by Allison Karlitskaya
88
This bug affects 2 people
Affects Status Importance Assigned to Milestone
esound (Ubuntu)
Fix Released
Undecided
Unassigned
Gutsy
Fix Released
Undecided
Allison Karlitskaya

Bug Description

my sister has been using her shiny new ubuntu system

i'm not sure what she does with it exactly, but after a while she gets "too many open files!" messages from nautilus

i tracked the problem down. pitti made an ubuntu vendor patch to esound to have it check for non-existent /usr/bin/esd and bypass a bunch of spawning code if it's not there.

unfortunately he also had it bypass the code to close the pipe file descriptors that had already been opened by this point.....

it's a pretty simple fix. will attach.

TEST CASE:

1) ensure that "Enable software sound mixing (ESD)" checkbox is enabled in "Sound Preferences" (this is the default)

2) ensure that the 'esound' package is not installed (this is also the default)

3) ensure "preview sound files" is enabled in nautilus preferences (also the default)

3) open a terminal

4) $ cd /proc/`pidof nautilus`/fd

5) 'ls' and notice a small number of 'pipe' entries

6) open a folder with a bunch of ogg vorbis files in it and move the mouse around a lot, moving over top of various sound files (as if you would when you are trying to preview them).

7) 'ls' again and notice that the number of 'pipe' entries has increased

8) notice that once nautilus has 1024 open file descriptors further attempts to open folders (or anything else) in nautilus will fail.

Revision history for this message
Allison Karlitskaya (desrt) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package esound - 0.2.38-0ubuntu6

---------------
esound (0.2.38-0ubuntu6) hardy; urgency=low

  * esdlib.c: The previous patch leaks pipe file descriptors in the case
    that /usr/bin/esd doesn't exist. Fix that bug by only opening the
    pipes after we know that the esd executable exists (LP: #183411).

 -- Ryan Lortie <email address hidden> Tue, 15 Jan 2008 22:08:19 -0500

Changed in esound:
status: New → Fix Released
Revision history for this message
Max-Ulrich Farber (maxulrichfarber) wrote :

If I understand well, this bug appears in Feisty only because esound-common is installed as default, but esound is not. I suppose that there are dependencies forbidding esound-common to be removed. Is it a good workaround for Feisty to install esound as well from the repositories and to let everything else unchanged?

Revision history for this message
Max-Ulrich Farber (maxulrichfarber) wrote :

Sorry, I mean Gutsy (Ubuntu 7.10) and not Feisty!

Revision history for this message
John McCain (mccainj) wrote :

I can confirm that the workaround (installing esound) corrects the problem. Thanks.

Revision history for this message
Allison Karlitskaya (desrt) wrote :

Since we have confirmation that this is the root cause of the problem we should probably upload this one to gutsy...

Revision history for this message
Max-Ulrich Farber (maxulrichfarber) wrote :

There is still something that I can't understand: The bug appears in Gutsy because in Gutsy esound is not installed as default. How can a fix in the package esound solve a problem that only happenes when just this package is not installed?
A real fix for this bug can't be done in the package esound...

Revision history for this message
Allison Karlitskaya (desrt) wrote :

The 'esound' source package ships multiple binary packages.

The 'esound' binary package isn't installed by default, but the 'libesd-alsa0' package (built from the same source package) is depended on by nautilus and many many other things.

The fix in this patch effects code that ends up in the libesd-alsa0 package (and is therefore installed by default).

Revision history for this message
Max-Ulrich Farber (maxulrichfarber) wrote :

I looked at the description of esound in the readme file inside esound-common:

"... However, it is part of the GNOME platform (for a little while longer), so we slavishly continue to maintain it."

There seem to be dependences why esound can't simply be taken out, as it has been done in Gutsy... I think that is the root cause of the problem.

Revision history for this message
Max-Ulrich Farber (maxulrichfarber) wrote :

@ Ryan Lortie:

Sorry, I had not yet read your notice when I posted mine. Now I understand better, thanks!

Revision history for this message
William Pitcock (nenolod) wrote : Re: [Bug 183411] Re: libesd leaks pipe file descriptors

GNOME only depends on libesd, not on the daemon itself.

On Wed, 2008-01-16 at 20:55 +0000, Max-Ulrich Farber wrote:
> I looked at the description of esound in the readme file inside esound-
> common:
>
> "... However, it is part of the GNOME platform (for a little while
> longer), so we slavishly continue to maintain it."
>
> There seem to be dependences why esound can't simply be taken out, as it
> has been done in Gutsy... I think that is the root cause of the problem.
>

Revision history for this message
Max-Ulrich Farber (maxulrichfarber) wrote :

Ryan Lortie wrote:
Since we have confirmation that this is the root cause of the problem we should probably upload this one to gutsy...

That would be fine! Thanks!

Revision history for this message
Martin Pitt (pitti) wrote :

Sponsored and accepted into gutsy-proposed:
 esound (0.2.38-0ubuntu4.1) gutsy-proposed; urgency=low
 .
   * esdlib.c: The previous patch leaks pipe file descriptors in the case
     that /usr/bin/esd doesn't exist. Fix that bug by only opening the
     pipes after we know that the esd executable exists (LP: #183411).

Ryan, please add a TEST CASE: to the description, as per SRU policy. Thanks!

Changed in esound:
assignee: nobody → desrt
status: New → Fix Committed
description: updated
Revision history for this message
Martin Pitt (pitti) wrote :

This has been in -proposed for three months now. Any testers? Anyone who can confirm that it does not cause regressions?

Revision history for this message
Steve Beattie (sbeattie) wrote :

I was able to reproduce the nautilus file descriptor leak problem using libesd-alsa0/esound-common 0.2.38-0ubuntu4 in gutsy. I can confirm that the packages in gutsy-proposed, libesd-alsa0/esound-common 0.2.38-0ubuntu4.1, addresses the issue; nautilus no longer leaks file descriptors. I was also able to continue playing audio from rhythmbox, totem, and firefox/flash-nonfree, as well as the audio component of videos. I also installed esd, restarted the desktop, and verified that esd was running and that sound still worked.

Thanks!

Revision history for this message
Steve Beattie (sbeattie) wrote :

Oh, one additional note: despite having previews enabled for all audio files within nautilus, neither of the versions produced any sound while mousing over music files (ogg or mp3), which I would have expected from an attempted preview. I wasn't sure what the expected behavior there is, but at least with the update in gutsy-proposed, nautilus will not stop stop working if the user happens to mouse over many music files.

Revision history for this message
Martin Pitt (pitti) wrote :

Hi Steve,

thanks for verifying!

Steve Beattie [2008-08-05 18:30 -0000]:
> Oh, one additional note: despite having previews enabled for all audio
> files within nautilus, neither of the versions produced any sound while
> mousing over music files (ogg or mp3)

This requires to have mpg321 and ogg123 installed, at least it was
like that in earlier GNOME releases. Ideally nautilus would use
gst-launch for that, not calling command line tools.

Revision history for this message
Martin Pitt (pitti) wrote :

Copied to gutsy-updates.

Changed in esound:
status: Fix Committed → Fix Released
Revision history for this message
Ivan Lautaro Lemos (ivancete) wrote :

This happen in 7.10, and 8.04, in Ubuntu, xubuntu, kubuntu, edubuntu, etc...

We need a solution now
Because when attach a usb mp3/mp4 drive, Ubuntu PRrrrrr chaaaaa, and now was nothing to can make, and reset button is the next way.
Disable the sound previews, or something... , thats sometimes works.... But it is not a really solution.......

What is the solution? i don't understand, sorry
Thanks

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.