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 554460 - thumbnailer crash in gst_fake_sink_event() on FLUSH_START event
thumbnailer crash in gst_fake_sink_event() on FLUSH_START event
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.10.x
Other Linux
: Normal critical
: 0.10.24
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-09-30 15:45 UTC by Pedro Villavicencio
Modified: 2009-05-31 19:11 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
hack around g_object_notify() crasher bug by taking the STREAM_LOCK for out of band events in gst_fake_sink_event() (7.25 KB, patch)
2009-05-31 14:14 UTC, Tim-Philipp Müller
rejected Details | Review

Description Pedro Villavicencio 2008-09-30 15:45:09 UTC
this report has been filed here:

https://bugs.edge.launchpad.net/ubuntu/+source/gstreamer0.10/+bug/275168

".

Comment 1 Tim-Philipp Müller 2009-02-12 11:49:15 UTC
Not sure what to make of this. So it apparently crashes in gst_fake_sink_event() when getting an out-of-band FLUSH_START event. However, the locking in that function looks ok at first glance, and I'm not exactly sure what line number the crash happens in (see line 371 in http://cgit.freedesktop.org/gstreamer/gstreamer/tree/plugins/elements/gstfakesink.c?id=RELEASE-0_10_21 - this really is ubuntu 8.10, right? And the version of package libgstreamer0.10-0 is 0.10.21, right?).

There are known issues with calling g_object_notify() from multiple threads on the same object, but I think those should have caused an assert and not a crash.
Comment 2 Tim-Philipp Müller 2009-05-30 12:25:43 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for.
Thanks!
Comment 3 Tim-Philipp Müller 2009-05-30 18:29:17 UTC
Actually, this seems to be just another variant of the infamous GObject-notify-is-not-thread-safe bug. There's a patch [1], but it seems like getting GObject patches reviewed is hard these days ...

In any case, this can easily be reproduced using the attached unit test. Crash is here:

gdb) bt
  • #0 ??
  • #1 IA__g_object_notify
    at /tmp/cdt.XX50MgKl/build-area/glib2.0-2.20.1/gobject/gobjectnotifyqueue.c line 125
  • #2 gst_fake_sink_event
    at gstfakesink.c line 370
  • #3 gst_base_sink_event
    at gstbasesink.c line 2783
  • #4 gst_pad_send_event
    at gstpad.c line 4983
  • #5 gst_pad_push_event
    at gstpad.c line 4839
  • #6 gst_queue_handle_sink_event
    at gstqueue.c line 800
  • #7 gst_pad_send_event
    at gstpad.c line 4983
  • #8 gst_pad_push_event
    at gstpad.c line 4839
  • #9 oob_source_create
    at elements/fakesink.c line 884
  • #10 gst_base_src_get_range
    at gstbasesrc.c line 1945
  • #11 gst_base_src_loop
    at gstbasesrc.c line 2188

As ugly as it may be, I think we should just hack around this particular bug in fakesink until this gets fixed in GLib.

[1] http://bugzilla.gnome.org/show_bug.cgi?id=166020#c61
Comment 4 Tim-Philipp Müller 2009-05-31 14:14:53 UTC
Created attachment 135656 [details] [review]
hack around g_object_notify() crasher bug by taking the STREAM_LOCK for out of band events in gst_fake_sink_event()
Comment 5 Tim-Philipp Müller 2009-05-31 19:11:03 UTC
Solved this slightly differently without touching basesink: instead of the stream lock, just have a common lock for all g_object_notify() per instance (let's hope the bug is not per class - if it is, then it's much harder to run into that at least).

 commit 7e4b164c125926784805446482151e4e7bfffe96
 Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
 Date:   Sat May 30 20:36:25 2009 +0100

    fakesink: hack around crasher bug in g_object_notify() for out-of-band events
    
    GObject may crash if two threads do concurrent g_object_notify() on the same
    object. This may happen if fakesink receives an out-of-band event such as
    FLUSH_START while processing a buffer or serialised event in the streaming
    thread. Since this may happen with the default settings during a common
    operation like a seek, and there seems to be little chance of a timely fix
    in GObject (see #166020), we should hack around this issue by protecting all
    of fakesink's direct g_object_notify() calls with a lock.
    
    Also add unit test for the above.
    
    Fixes #554460.