GNOME Bugzilla – Bug 784012
decodebin3: Protect dbin->collection with the SELECTION_LOCK
Last modified: 2017-07-18 11:09:16 UTC
The current collection was not protected at all and we were easily using it after free on rtsp streams.
Created attachment 354112 [details] [review] decodebin3: Protect dbin->collection with the SELECTION_LOCK It was currently not protected at all which was leading to a race where we were using dbin->collection after it was freed.
A simple way to reproduce the race is by doing: USE_PLAYBIN3=true gst-validate-launcher -m -t validate.rtsp.playback.change_state_intensive.test5_mkv Traceback: Thread 23 "rtpjitterbuffer" received signal SIGSEGV, Segmentation fault.
+ Trace 237584
Thread 140735894492928 (LWP 32571)
Created attachment 355518 [details] [review] decodebin3: Protect fields related to streams handling with the SELECTION_LOCK Fields related to stream handling (input_streams, output_streams, slots, guint slot_id) where used totally unprotected until know. This lead to several races, especially playing back RTSP streams. To protect those fields, the OBJECT_LOCK can not be used as we sometimes need to be able to post message on the bus while holding it. decodebin3 already has a lock to manage stream selection, and in the end it makes sense to protect all the stream management fields with the same lock which is why we reuse the SELECTION_LOCK here.
Created attachment 355528 [details] [review] decodebin3: Protect dbin->collection usage Use the selection lock to protect dbin->collection access
commit 4b3798fedcd5be1aa76092e91a7d22663100d99f Author: Thibault Saunier <thibault.saunier@osg.samsung.com> Date: Thu Jun 15 12:48:42 2017 -0400 decodebin3: Protect fields related to streams handling with the SELECTION_LOCK Fields related to stream handling (input_streams, output_streams, slots, guint slot_id) where used totally unprotected until know. This lead to several races, especially playing back RTSP streams. To protect those fields, the OBJECT_LOCK can not be used as we sometimes need to be able to post message on the bus while holding it. decodebin3 already has a lock to manage stream selection, and in the end it makes sense to protect all the stream management fields with the same lock which is why we reuse the SELECTION_LOCK here. https://bugzilla.gnome.org/show_bug.cgi?id=784012 commit 1188345886af566c306c6a9cfe9e08367860bfb1 Author: Edward Hervey <edward@centricular.com> Date: Thu Jul 13 17:39:58 2017 +0200 decodebin3: Protect dbin->collection usage Use the selection lock to protect dbin->collection access https://bugzilla.gnome.org/show_bug.cgi?id=784012
Comment on attachment 355518 [details] [review] decodebin3: Protect fields related to streams handling with the SELECTION_LOCK Commited without changes for collection access (in the other patch)