Skip to content

Meta: ThreadSanitizer launch + unit-test pass (Linux) #133

Closed
3 of 3 issues completed
Closed

Description

@zackees

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_filename and test_utf8 hardcode -fsanitize=address in test/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:

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_create and the PipeWire plugin
  • Mesa llvmpipe fence mutex/condvar create and destroy under gs_flush/gs_draw/gs_present
  • libpulse recvmsg between its own threads

A future pass with an instrumented Qt/Mesa (or a suppressions file) would make this list unnecessary.

Sub-issues

Sub-issues

3 of 3 Issues completed
Loading 3 sub-issues

Activity

  1. zackees commented on Oct 15, 2026

    @zackees
    MemberAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions