elements_rtpbin.test_eos occasionaly fails
(rtpbin:14679): GLib-CRITICAL **: 22:23:12.540: g_hash_table_foreach: assertion 'version == hash_table->version' failed
The original cause of this is https://bugzilla.gnome.org/show_bug.cgi?id=532011 (CC @ocrete).
What happens is the following:
- We start generating a RTCP packet on timeout (
rtp_session_on_timeout()
) - We call
generate_rtcp()
for each item for the SSRC hash table (this is the iteration that will break) - We call into
session_start_rtcp()
andrtp_source_get_new_sr()
-
rtp_source_get_new_sr()
among other things callsget_clock_rate()
which calls back intortpsession
'ssource_clock_rate()
, which... releases the session lock in the middle of the iteration from 2) - In that short window, we process an RTCP packet (
rtp_session_process_rtcp()
) - We call into
rtp_session_process_rr()
, which calls intoobtain_source()
and that creates a new source and adds it to the SSRC hash table (see 2)) - A bit later, 4) continues, takes the session lock, tries to do another iteration of the hash table and
🎆
I don't know how to fix this without potentially introducing deadlocks. This is going through too many layers while assuming that the mutex is still locked (which it shortly isn't).