gstreamer/subprojects/gst-plugins-good/gst/rtpmanager
François Laignel b9f7ab6052 rtpmanager/rtsession: data race leading to critical warnings
This is a fix for a data race leading to:

> GLib-CRITICAL: g_hash_table_foreach:
>   assertion 'version == hash_table->version' failed

Identified sequence:

* `rtp_session_on_timeout` acquires the lock on `session` and proceeds with its
  processing.
* `rtp_session_process_rtcp` is called (debug log : received RTCP packet) and
  attempts to acquire the lock on `session`, which is still held by
  `rtp_session_on_timeout`.
* as part of an hash table iterator, `rtp_session_on_timeout` transitively
  invokes `source_caps` which releases the lock on `session` so as to call
  `session->callbacks.caps`.
* Since `rtp_session_process_rtcp` was waiting for the lock to be released, it
  succeeds in acquiring it and proceeds with `rtp_session_process_rr` which
  transitively calls `g_hash_table_insert` via `add_source`.
* After `source_caps` re-acquires the lock and gives the control flow back to
  `rtp_session_on_timeout`, the hash table iterator is changed, resulting in the
  assertion failure.

This commits copies `sess->ssrcs[sess->mask_idx]` and iterates on the copy so
the iterator is not affected by a concurrent change due to the lock being
released in the `source_caps` callback.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4585>
2023-05-09 22:35:23 +00:00
..
gstrtpbin.c rtpsession: Support disabling late adjustment of ntp-64 header ext 2022-11-24 08:23:03 +00:00
gstrtpbin.h rtpsession: Support disabling late adjustment of ntp-64 header ext 2022-11-24 08:23:03 +00:00
gstrtpdtmfmux.c Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstrtpdtmfmux.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstrtpfunnel.c rtpmanager: Move some duplicated constant and helper function to a single place 2022-04-20 14:40:25 +00:00
gstrtpfunnel.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstrtphdrext-clientaudiolevel.c rtphdrext-clientaudiolevel: Rename RFC 6464 element 2021-10-20 00:03:09 +00:00
gstrtphdrext-clientaudiolevel.h rtphdrext-clientaudiolevel: Rename RFC 6464 element 2021-10-20 00:03:09 +00:00
gstrtphdrext-mid.c rtpmanager: add support for writing RFC8843 (BUNDLE mid) RTP header extension 2022-03-21 03:18:18 +00:00
gstrtphdrext-mid.h rtpmanager: add support for writing RFC8843 (BUNDLE mid) RTP header extension 2022-03-21 03:18:18 +00:00
gstrtphdrext-ntp.c rtpmanager: Add header extension implementation for the 64-bit RFC6051 NTP header extension 2022-04-20 14:40:25 +00:00
gstrtphdrext-ntp.h rtpmanager: Add header extension implementation for the 64-bit RFC6051 NTP header extension 2022-04-20 14:40:25 +00:00
gstrtphdrext-repairedstreamid.c rtpmanager: add support for RFC8852 (rid) RTP header extensions 2022-03-21 03:18:18 +00:00
gstrtphdrext-repairedstreamid.h rtpmanager: add support for RFC8852 (rid) RTP header extensions 2022-03-21 03:18:18 +00:00
gstrtphdrext-streamid.c rtpmanager: add support for RFC8852 (rid) RTP header extensions 2022-03-21 03:18:18 +00:00
gstrtphdrext-streamid.h rtpmanager: add support for RFC8852 (rid) RTP header extensions 2022-03-21 03:18:18 +00:00
gstrtphdrext-twcc.c rtphdrext: Set caps without attributes as the default 2021-09-28 20:04:55 +00:00
gstrtphdrext-twcc.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstrtpjitterbuffer.c rtpjitterbuffer: Reschedule timers when updating their offset 2022-11-16 08:26:41 +00:00
gstrtpjitterbuffer.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstrtpmanager.c rtpmanager: Add header extension implementation for the 64-bit RFC6051 NTP header extension 2022-04-20 14:40:25 +00:00
gstrtpmux.c Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstrtpmux.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstrtpptdemux.c rtpptdemux: set different stream-id on each src pad 2023-02-01 17:46:29 +00:00
gstrtpptdemux.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstrtprtxqueue.c Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstrtprtxqueue.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstrtprtxreceive.c rtprtx: Fix copying extension headers 2022-07-04 19:20:57 +00:00
gstrtprtxreceive.h rtpmanager/rtx: implement initial support for reading/writing rid extensions 2022-03-21 03:18:18 +00:00
gstrtprtxsend.c rtprtx: Fix copying extension headers 2022-07-04 19:20:57 +00:00
gstrtprtxsend.h rtpmanager/rtx: implement initial support for reading/writing rid extensions 2022-03-21 03:18:18 +00:00
gstrtpsession.c rtpsession: Support disabling late adjustment of ntp-64 header ext 2022-11-24 08:23:03 +00:00
gstrtpsession.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstrtpssrcdemux.c rtpssrcdemux: set different stream-id on each src pad 2023-02-01 17:46:29 +00:00
gstrtpssrcdemux.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstrtpst2022-1-fecdec.c st2022-1-fecdec: fix packet trimming 2021-11-12 08:15:28 +00:00
gstrtpst2022-1-fecdec.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstrtpst2022-1-fecenc.c rtpst2022-1-fecenc: Drain column packets on EOS 2022-08-12 12:59:19 +00:00
gstrtpst2022-1-fecenc.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
gstrtputils.c rtpmanager: Move some duplicated constant and helper function to a single place 2022-04-20 14:40:25 +00:00
gstrtputils.h rtpmanager: Move some duplicated constant and helper function to a single place 2022-04-20 14:40:25 +00:00
meson.build meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
rtpjitterbuffer.c rtpjitterbuffer: Fix calculation of RFC7273 RTP time period start 2022-07-11 15:33:42 +00:00
rtpjitterbuffer.h rtpjitterbuffer: add "add-reference-timestamp-meta" property 2022-03-16 09:52:58 +00:00
rtpsession.c rtpmanager/rtsession: data race leading to critical warnings 2023-05-09 22:35:23 +00:00
rtpsession.h rtpsession: Support disabling late adjustment of ntp-64 header ext 2022-11-24 08:23:03 +00:00
rtpsource.c rtpsource: Track the seqnum for senders 2022-11-23 10:26:29 +00:00
rtpsource.h rtpsource: Don't do probation for RTX sources 2022-10-10 14:56:18 +00:00
rtpstats.c Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
rtpstats.h rtpsession: Update 64-bit NTP header extensions with the actual NTP time in senders 2022-04-20 14:40:25 +00:00
rtptimerqueue.c rtptimerqueue: Fix memory leak 2022-12-27 19:31:16 +00:00
rtptimerqueue.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
rtptwcc.c twcc: Better handle duplicate packets 2023-04-10 13:16:44 +01:00
rtptwcc.h Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00