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 619590 - [matroskademux] Doesn't protect segment and other fields from concurrent changes from different threads
[matroskademux] Doesn't protect segment and other fields from concurrent chan...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 0.10.31
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-05-25 09:45 UTC by Sebastian Dröge (slomo)
Modified: 2011-06-15 22:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
matroskademux: additional lock safety (7.97 KB, patch)
2011-05-04 10:32 UTC, Mark Nauwelaerts
committed Details | Review

Description Sebastian Dröge (slomo) 2010-05-25 09:45:46 UTC
See comment #12 in bug #619485
Comment 1 Philip Jägenstedt 2010-05-25 10:18:24 UTC
Is the standard solution to protect such access with the object lock? Apart from event threads and query threads, are there other things that need attention?
Comment 2 Sebastian Dröge (slomo) 2010-05-25 16:21:47 UTC
Yes, use the object lock if possible but be careful when holding the object lock while calling functions to other elements/pads or the base classes (e.g. gst_object_get_parent() uses the object lock too)
Comment 3 Sebastian Dröge (slomo) 2010-05-25 16:23:14 UTC
And things that need attention are the query and event functions, the chain/loop functions and the set/get property functions and maybe the state change function.
Comment 4 Mark Nauwelaerts 2011-05-04 10:32:15 UTC
Created attachment 187174 [details] [review]
matroskademux: additional lock safety

Patch should take care of remaining items ...
Comment 5 Sebastian Dröge (slomo) 2011-05-05 15:36:13 UTC
Comment on attachment 187174 [details] [review]
matroskademux: additional lock safety

I think you don't need to take the object lock when reading the segment from inside the streaming thread, e.g. not in gst_matroska_demux_sync_streams(), because it's only changed from the streaming thread.

Other than that this looks good
Comment 6 Mark Nauwelaerts 2011-05-16 11:34:07 UTC
Yeah, was wondering a bit about that too.  But anyway, for good measure ...

commit 8b910885ecec02c1974a2689ee06e3bd3f0b8cca
Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Date:   Wed May 4 11:55:21 2011 +0200

    matroskademux: additional lock safety
    
    Fixes #619590.