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 590056 - [collectpads] race resulting in double flush-stop being outputted
[collectpads] race resulting in double flush-stop being outputted
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal blocker
: 0.10.24
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-07-28 19:39 UTC by Edward Hervey
Modified: 2009-07-29 09:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
collectpads: Split out _check_pads into a version without lock taking. (1.91 KB, patch)
2009-07-28 19:40 UTC, Edward Hervey
committed Details | Review
collectpads: Make sure the CollectData list is up-to-date when reading/setting it (1.85 KB, patch)
2009-07-28 19:40 UTC, Edward Hervey
committed Details | Review
collectpads: Get the flushing state with the object lock taken. (1.11 KB, patch)
2009-07-28 19:40 UTC, Edward Hervey
committed Details | Review

Description Edward Hervey 2009-07-28 19:39:39 UTC
This is the analysis of the adder unit-test failing in gst-plugins-bad.

Running suite(s): adder
83%: Checks: 6, Failures: 1, Errors: 0
gstconsistencychecker.c:66:F:general:test_live_seeking:0: Received a FLUSH_STOP without a FLUSH_START


The problem is due to a race in gstcollectpads when using _set_flushing() and the internal _get_flushing() function *WITHOUT* making sure that the list of GstCollectData is actually 'in-sync' (meaning you have the latest available version).

This is fixed by calling _check_pads() in _get_flushing/_set_flushing to ensure we have the *real* current state.
Comment 1 Edward Hervey 2009-07-28 19:40:42 UTC
Created attachment 139415 [details] [review]
collectpads: Split out _check_pads into a version without lock taking.

This is so we can use _check_pads in places where we've already taken
the lock in question.
Comment 2 Edward Hervey 2009-07-28 19:40:44 UTC
Created attachment 139416 [details] [review]
collectpads: Make sure the CollectData list is up-to-date when reading/setting it

Without this, we risked:
* Checking the flushing state on an unexisting list
* Not setting the flushing state on pads that had just been added
Comment 3 Edward Hervey 2009-07-28 19:40:46 UTC
Created attachment 139417 [details] [review]
collectpads: Get the flushing state with the object lock taken.
Comment 4 Wim Taymans 2009-07-29 08:57:07 UTC
Makes perfect sense to me.
Comment 5 Edward Hervey 2009-07-29 09:51:02 UTC
commit cfb22080e28236802018868e4f40d46b57560c39
Author: Edward Hervey <bilboed@bilboed.com>
Date:   Tue Jul 28 21:15:52 2009 +0200

    collectpads: Get the flushing state with the object lock taken.
    
    Fixes #590056

commit c138aa8648567f95331a8497dc82cb5e567dc017
Author: Edward Hervey <bilboed@bilboed.com>
Date:   Tue Jul 28 21:14:11 2009 +0200

    collectpads: Make sure the CollectData list is up-to-date when reading/setting it
    
    Without this, we risked:
    * Checking the flushing state on an unexisting list
    * Not setting the flushing state on pads that had just been added
    
    Partially fixes #590056

commit fcbba9b15a79487cdde9b6db35693783bfd5aae3
Author: Edward Hervey <bilboed@bilboed.com>
Date:   Tue Jul 28 21:12:25 2009 +0200

    collectpads: Split out _check_pads into a version without lock taking.
    
    This is so we can use _check_pads in places where we've already taken
    the lock in question.
    
    Partially fixes #590056