Bug 470000 - gstreamer + pulse leaking threads on sound output (pidgin crash)
Summary: gstreamer + pulse leaking threads on sound output (pidgin crash)
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: gstreamer-plugins-good
Version: 10
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Lennart Poettering
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 475119 476494 477594 (view as bug list)
Depends On:
Blocks: F11Blocker, F11FinalBlocker 471856
TreeView+ depends on / blocked
 
Reported: 2008-11-05 07:00 UTC by Yolkfull Chow
Modified: 2009-02-06 09:25 UTC (History)
12 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-01-24 02:39:28 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
GDB output (56.99 KB, text/plain)
2008-12-03 15:46 UTC, Danny Baumann
no flags Details
Tets tool (1.60 KB, text/plain)
2008-12-03 20:09 UTC, Danny Baumann
no flags Details
backtrace from pidgin (9.98 KB, text/plain)
2008-12-16 01:27 UTC, Stephen Thorne
no flags Details
backtrace from pidgin-bugreport.txt (35.15 KB, text/plain)
2009-01-15 04:39 UTC, Yolkfull Chow
no flags Details

Description Yolkfull Chow 2008-11-05 07:00:24 UTC
Description of problem:
Following are the info collected by bug-buddy:
-----------
System: Linux 2.6.27.4-68.fc10.i686 #1 SMP Thu Oct 30 00:49:42 EDT 2008 i686
X Vendor: The X.Org Foundation
X Vendor Release: 10502000
Selinux: No
Accessibility: Disabled
GTK+ Theme: Nodoka
Icon Theme: Fedora

Memory status: size: 2960982016 vsize: 2960982016 resident: 51773440 share: 24920064 rss: 51773440 rss_rlim: 18446744073709551615
CPU usage: start_time: 1225847969 rtime: 6704 utime: 5428 stime: 1276 cutime:15 cstime: 63 timeout: 0 it_real_value: 0 frequency: 100

Backtrace was generated from '/usr/bin/pidgin'

0x00110416 in __kernel_vsyscall ()
#0  0x00110416 in __kernel_vsyscall ()
#1  0x005ce777 in poll () from /lib/libc.so.6
#2  0x00727742 in ?? () from /lib/libglib-2.0.so.0
#3  0x00727dd2 in g_main_loop_run () from /lib/libglib-2.0.so.0
#4  0x058cc489 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#5  0x080c6b86 in main (argc=1, argv=0xbffdf884) at gtkmain.c:888
The program is running.  Quit anyway (and detach it)? (y or n) [answered Y; input not from terminal]


----------- .xsession-errors ---------------------
warning: difference appears to be caused by prelink, adjusting expectations
(firefox:7163): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
(firefox:7163): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
(firefox:7163): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
(firefox:7163): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
(firefox:7163): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
(firefox:7163): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
(firefox:7163): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
--------------------------------------------------

Version-Release number of selected component (if applicable):
pidgin-2.5.2-1.fc10.i386

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Yolkfull Chow 2008-11-05 07:24:31 UTC
Crash secondly:

--------
System: Linux 2.6.27.4-68.fc10.i686 #1 SMP Thu Oct 30 00:49:42 EDT 2008 i686
X Vendor: The X.Org Foundation
X Vendor Release: 10502000
Selinux: No
Accessibility: Disabled
GTK+ Theme: Nodoka
Icon Theme: Fedora

Memory status: size: 3026124800 vsize: 3026124800 resident: 54812672 share: 24596480 rss: 54812672 rss_rlim: 18446744073709551615
CPU usage: start_time: 1225867782 rtime: 2245 utime: 1917 stime: 328 cutime:4 cstime: 17 timeout: 0 it_real_value: 0 frequency: 100

Backtrace was generated from '/usr/bin/pidgin'

0x00110416 in __kernel_vsyscall ()
#0  0x00110416 in __kernel_vsyscall ()
#1  0x005ce777 in poll () from /lib/libc.so.6
#2  0x00727742 in ?? () from /lib/libglib-2.0.so.0
#3  0x00727dd2 in g_main_loop_run () from /lib/libglib-2.0.so.0
#4  0x058cc489 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#5  0x080c6b86 in main (argc=1, argv=0xbf92a9d4) at gtkmain.c:888
The program is running.  Quit anyway (and detach it)? (y or n) [answered Y; input not from terminal]


