After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 640872 - playbin2 crashes when changing volume
playbin2 crashes when changing volume
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.31
Other Linux
: High critical
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 639800 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-01-29 00:40 UTC by Andres Colubri
Modified: 2011-03-31 23:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
simple C code that generates the crash (2.26 KB, text/x-csrc)
2011-01-29 00:42 UTC, Andres Colubri
Details
Stack trace from Java (52.53 KB, text/x-log)
2011-01-29 08:10 UTC, Andres Colubri
Details
test with g_object_set_property to set volume (2.75 KB, text/x-csrc)
2011-03-31 06:09 UTC, Andres Colubri
Details

Description Andres Colubri 2011-01-29 00:40:32 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.
Comment 1 Andres Colubri 2011-01-29 00:42:11 UTC
Created attachment 179566 [details]
simple C code that generates the crash
Comment 2 Thiago Sousa Santos 2011-01-29 04:38:41 UTC
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)
Comment 3 Andres Colubri 2011-01-29 08:10:32 UTC
Created attachment 179578 [details]
Stack trace from Java
Comment 4 Andres Colubri 2011-01-29 08:11:29 UTC
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
Comment 5 Andres Colubri 2011-01-29 08:13:56 UTC
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
Comment 6 Cefn Hoile 2011-02-12 12:04:55 UTC
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.
Comment 7 Cefn Hoile 2011-02-12 17:01:08 UTC
*** Bug 639800 has been marked as a duplicate of this bug. ***
Comment 8 Tim-Philipp Müller 2011-02-12 17:10:38 UTC
Could you provide a stack trace (with glib+gstreamer debugging symbols) when using the C test case?

Also, what's your GLib version?
Comment 9 Akhil Laddha 2011-03-30 04:39:01 UTC
Andres, ping, any update with respect to comment#8 ?
Comment 10 Sebastian Dröge (slomo) 2011-03-30 08:07:09 UTC
The C test case does not crash for me with latest releases and GIT when running for a long time.
Comment 11 Andres Colubri 2011-03-31 06:07:53 UTC
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
Comment 12 Andres Colubri 2011-03-31 06:09:11 UTC
Created attachment 184763 [details]
test with g_object_set_property to set volume
Comment 13 Sebastian Dröge (slomo) 2011-03-31 08:01:21 UTC
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.
Comment 14 Andres Colubri 2011-03-31 14:42:57 UTC
Here you go:

Thread 5 (Thread 0x7fffe5b6b700 (LWP 2509))

  • #0 ??
  • #1 g_object_notify_queue_thaw
    at /build/buildd/glib2.0-2.24.1/gobject/gobjectnotifyqueue.c line 120
  • #2 IA__g_object_notify
    at /build/buildd/glib2.0-2.24.1/gobject/gobject.c line 888
  • #3 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.24.1/gobject/gclosure.c line 767
  • #4 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.24.1/gobject/gsignal.c line 3248
  • #5 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.24.1/gobject/gsignal.c line 2981
  • #6 IA__g_signal_emit
    at /build/buildd/glib2.0-2.24.1/gobject/gsignal.c line 3038
  • #7 g_object_dispatch_properties_changed
  • #8 gst_object_dispatch_properties_changed
    at gstobject.c line 526
  • #9 g_object_notify_queue_thaw
    at /build/buildd/glib2.0-2.24.1/gobject/gobjectnotifyqueue.c line 120
  • #10 IA__g_object_notify
    at /build/buildd/glib2.0-2.24.1/gobject/gobject.c line 888
  • #11 notify_volume_cb
    at gstplaysink.c line 1611
  • #12 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.24.1/gobject/gclosure.c line 767
  • #13 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.24.1/gobject/gsignal.c line 3248
  • #14 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.24.1/gobject/gsignal.c line 2981
  • #15 IA__g_signal_emit
    at /build/buildd/glib2.0-2.24.1/gobject/gsignal.c line 3038
  • #16 g_object_dispatch_properties_changed
    at /build/buildd/glib2.0-2.24.1/gobject/gobject.c line 801
  • #17 gst_object_dispatch_properties_changed
    at gstobject.c line 526
  • #18 g_object_notify_queue_thaw
    at /build/buildd/glib2.0-2.24.1/gobject/gobjectnotifyqueue.c line 120
  • #19 IA__g_object_notify
    at /build/buildd/glib2.0-2.24.1/gobject/gobject.c line 888
  • #20 gst_pulseringbuffer_commit
    at pulsesink.c line 1280
  • #21 gst_base_audio_sink_render
    at gstbaseaudiosink.c line 1641
  • #22 gst_base_sink_render_object
    at gstbasesink.c line 2875
  • #23 gst_base_sink_queue_object_unlocked
    at gstbasesink.c line 3156
  • #24 gst_base_sink_chain_unlocked
    at gstbasesink.c line 3531
  • #25 gst_base_sink_chain_main
    at gstbasesink.c line 3569
  • #26 gst_pad_push
    at gstpad.c line 4665
  • #27 gst_pad_push
    at gstpad.c line 4665
  • #28 gst_base_transform_chain
    at gstbasetransform.c line 2383
  • #29 gst_pad_push
    at gstpad.c line 4665
  • #30 gst_base_transform_chain
    at gstbasetransform.c line 2383
  • #31 gst_pad_push
    at gstpad.c line 4665
  • #32 gst_queue_push_one
    at gstqueue.c line 1137
  • #33 gst_queue_loop
    at gstqueue.c line 1245
  • #34 gst_task_func
    at gsttask.c line 318
  • #35 g_thread_pool_thread_proxy
  • #36 g_thread_create_proxy
    at /build/buildd/glib2.0-2.24.1/glib/gthread.c line 1893
  • #37 start_thread
    at pthread_create.c line 300
  • #38 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 112
  • #39 ??

Comment 15 Sebastian Dröge (slomo) 2011-03-31 14:49:39 UTC
Ah that one. Please use glib 2.26 or newer, earlier versions had a thread safety bug with property notifications.
Comment 16 Andres Colubri 2011-03-31 23:54:40 UTC
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.