All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Set CLOEXEC flag for pipes in PulseAudio plugins
@ 2011-09-26 16:09 Chris Rankin
  2011-09-27  7:54 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Rankin @ 2011-09-26 16:09 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 290 bytes --]

Hi,

I have noticed that Alsa / PulseAudio are leaking a couple of pipes after a 
fork/exec, and have traced the leak to the following two plugins:

libasound_module_ctl_pulse.so
libasound_module_pcm_pulse.so

This is with Fedora 15. I have attached a patch for the problem.

Cheers,
Chris

[-- Attachment #2: ALSA-PULSE-CLOEXEC.diff --]
[-- Type: text/x-patch, Size: 608 bytes --]

--- alsa-plugins-1.0.24.orig/pulse/pulse.c	2011-01-26 11:05:44.000000000 +0000
+++ alsa-plugins-1.0.24/pulse/pulse.c	2011-09-26 16:49:43.000000000 +0100
@@ -114,6 +114,10 @@
 	return fcntl(fd, F_SETFL, fl | O_NONBLOCK);
 }
 
+static int make_close_on_exec(int fd) {
+    return fcntl(fd, F_SETFD, FD_CLOEXEC);
+}
+
 snd_pulse_t *pulse_new(void)
 {
 	snd_pulse_t *p;
@@ -134,7 +138,9 @@
 	p->thread_fd = fd[1];
 
 	make_nonblock(p->main_fd);
+	make_close_on_exec(p->main_fd);
 	make_nonblock(p->thread_fd);
+	make_close_on_exec(p->thread_fd);
 
 	p->mainloop = pa_threaded_mainloop_new();
 	if (!p->mainloop)

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Set CLOEXEC flag for pipes in PulseAudio plugins
  2011-09-26 16:09 [PATCH] Set CLOEXEC flag for pipes in PulseAudio plugins Chris Rankin
@ 2011-09-27  7:54 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2011-09-27  7:54 UTC (permalink / raw)
  To: Chris Rankin; +Cc: alsa-devel

At Mon, 26 Sep 2011 17:09:24 +0100,
Chris Rankin wrote:
> 
> Hi,
> 
> I have noticed that Alsa / PulseAudio are leaking a couple of pipes after a 
> fork/exec, and have traced the leak to the following two plugins:
> 
> libasound_module_ctl_pulse.so
> libasound_module_pcm_pulse.so
> 
> This is with Fedora 15. I have attached a patch for the problem.

Thanks, applied now.


Takashi

> 
> Cheers,
> Chris
> [2 ALSA-PULSE-CLOEXEC.diff <text/x-patch (7bit)>]
> --- alsa-plugins-1.0.24.orig/pulse/pulse.c	2011-01-26 11:05:44.000000000 +0000
> +++ alsa-plugins-1.0.24/pulse/pulse.c	2011-09-26 16:49:43.000000000 +0100
> @@ -114,6 +114,10 @@
>  	return fcntl(fd, F_SETFL, fl | O_NONBLOCK);
>  }
>  
> +static int make_close_on_exec(int fd) {
> +    return fcntl(fd, F_SETFD, FD_CLOEXEC);
> +}
> +
>  snd_pulse_t *pulse_new(void)
>  {
>  	snd_pulse_t *p;
> @@ -134,7 +138,9 @@
>  	p->thread_fd = fd[1];
>  
>  	make_nonblock(p->main_fd);
> +	make_close_on_exec(p->main_fd);
>  	make_nonblock(p->thread_fd);
> +	make_close_on_exec(p->thread_fd);
>  
>  	p->mainloop = pa_threaded_mainloop_new();
>  	if (!p->mainloop)
> [3  <text/plain; us-ascii (7bit)>]
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-27  7:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-26 16:09 [PATCH] Set CLOEXEC flag for pipes in PulseAudio plugins Chris Rankin
2011-09-27  7:54 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.