GNOME Bugzilla – Bug 640872
playbin2 crashes when changing volume
Last modified: 2011-03-31 23:54:40 UTC
Changing the volume in a playbin2 pipeline results in crashes. The elapsed time until the crash happens is random, usually ranges between seconds and few minutes. The attached test code uses pthreads to play an audio file, while changing the volume randomly. It segfaults after some seconds. Using playin instead of playbin2 in this code eliminates the crashes. Tested on the following configuration: Ubuntu 10.04 64 bits gstreamer 0.10.31 gstreamer-plugins-base 0.10.31 gstreamer-plugins-good 0.10.26 gstreamer-plugins-bad 0.10.20 gstreamer-plugins-ugly 0.10.16 Informal tests on Windows and OSX through the java bindings of gstreamer seem to indicate that the bug also affects these other platforms.
Created attachment 179566 [details] simple C code that generates the crash
Without a stack trace from the crash it's very hard to determine what caused it. Can you get us a stack trace? Please see http://live.gnome.org/GettingTraces for more information on how to do so. Thanks in advance! Also, new version of these modules have been released, you could try reproducing this with them. I've run your code for some minutes now and no crash (but I'm on 32 bits)
Created attachment 179578 [details] Stack trace from Java
I updated to the latest PPA gstreamer packages for Ubuntu: gstreamer 0.10.32 gstreamer-plugins-base 0.10.31 gstreamer-plugins-good 0.10.31 ... and installed the debug packages as well. But now I cannot get it to crash anymore (at least from C). What the test program still does is to hang, by this I mean: the playback just stops, while I can see the volume change thread still going, since I do a printf() every time the volume is set, and the messages continue to be printed out even there is no sound. I did another thing, but not sure if is very useful from you. I basically run the same test, playbin2 audio pipeline, from java, using the gstreamer-java bindings. All of this on the same system, so the underlying gstreamer libs are the same as in the C test. Here I get the crash, and a stack trace from JVM saying that the error happens in native code
Anyways, I attached the complete Java stack trace, it points to the following call in glib: C [libglib-2.0.so.0+0x5c3a4] g_slice_alloc+0x124
This is the same as... https://bugzilla.gnome.org/show_bug.cgi?id=639800 ...which links back to... http://groups.google.com/group/gstreamer-java/browse_thread/thread/8bfe93605068e10 ...containing more details of peoples' experiences and example code to recreate the crash in both Java and Python. There's a chance it's the same underlying cause as... https://bugs.meego.com/show_bug.cgi?id=6966 In both cases some builds experience it and others don't. Meego reports 20% of systems encounter the crash.
*** Bug 639800 has been marked as a duplicate of this bug. ***
Could you provide a stack trace (with glib+gstreamer debugging symbols) when using the C test case? Also, what's your GLib version?
Andres, ping, any update with respect to comment#8 ?
The C test case does not crash for me with latest releases and GIT when running for a long time.
I was able to get a segfault in C while playing a long audio file. But I did a small change in the test code, I use g_object_set_property() instead of g_object_set(), since the former is the function called from the java bindings. I'm adding the new test code as an attachment. I'm having some trouble getting the stack trace though. I installed all the dbg packages for gstreamer, and also the bug-buddy application. But when the application crashed, no bug report was automatically generated. Do I need to compile the test app including debug symbols? Note: I'm currently using pkg-config: gcc `pkg-config --cflags --libs gstreamer-0.10` voltest.c -o voltest
Created attachment 184763 [details] test with g_object_set_property to set volume
Run it in gdb to get a backtrace. gdb ./voltest run [wait until it crashes] thread apply all bt and then paste all the output here.
Here you go:
+ Trace 226516
Thread 5 (Thread 0x7fffe5b6b700 (LWP 2509))
Ah that one. Please use glib 2.26 or newer, earlier versions had a thread safety bug with property notifications.
Great! Indeed, I updated glib2 on my Linux system, and the problem disappeared. Just in case anyone find this useful, there is a PPA to update glib2 to 2.6 on Ubuntu Lucid (10.04), which uses 2.24: https://launchpad.net/~tspindler/+archive/glib-2.26-lucid Thanks for the followups.