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 626733 - Race in gnlcomposition between no_more_pads_object_cb and compare_relink_single_node
Race in gnlcomposition between no_more_pads_object_cb and compare_relink_sing...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gnonlin
git master
Other Mac OS
: Normal normal
: 0.10.16
Assigned To: GStreamer Maintainers
Edward Hervey
Depends on:
Blocks:
 
 
Reported: 2010-08-12 13:53 UTC by Alessandro Decina
Modified: 2010-08-27 20:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test case reproducing the bug (7.63 KB, patch)
2010-08-12 13:55 UTC, Alessandro Decina
none Details | Review
fix (11.34 KB, patch)
2010-08-17 12:15 UTC, Alessandro Decina
none Details | Review
test case (rebased) (7.63 KB, patch)
2010-08-17 12:35 UTC, Alessandro Decina
accepted-commit_now Details | Review
fix (rebased) (11.38 KB, patch)
2010-08-17 12:36 UTC, Alessandro Decina
accepted-commit_now Details | Review

Description Alessandro Decina 2010-08-12 13:53:56 UTC
Directly from the test case i'm attaching to this bug:

  /* We create a composition with an operation and three sources. The operation
   * contains a videomixer instance and the three sources are videotestsrc's.
   *
   * One of the sources, source2, contains videotestsrc inside a bin. Initially
   * the bin doesn't have a source pad. We do this to exercise the dynamic src
   * pad code path in gnlcomposition. We block on the videotestsrc srcpad and in
   * the pad block callback we ghost the pad and add the ghost to the parent
   * bin. This makes gnlsource emit no-more-pads, which is used by
   * gnlcomposition to link the source2:src pad to videomixer.
   *
   * We start with the composition containing operation and source1. We preroll
   * and then add source2. Source2 will do what described above and emit
   * no-more-pads. We connect to that no-more-pads and from there we add source3 to
   * the composition. Adding a new source will make gnlcomposition deactivate
   * the old stack and activate a new one. The new one contains operation,
   * source1, source2 and source3. Source2 was active in the old stack as well and
   * gnlcomposition is *still waiting* for no-more-pads to be emitted on it
   * (since the no-more-pads emission is now blocked in our test's no-more-pads
   * callback, calling gst_bin_add). In short, here, we're simulating a race between
   * no-more-pads and someone modifying the composition.
   *
   * Activating the new stack, gnlcomposition calls compare_relink_single_node,
   * which finds an existing source pad for source2 this time since we have
   * already blocked and ghosted. It takes another code path that assumes that
   * source2 doesn't have dynamic pads and *BOOM*.
   */
Comment 1 Alessandro Decina 2010-08-12 13:55:53 UTC
Created attachment 167731 [details] [review]
test case reproducing the bug
Comment 2 Alessandro Decina 2010-08-17 12:15:59 UTC
Created attachment 168061 [details] [review]
fix
Comment 3 Alessandro Decina 2010-08-17 12:35:59 UTC
Created attachment 168064 [details] [review]
test case (rebased)
Comment 4 Alessandro Decina 2010-08-17 12:36:22 UTC
Created attachment 168065 [details] [review]
fix (rebased)
Comment 5 Edward Hervey 2010-08-25 06:38:47 UTC
OK for me, please commit.
Comment 6 Alessandro Decina 2010-08-27 20:59:42 UTC
commit 3f1f4940be6431ebcada9fa253c8d407745eabc5
Author: Alessandro Decina <alessandro.decina@collabora.co.uk>
Date:   Tue Aug 17 14:10:38 2010 +0200

    gnlcomposition: fix a race. Fixes #626733.
    
    Fix a race between no_more_pads_object_cb and compare_relink_single_node.