mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 20:42:30 +00:00
5ef2ce69ff
While testing the [implementation for insertable streams] in `webrtcsink` & `webrtcsrc`, I encountered critical warnings, which turned out to result from two race conditions in `rtpsession`. Both race conditions produce: > GLib-CRITICAL: g_hash_table_foreach: > assertion 'version == hash_table->version' failed This commit fixes one of the race conditions observed. In its simplest form, the test consists in 2 pipelines and a Signalling server: * pipelines_sink: audiotestsrc ! webrtcsink * pipelines_src: webrtcsrc ! appsrc 1. Set `pipelines_sink` to `Playing`. 2. The Signalling server delivers the `producer_id`. 3. Initialize `pipelines_src` to establish a session with `producer_id`. 4. Set `pipelines_src` to `Playing`. 5. Wait for a buffer to be received by the `appsrc`. 6. Set `pipelines_src` to `Null`. 7. Set `pipelines_sink` to `Null`. The race condition happens in the following sequence: * `webrtcsink` runs a task to periodically retrieve statistics from `webrtcbin`. This transitively ends up executing `rtp_session_create_stats`. * `pipelines_sink` is set to `Null`. * In `Paused` to `Ready`, `gst_rtp_session_change_state()` calls `rtp_session_reset()`. * The assertion failure occurs when `rtp_session_reset` is called while `rtp_session_create_stats` is executing. This is because `rtp_session_create_stats` acquires the lock on `session` prior to calling `g_hash_table_foreach`, but `rtp_session_reset` doesn't acquire the lock before calling `g_hash_table_remove_all`. Acquiring the lock in `rtp_session_reset` fixes the issue. [implementing insertable streams support]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1176 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4528> |
||
---|---|---|
.. | ||
gstrtpbin.c | ||
gstrtpbin.h | ||
gstrtpdtmfmux.c | ||
gstrtpdtmfmux.h | ||
gstrtpfunnel.c | ||
gstrtpfunnel.h | ||
gstrtphdrext-clientaudiolevel.c | ||
gstrtphdrext-clientaudiolevel.h | ||
gstrtphdrext-mid.c | ||
gstrtphdrext-mid.h | ||
gstrtphdrext-ntp.c | ||
gstrtphdrext-ntp.h | ||
gstrtphdrext-repairedstreamid.c | ||
gstrtphdrext-repairedstreamid.h | ||
gstrtphdrext-streamid.c | ||
gstrtphdrext-streamid.h | ||
gstrtphdrext-twcc.c | ||
gstrtphdrext-twcc.h | ||
gstrtpjitterbuffer.c | ||
gstrtpjitterbuffer.h | ||
gstrtpmanager.c | ||
gstrtpmux.c | ||
gstrtpmux.h | ||
gstrtpptdemux.c | ||
gstrtpptdemux.h | ||
gstrtprtxqueue.c | ||
gstrtprtxqueue.h | ||
gstrtprtxreceive.c | ||
gstrtprtxreceive.h | ||
gstrtprtxsend.c | ||
gstrtprtxsend.h | ||
gstrtpsession.c | ||
gstrtpsession.h | ||
gstrtpssrcdemux.c | ||
gstrtpssrcdemux.h | ||
gstrtpst2022-1-fecdec.c | ||
gstrtpst2022-1-fecdec.h | ||
gstrtpst2022-1-fecenc.c | ||
gstrtpst2022-1-fecenc.h | ||
gstrtputils.c | ||
gstrtputils.h | ||
meson.build | ||
rtpjitterbuffer.c | ||
rtpjitterbuffer.h | ||
rtpsession.c | ||
rtpsession.h | ||
rtpsource.c | ||
rtpsource.h | ||
rtpstats.c | ||
rtpstats.h | ||
rtptimerqueue.c | ||
rtptimerqueue.h | ||
rtptwcc.c | ||
rtptwcc.h |