Skip to content

Conversation

@aleksandr-voitenko
Copy link
Collaborator

@aleksandr-voitenko aleksandr-voitenko commented Feb 6, 2026

Description

Fixing the following crash

EXCEPTION_ACCESS_VIOLATION_READ / 0x0
Fatal Error: EXCEPTION_ACCESS_VIOLATION_READ / 0x0
obs-outputs    +0x3d81    encoder_video_codec (flv-mux.c:156)
obs-outputs    +0x3d81    build_flv_meta_data (flv-mux.c:216)

Motivation and Context

The crash happens in RTP stream internals (flv mux, in this case) on shutdown during a reconnect attempt. There is a data race on encoders of an output, and while it tries to build meta data without any checks on encoder existence and/or locking any mutexes, some other thread resets them. There are clues in logs (see also Sentry reports):

   crash!
  "[000:00:15:29.331.776.100][4440][Info] [rtmp stream: 'main_stream_first'] Socket send buffer is 65536 bytes\n",
  "[000:00:15:29.331.515.500][4048][Debug] obs_encoder_get_codec: Null 'encoder' parameter\n",
  "[000:00:15:29.331.514.300][4048][Debug] obs_encoder_get_height: Null 'encoder' parameter\n",
  "[000:00:15:29.331.513.100][4048][Debug] obs_encoder_get_width: Null 'encoder' parameter\n",
  "[000:00:15:29.331.510.100][4048][Debug] obs_encoder_video: Null 'encoder' parameter\n",
  "[000:00:15:29.331.419.200][4048][Info] [rtmp stream: 'main_stream_first'] Connection to rtmps://push-rtmp-l11-sg01.tiktokcdn.com:443/game (43.152.140.130) successful\n",
  "[000:00:15:28.974.208.000][6820][Debug] signal received: stopping streaming\n",

In this case a good solution is to retain encoders and allow to finish building meta data, even though it will be discarded immediately.

How Has This Been Tested?

Manually, Windows only.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

@aleksandr-voitenko aleksandr-voitenko changed the title [WIP] Fix RTP stream shutdown crash Fix RTP stream shutdown crash Feb 6, 2026
@aleksandr-voitenko aleksandr-voitenko merged commit a1c9a4e into streamlabs Feb 11, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants