Repository navigation
Conversation
__send_timer_rtcp() kept ssrc_out->h.lock across rtcp_send_report(), which locks other SSRC entries: the receiver-report sources of the sink media and the sender-report bookkeeping entry on the far media, i.e. ingress entries. The transcoder locks ingress first and egress second (__ssrc_lock_both). The two orders met on a call with a transcoded leg and the daemon deadlocked: a poller in __ssrc_lock_both held the ingress entry and waited for the egress one, while a send timer in rtcp_sender_report held that egress entry and waited for the ingress one. Every other thread queued behind them, including the control socket. Take the lock only to check and claim next_rtcp, then send the report without it, as the RTCP_GEN timer in codec.c already does.
sipwise-jenkins
pushed a commit
that referenced
this pull request
Nov 6, 2026
Ref #2237 Change-Id: I2c685c198946293d71516b97ab2cba3b8f26bbc0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
__send_timer_rtcp()heldssrc_out->h.lockacrossrtcp_send_report(), which locks other SSRC entries: the receiver-report sources of the sink media and the sender-report bookkeeping entry on the far media, i.e. ingress entries. The transcoder locks ingress first and egress second (__ssrc_lock_both).The two orders met on a call with a transcoded leg and the daemon deadlocked: all pollers and send timers in
futex, control socket unread. Owner graph from the core dump: a poller in__ssrc_lock_bothholding the ingress entry and waiting for the egress one, a send timer inrtcp_sender_reportholding that egress entry and waiting for the ingress one.Change
Take the lock only to check and claim
next_rtcp(so that another send timer sharing the SSRC does not send a second report), then send the report without it, as theRTCP_GENtimer incodec.calready does.The inversion is easiest to hit when an egress entry is shared (fixed egress SSRC, audio player; see #2195), but the lock order is the same without it. With #2195 applied and without this fix,
auto-daemon-tests-inject.pl(RTPENGINE_EXTENDED_TESTS=1) deadlocked in 1 of 3 runs with exactly this owner graph (gdb: the media player thread in__send_timer_rtcp→rtcp_send_report→ssrc_sender_reportwaiting on an ingress entry, two pollers in__ssrc_lock_bothwaiting on the egress one); with this fix, in none.Testing
make asan-checkpasses on this branch alone, and on top of #2195, #2238 and #2239.