----------- .xsession-errors ---------------------
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
E: shm.c: mmap() failed: Cannot allocate memory
pidgin: pulse.c:203: pulse_new: Assertion `p->context' failed.
--------------------------------------------------

Comment 2 Yolkfull Chow 2008-11-05 09:25:35 UTC
It has crashed the third time, the same backtrace output with the second time.

Comment 3 Stu Tomlinson 2008-11-05 17:11:30 UTC
The backtrace doesn't show anything useful at all. Please install relevant debuginfo with "debuginfo-install pidgin".

> pidgin: pulse.c:203: pulse_new: Assertion `p->context' failed.

This looks like it may be crashing in pulse when trying to play a sound - if you disable sounds does it stop crashing?

Also what protocols and plugins do you use?

Comment 4 Bug Zapper 2008-11-26 04:48:06 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Danny Baumann 2008-12-03 15:45:52 UTC
This almost for sure is either a a pulseaudio or gstreamer problem. Pidgin seems to leak two threads per played sound, until the point no stack is left for new threads. Will attach a backtrace that shows pidgin having 72 threads after a few hours of use.

FWIW, I'm using ICQ, MSN, IRC protocols and only stock pidgin plugins, but I think the issue is clear. I don't know though whether the actual issue is in pidgin, gstreamer or pulseaudio, although I suspect the latter.

Comment 6 Danny Baumann 2008-12-03 15:46:42 UTC
Created attachment 325549 [details]
GDB output

GDB output showing pidgin having an insane number of threads

Comment 7 Danny Baumann 2008-12-03 15:52:30 UTC
FWIW, package versions:
pidgin-2.5.2-1.fc10.i386
gstreamer-0.10.21-2.fc10.i386
pulseaudio-0.9.13-6.fc10.i386

Comment 8 Warren Togami 2008-12-03 16:14:56 UTC
Danny, could you please test this:
1) rpm -qa 'pulseaudio* alsa-plugins-pulseaudio'
   Note everything here so you can reinstall it later.
2) Un-install all of those RPMS.
3) Reboot.
4) Log into your desktop.  It should be outputting all sound directly to the ALSA device.
5) Redo your pidgin tests.

Does sound work?  Does it still leak threads?

Comment 9 Warren Togami 2008-12-03 17:53:43 UTC
Danny, here is an alternate test.  Have it use aplay command instead of gstreamer for sound output.  Does the problem go away?

Please try both of these tests and report back.

http://developer.pidgin.im/ticket/7519
This bug is likely the same mentioned here.  Upstream pidgin considers this to be a gstreamer problem and not their fault.

Comment 10 Warren Togami 2008-12-03 18:04:17 UTC
Danny was this an issue in F9 as well?

Comment 11 Danny Baumann 2008-12-03 19:49:59 UTC
(In reply to comment #9)
> Danny, here is an alternate test.  Have it use aplay command instead of
> gstreamer for sound output.  Does the problem go away?
> 
> Please try both of these tests and report back.

I didn't try those yet, but I wrote an exceedingly simple test program which basically is some copy'n'paste from pidgin. It leaks threads, too, so at least we have a very simple test case. It plays a wav file each 5 seconds, and per play 5 threads are started and only one is closed.
Will attach the test tool to this bug.

> http://developer.pidgin.im/ticket/7519
> This bug is likely the same mentioned here.  Upstream pidgin considers this to
> be a gstreamer problem and not their fault.

Looks like they're right.

Comment 12 Danny Baumann 2008-12-03 20:09:36 UTC
Created attachment 325586 [details]
Tets tool

Compile with 
gcc -o test `pkg-config --cflags --libs gstreamer-0.10 glib-2.0` test.c

Doesn't leak any threads anymore after adding a proper glib main loop integration...can anyone confirm?

Comment 13 Danny Baumann 2008-12-03 20:10:24 UTC
(In reply to comment #10)
> Danny was this an issue in F9 as well?

Not that I'm aware of. At least pidgin did never crash for me.

Comment 14 Warren Togami 2008-12-03 20:12:48 UTC
> Doesn't leak any threads anymore after adding a proper glib main loop
> integration...can anyone confirm?

What exactly does this mean to your test.c?

Comment 15 Danny Baumann 2008-12-03 20:14:39 UTC
(In reply to comment #12)
> Created an attachment (id=325586) [details]
> Tets tool
> 
> Compile with 
> gcc -o test `pkg-config --cflags --libs gstreamer-0.10 glib-2.0` test.c
> 
> Doesn't leak any threads anymore after adding a proper glib main loop
> integration...can anyone confirm?

Bah, I spoke too soon. I just noticed that gstreamer was configured to use ALSA for me, so it's the expected behaviour to not leak threads (per play attempt, 5 threads are started and ended). Reconfiguring gstreamer to use pulseaudio directly results in thread leak (6 threads are started, 5 are shut down).

Comment 16 Danny Baumann 2008-12-03 20:15:11 UTC
(In reply to comment #14)
> > Doesn't leak any threads anymore after adding a proper glib main loop
> > integration...can anyone confirm?
> 
> What exactly does this mean to your test.c?

My first version of test.c didn't have glib main loop integration ;-)
Sorry for the confusion.

Comment 17 Warren Togami 2008-12-03 22:48:48 UTC
#gstreamer says that this is likely a bug in libgstpulse.  It came from an independent gstreamer-plugins-pulse in F-9, and it was later merged into gstreamer-plugins-good for F-10.  I tried building gstreamer-plugins-pulse on F-10, but it is incompatible as sound coming through it is completely garbled.  We probably need Lennart to fix this.

Comment 18 Warren Togami 2008-12-15 18:00:52 UTC
*** Bug 476494 has been marked as a duplicate of this bug. ***

Comment 19 Stephen Thorne 2008-12-16 01:27:34 UTC
Created attachment 327050 [details]
backtrace from pidgin

I too have had problems with this, and I have attached a traceback that I got out of gdb.

I have changed from Pidgin's setting of 'Automatic' for the audio device to 'ALSA', and the problem has not reoccurred.

Comment 20 Warren Togami 2008-12-16 01:45:09 UTC
More backtraces of pidgin will not be helpful.  This is clearly a problem in gstreamer's pulseaudio sink or pulseaudio.

Comment 21 Lennart Poettering 2008-12-17 22:28:35 UTC
*** Bug 475119 has been marked as a duplicate of this bug. ***

Comment 22 Stu Tomlinson 2008-12-22 11:14:29 UTC
*** Bug 477594 has been marked as a duplicate of this bug. ***

Comment 23 Jonathan Matthew 2008-12-29 09:56:57 UTC
This problem occurs when using the gstreamer alsa sink with the pulseaudio alsa plugin as well as when using the gstreamer pulseaudio sink, so either the same bug exists in both places, or the bug is in the pulseaudio libraries.

Comment 24 Rodd Clarkson 2008-12-30 20:04:45 UTC
I've been having problems in rhythmbox and the developer suggested that the crashed were most likely pa related and that this bug in particular looked to be similar.

I've file a few backtraces at b.g.o and the main bug can be viewed here: http://bugzilla.gnome.org/show_bug.cgi?id=565844

Comment 25 Lennart Poettering 2009-01-14 13:37:54 UTC
This is not a PA bug. The GSTreamer folks broke the PA plugin for GStreamer by adding a borked "probe" interface implementation to it. The bad commit is this:

http://webcvs.freedesktop.org/gstreamer/gst-plugins-good/ext/pulse/pulsesink.c?r1=1.3&r2=1.4

It creates a reference loop between the probe object and the sink object.

I am working on a fix.

Comment 26 Lennart Poettering 2009-01-14 13:50:41 UTC
I've posted this note upstream. 

http://bugzilla.gnome.org/show_bug.cgi?id=567746a

Comment 27 Lennart Poettering 2009-01-14 13:51:20 UTC
bah, fixed url is:

http://bugzilla.gnome.org/show_bug.cgi?id=567746

Comment 28 Lennart Poettering 2009-01-14 14:58:29 UTC
Ok, got a preliminary blessing for my patch from the gst folks.

I have now added this patch to the rawhide packages. We can push this into F-10 too after some testing. So, please try out the fixed rawhide packages.

Fixed in 0.10.11-3.

Comment 29 Warren Togami 2009-01-15 03:38:14 UTC
http://kojipkgs.fedoraproject.org/packages/gstreamer-plugins-good/0.10.11/
Everyone, please test the latest fc10 build here and report back.

Comment 30 Yolkfull Chow 2009-01-15 04:39:13 UTC
Created attachment 329062 [details]
backtrace from pidgin-bugreport.txt

Seems still crash:

...
Detaching after fork from child process 7921.
Detaching after fork from child process 7922.
Detaching after fork from child process 7923.
Detaching after fork from child process 7924.
Detaching after fork from child process 7925.
Detaching after fork from child process 7926.
Detaching after fork from child process 7927.

Program received signal SIGSEGV, Segmentation fault.
0x012bf109 in ?? () from /usr/lib/purple-2/autoprofile.so
(gdb) thread apply all backtrace

Thread 1 (Thread 0xb7fce750 (LWP 7908)):
#0  0x012bf109 in ?? () from /usr/lib/purple-2/autoprofile.so
#1  0x07185e06 in ?? () from /lib/libglib-2.0.so.0
#2  0x071856d8 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#3  0x07188d83 in ?? () from /lib/libglib-2.0.so.0
#4  0x071892a2 in g_main_loop_run () from /lib/libglib-2.0.so.0
#5  0x07352459 in IA__gtk_main () at gtkmain.c:1200
#6  0x080c705e in main ()
(gdb)

---------
$ rpm -qa *pidgin* *gstreamer* *pulseaudio*
xine-lib-pulseaudio-1.1.15-3.fc10.i386
pulseaudio-libs-0.9.13-6.fc10.i386
pulseaudio-esound-compat-0.9.13-6.fc10.i386
gstreamer-plugins-farsight-0.12.9-3.fc10.i386
gstreamer-plugins-base-0.10.21-2.fc10.i386
pulseaudio-libs-glib2-0.9.13-6.fc10.i386
gstreamer-python-0.10.12-1.fc10.i386
pulseaudio-core-libs-0.9.13-6.fc10.i386
gstreamer-plugins-good-0.10.11-4.fc11.i386
PackageKit-gstreamer-plugin-0.3.12-1.fc10.i386
pulseaudio-module-x11-0.9.13-6.fc10.i386
gstreamer-0.10.21-2.fc10.i386
alsa-plugins-pulseaudio-1.0.18-2.fc10.i386
gstreamer-plugins-flumpegdemux-0.10.15-4.fc10.i386
pulseaudio-module-gconf-0.9.13-6.fc10.i386
gstreamer-debuginfo-0.10.21-2.fc10.i386
gstreamer-tools-0.10.21-2.fc10.i386
kde-settings-pulseaudio-4.1-4.20081031svn.fc10.noarch
totem-gstreamer-2.24.3-1.fc10.i386
pulseaudio-utils-0.9.13-6.fc10.i386
pulseaudio-0.9.13-6.fc10.i386

Comment 31 Stu Tomlinson 2009-01-15 14:27:34 UTC
(In reply to comment #30)
> Created an attachment (id=329062) [details]
> backtrace from pidgin-bugreport.txt
> 
> Seems still crash:

This is a completely different crash, this time it is caused by the "autoprofile" plugin. Please file a separate bug report, against the correct component (autoprofile plugin comes from purple-plugin_pack srpm).
 
> Thread 1 (Thread 0xb7fce750 (LWP 7908)):
> #0  0x012bf109 in ?? () from /usr/lib/purple-2/autoprofile.so
> #1  0x07185e06 in ?? () from /lib/libglib-2.0.so.0
> #2  0x071856d8 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
> #3  0x07188d83 in ?? () from /lib/libglib-2.0.so.0
> #4  0x071892a2 in g_main_loop_run () from /lib/libglib-2.0.so.0
> #5  0x07352459 in IA__gtk_main () at gtkmain.c:1200
> #6  0x080c705e in main ()
> (gdb)

Comment 32 Fedora Update System 2009-01-15 18:00:41 UTC
gstreamer-plugins-good-0.10.11-4.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/gstreamer-plugins-good-0.10.11-4.fc10

Comment 33 Fedora Update System 2009-01-16 23:46:59 UTC
gstreamer-plugins-good-0.10.11-4.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update gstreamer-plugins-good'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-0659

Comment 34 Fedora Update System 2009-01-24 02:39:18 UTC
gstreamer-plugins-good-0.10.11-4.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 35 Robin Green 2009-02-06 09:25:00 UTC
I am still seeing what looks like this problem in rawhide with:

gstreamer-plugins-good-0.10.13-2.fc11.i386
pidgin-2.5.4-2.fc11.i386
pulseaudio-0.9.14-2.fc11.i386


Note You need to log in before you can comment on or make changes to this bug.