Repository navigation
Closed
3 / 33 of 3 issues completedClosed
3 / 33 of 3 issues completed
Copy link
Description
First ThreadSanitizer pass over OBS on Linux, at master ad60c0e39 with the default ENABLE_RUST_LIBOBS=OFF.
What ran
- Build: RelWithDebInfo with
-fsanitize=thread, frontend on. Browser, websocket, scripting, VLC, NVENC/QSV, AJA, WebRTC and VST were off. - Unit tests: 40 cmocka tests passed, with no TSan reports.
test_formatted_filenameandtest_utf8hardcode-fsanitize=addressintest/cmocka/CMakeLists.txt, so they can't build under TSan; they're covered by the ASan pass (Meta: ASan/UBSan launch + unit-test pass (Linux) #128). - App: headless launch (Xvfb, Mesa llvmpipe, PulseAudio), fresh profile, SIGINT after 45 s.
- Harness:
rust/tools/sanitize/(shell.nix+sanitize.sh), native on NixOS. Not committed yet.
Findings
The app produced 45 TSan reports: 42 data races, 1 lock-order inversion and 2 thread leaks. Three are real bugs where both sides of the race are OBS code. All three are upstream code and are sub-issues of this one:
- TSan: audio thread reads source audio_ts / audio_input_buf without audio_buf_mutex #130 Audio thread reads source
audio_ts/audio_input_bufwithoutaudio_buf_mutex(libobs) - TSan: VolumeMeter paintEvent reads level/ballistics data without dataMutex #131
VolumeMeter::paintEventreads level data withoutdataMutex(frontend) - TSan: CurrentTimeString uses non-reentrant localtime() from every logging thread #132
CurrentTimeStringuses non-reentrantlocaltime()from every logging thread (frontend)
Dismissed as false positives
These are all in libraries that aren't TSan-instrumented, so TSan can't see their internal synchronization:
- Qt event queue and QDBus (
QPostEventList::addEvent,QMetaCallEvent, the 2 thread leaks, the D-Bus lock-order cycle) - GLib/GDBus allocations from
os_inhibit_sleep_createand the PipeWire plugin - Mesa llvmpipe fence mutex/condvar create and destroy under
gs_flush/gs_draw/gs_present - libpulse
recvmsgbetween its own threads
A future pass with an instrumented Qt/Mesa (or a suppressions file) would make this list unnecessary.
Sub-issues
Collapse Sub-issuesSub-issues
Loading 3 sub-issues
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsDone
Activity
infra: Add a dispatchable sanitizer workflow (ASan/UBSan, TSan, valgr…
zackees commentedon Oct 15, 2026
Closing: all three real races from this pass are fixed: #130 by #662, #131 by #442, #132 by #418. The sanitizers run nightly and on demand (#171, #496). Left: the dismissed Qt/Mesa/GLib/libpulse reports need an instrumented build or a suppressions file before a clean TSan app run is possible; file a follow-up if that's wanted.