GNOME Bugzilla – Bug 778079
race in gstpoll detected by TSan
Last modified: 2018-11-03 12:39:20 UTC
Created attachment 344776 [details] ThreadSanitizer: data race gstreamer/gst/gstpoll.c:1371 in gst_poll_wait This case detected by the ThreadSanitizer where the set->active_fds GArray is expanded/reallocated while another thread is calling ppoll() on it.
Created attachment 344777 [details] ThreadSanitizer: data race (/lib64/libtsan.so.0+0x45bd6) in __interceptor_ppoll This second trace (occuring after the first one) corresponds to two threads waiting on ppoll() with the same fd array.
Yes, it seems not thread-safe to use the same GstPoll from two different threads at the same time... although it tries to allow that (see mutex). And the docs also allow it for ones that are created with gst_poll_new_timer() like here (but not for others). They share the same array for the fds, but this array can be changed by each call at any time, including reallocation.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/219.