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 761912 - gstpad: Fix race between gst_element_remove_pad and state change
gstpad: Fix race between gst_element_remove_pad and state change
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal critical
: 1.8.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-02-12 10:24 UTC by Håvard Graff (hgr)
Modified: 2016-03-29 07:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (4.89 KB, patch)
2016-02-12 10:24 UTC, Håvard Graff (hgr)
committed Details | Review

Description Håvard Graff (hgr) 2016-02-12 10:24:15 UTC
Created attachment 320949 [details] [review]
patch

When going from READY to NULL all element pads are deactivated. If
simultaneously the pad is being removed from the element with
gst_element_remove_pad() and the pad is unparented, there is a race
where the deactivation will assert (g_critical) if the parent is lost at
the wrong time.

The proposed fix will check parent only once and retain it to avoid the
race.

The patch does not have a separate test, as the existing funnel-stress test will provoke this eventually, specially if a sleep is added in the code before getting the parent. It is in other words a very rare unlikely race, but a real one nevertheless.
Comment 1 Sebastian Dröge (slomo) 2016-03-16 22:25:52 UTC
<hgr1> anyone feel like reviewing https://bugzilla.gnome.org/show_bug.cgi?id=761912 ?
<slomo> hgr1: sounds similar to another bug thiagoss created some weeks ago
<slomo> hgr1: but makes sense to me
Comment 2 Sebastian Dröge (slomo) 2016-03-24 12:42:11 UTC
commit 7dd76b626e0dacdba2844243944ec6c14ddf6932
Author: Stian Selnes <stian@pexip.com>
Date:   Wed Jan 27 11:46:06 2016 +0100

    pad: Fix race between gst_element_remove_pad and state change
    
    When going from READY to NULL all element pads are deactivated. If
    simultaneously the pad is being removed from the element with
    gst_element_remove_pad() and the pad is unparented, there is a race
    where the deactivation will assert (g_critical) if the parent is lost at
    the wrong time.
    
    The proposed fix will check parent only once and retain it to avoid the
    race.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=761912