Skip to content

RTC2RTMP: Fix sequence number wraparound assertion crashes. v6.0.177#4491

Merged
winlinvip merged 3 commits intoossrs:6.0releasefrom
winlinvip:bugfix/4434
Sep 15, 2025
Merged

RTC2RTMP: Fix sequence number wraparound assertion crashes. v6.0.177#4491
winlinvip merged 3 commits intoossrs:6.0releasefrom
winlinvip:bugfix/4434

Conversation

@winlinvip
Copy link
Copy Markdown
Member

@winlinvip winlinvip commented Sep 15, 2025

The issue occurred when srs_rtp_seq_distance(start, end) + 1 resulted in values <= 0
due to sequence number wraparound (e.g., when end < start). This caused assertion
failures and server crashes.

SrsRtcFrameBuilder::check_frame_complete(): Added validation to return false
for invalid sequence ranges instead of asserting.

However, it maybe cause converting RTC to RTMP stream failure, because this issue
should be caused by the problem of sequence number of RTP, which means there potentially
be stream problem in RTC stream. Even so, changing assert to warning logs is better,
because SRS should not crash when stream is corrupt.

@winlinvip winlinvip added the EnglishNative This issue is conveyed exclusively in English. label Sep 15, 2025
@winlinvip winlinvip linked an issue Sep 15, 2025 that may be closed by this pull request
@winlinvip winlinvip changed the title RTC2RTMP: Fix sequence number wraparound assertion crashes RTC2RTMP: Fix sequence number wraparound assertion crashes. v6.0.177 Sep 15, 2025
@winlinvip winlinvip merged commit 3c80544 into ossrs:6.0release Sep 15, 2025
17 checks passed
winlinvip added a commit that referenced this pull request Sep 15, 2025
…v7.0.89 (#4491)

The issue occurred when srs_rtp_seq_distance(start, end) + 1 resulted in
values <= 0
due to sequence number wraparound (e.g., when end < start). This caused
assertion
failures and server crashes.

SrsRtcFrameBuilder::check_frame_complete(): Added validation to return
false
  for invalid sequence ranges instead of asserting.

However, it maybe cause converting RTC to RTMP stream failure, because
this issue
should be caused by the problem of sequence number of RTP, which means
there potentially
be stream problem in RTC stream. Even so, changing assert to warning
logs is better,
because SRS should not crash when stream is corrupt.

---------

Co-authored-by: OSSRS-AI <winlinam@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

EnglishNative This issue is conveyed exclusively in English.

Development

Successfully merging this pull request may close these issues.

core-dump: ASan is ignoring requested

2 participants