Skip to content

[tsan] Fix running check-ubsan with COMPILER_RT_DEBUG=ON #83890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions compiler-rt/lib/sanitizer_common/sanitizer_mutex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,10 @@ struct InternalDeadlockDetector {
return initialized > 0;
}
};

static THREADLOCAL InternalDeadlockDetector deadlock_detector;
// This variable is used by the __tls_get_addr interceptor, so cannot use the
// global-dynamic TLS model, as that would result in crashes.
__attribute__((tls_model("initial-exec"))) static THREADLOCAL
InternalDeadlockDetector deadlock_detector;

void CheckedMutex::LockImpl(uptr pc) { deadlock_detector.Lock(type_, pc); }

Expand Down