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: every output stop leaks its end_data_capture thread (never joined) #2063
TSan (run 40066620813) reports a thread leak at obs_output_end_data_capture_internal (obs-output.c.h:2356 and :2387): 82 reports in 18 tests.
end_data_capture_thread clears end_data_capture_thread_active when it finishes. Each of the three join sites (the next start, the next end of capture, and destroy) joins only if (data_capture_ending(output)), so a thread that has already finished is never joined, and each stop leaks one joinable thread and its stack. null-output had the same bug and it was fixed there (test_null_output_stop_thread).
Fix: track whether a created thread is still unjoined, separately from whether it's running, and join on that. Test: a new cmocka test interposes pthread_create, pthread_join and pthread_detach, then checks that unjoined threads don't grow with the number of start/stop cycles of a raw output.
Fixed by #2070 (merged). A separate joinable flag means the next start, the next end of capture, and destroy now join a finished end_data_capture thread. Before the fix, test_output_end_capture_thread_join failed with 4 threads left unjoined after 4 stops.
Activity
zackees commentedon Oct 24, 2026
Claiming: RED interposed-pthread test, GREEN joinable flag in obs-output. PR today.
fix(output): cast away const where the public capture check joins (#2063
fix(output): launder const through uintptr_t, as obs-output does else…
zackees commentedon Oct 24, 2026
Fixed by #2070 (merged). A separate joinable flag means the next start, the next end of capture, and destroy now join a finished end_data_capture thread. Before the fix, test_output_end_capture_thread_join failed with 4 threads left unjoined after 4 stops.
fix(output): join a finished end_data_capture thread (obs-rust#2070)