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 668254 - [pad] possible race between FLUSH_STOP and pad deactivation
[pad] possible race between FLUSH_STOP and pad deactivation
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-01-19 10:10 UTC by Mark Nauwelaerts
Modified: 2013-07-24 08:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
pad: also flush FLUSH_STOP if pad not active (1.09 KB, patch)
2012-01-19 10:10 UTC, Mark Nauwelaerts
rejected Details | Review

Description Mark Nauwelaerts 2012-01-19 10:10:45 UTC
Created attachment 205612 [details] [review]
pad: also flush FLUSH_STOP if pad not active

Consider a FLUSH_STOP moving through the pipeline in one thread, while other thread (mainloop) is performing PAUSED_TO_READY.  While such behaviour is typically rare (FLUSH_STOP usually occurs with seeking and done by mainloop), it is (AFAIK) not "illegal" and can in fact occur in e.g. GNonLin context.

The following race can occur:
* mainloop performs pre_activate for src pad
* mainloop performs queue src pad (de)activation 
(setting src result, unblocking loop etc)
* core processes FLUSH_STOP for sink pad; it notices that pad has been deactivated so will not clear flush flag, but afaics it will still invoke the pad's event function

* processing an event while flushing is Not Good.  For queue-like elements, this could also mean loop task being started again and so even worse.
Particularly so when mainloop then performs src pad post_activate, which tries to get STREAM_LOCK (and will not get since a task is running).

Looks like this has been fixed in 0.11 (slightly differently); would seem to be proper in 0.10 as well unless there is some behaviour to maintain there.
Comment 1 Sebastian Dröge (slomo) 2013-07-24 08:56:12 UTC
Fixed in 1.0 and 0.10 is no longer maintained.