You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
libobs: stop signal reads encoder last_error while the unstarted-encoder shutdown thread frees it #2086
TSan (run 40066620813): 46 reports in 14 tests, obs-encoder.c.h:2231 (obs_encoder_set_last_error) against obs-output.c.h:2706 (obs_output_get_last_error).
When an output stops before its data capture began, obs_output_end_data_capture_internal starts shutdown_unstarted_encoders_thread, then calls signal_stop(). signal_stop() reads the encoders' last_error_message for the stop signal. The new thread runs obs_encoder_shutdown → obs_encoder_set_last_error(encoder, NULL), which frees that string, so the read can land on freed memory.
Fix: copy the stop signal's parameters (including last_error) before starting the thread, and emit them afterwards. The thread order stays the same, so a stop handler that restarts the output still waits for the shutdown.
Activity
zackees commentedon Oct 24, 2026
Claiming: build the stop calldata before the shutdown thread starts. PR today.
fix(output): copy the stop signal's last error before shutting down u…
libobs: Move the output stop decisions
obs-output: Port the output stop decisions (obs-rust#2536)