Repository navigation
fix(output): join a finished end_data_capture thread - #2070
Merged
Merged
Conversation
zackees
enabled auto-merge
October 24, 2026 06:52
Member
Author
|
The first CI run failed to build: |
6 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2063
end_data_capture_threadclearsend_data_capture_thread_activewhen it returns, and every join site joined only while that flag was set. So a finished thread was never joined, and each output stop leaked a joinable thread and its stack. TSan reported it in 18 tests, 82 reports (run 40066620813).test_output_end_capture_thread_joininterposes pthread_create, pthread_join and pthread_detach in the executable, which is built with default visibility so that libobs binds to them. It runs 4 start/stop cycles of a raw video output, then releases it. Local./unittest:11 threads created, 4 left unjoined,4 != 0.end_data_capture_thread_joinableflag, set when a create succeeds. Onejoin_end_data_capture_thread()helper (an atomic exchange, then join) now serves the next start, the next end of capture, and destroy. The shutdown-unstarted-encoders path joins a finished thread before it creates a new one, which never waits../lintpasses; PR CI runs Tier 2 against both libobs builds.obs-internal.his a private header. Tiers 1 and 3 don't apply: obs-output has no Rust port.