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 after end_data_capture_thread starts reads a freed encoder last_error #2098
Follow-up of #2086/#2087, which fixed the not-active path. The active path in obs_output_end_data_capture_internal (libobs/obs-output.c.h) has the same order: it creates end_data_capture_thread and then calls signal_stop(output).
signal_stop → stop_params_init → obs_output_get_last_error returns vencoder->last_error_message unlocked. Meanwhile the thread runs stop_video_encoders → obs_encoder_stop → remove_connection → obs_encoder_shutdown → obs_encoder_set_last_error(NULL), which bfrees that string. The stop signal can therefore copy freed memory.
Evidence: TSan run 40074741825 (master with #2087 merged) still has about 108 obs-encoder.c.h:2231 reports against obs-output.c.h:2732, e.g. in test_replay_buffer_pause_stop: write in end_data_capture_thread, read in signal_stop from obs_output_end_data_capture_internal:2423.
Fix: build the stop params before pthread_create and emit them afterwards, as #2087 did. Only trusted local code can trigger this (low risk).
Activity
zackees commentedon Oct 24, 2026
Claiming: this issue. Same split as #2087 on the active path; GREEN is a TSan run on the branch.
libobs: Build the stop params before end_data_capture_thread starts (o…
libobs: Move the output stop decisions
obs-output: Port the output stop decisions (obs-rust#2536)