Skip to content
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

[tsan] Make pthread_mutex_clocklock Linux only again #76187

Closed
wants to merge 1 commit into from

Conversation

dankm
Copy link
Contributor

@dankm dankm commented Dec 21, 2023

In e777317 it seems that not every reference to pthread_mutex_clocklock was made Linux only.

Wrap the remaining references.

@llvmbot
Copy link
Collaborator

llvmbot commented Dec 21, 2023

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Dan McGregor (dankm)

Changes

In e777317 it seems that not every reference to pthread_mutex_clocklock was made Linux only.

Wrap the remaining references.


Full diff: https://github.com/llvm/llvm-project/pull/76187.diff

1 Files Affected:

  • (modified) compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp (+2)
diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
index fdcba6e8ca7398..0c9f9b104055e0 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
+++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
@@ -2918,7 +2918,9 @@ void InitializeInterceptors() {
   TSAN_INTERCEPT(pthread_mutex_trylock);
   TSAN_INTERCEPT(pthread_mutex_timedlock);
   TSAN_INTERCEPT(pthread_mutex_unlock);
+  #if SANITIZER_LINUX
   TSAN_INTERCEPT(pthread_mutex_clocklock);
+  #endif
 #if SANITIZER_GLIBC
 #  if !__GLIBC_PREREQ(2, 34)
   TSAN_INTERCEPT(__pthread_mutex_lock);

Copy link

github-actions bot commented Dec 21, 2023

✅ With the latest revision this PR passed the C/C++ code formatter.

Similar to e777317, but also avoid declaring
pthread_mutex_clocklock on non-Linux.
@dankm
Copy link
Contributor Author

dankm commented Dec 22, 2023

@MaskRay made the commit this fixes up, so he should probably take a look. Don't know who else ought to.

@dankm
Copy link
Contributor Author

dankm commented Jan 8, 2024

Looks like @rorth made the same patch in #76220, it was merged. Thanks, @rorth.

@dankm dankm closed this Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants