-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Disable SYS_close syscall when Thread Sanitizer is active #3112
Disable SYS_close syscall when Thread Sanitizer is active #3112
Conversation
|
c08b5a9
to
82c614e
Compare
@bnoordhuis Thanks for the explanation, somehow I missed the comment at the top of the function. Meanwhile, after more chat with LLVM/TSAN developer, I changed the commit to use pre- and post- sanitizer wrappers, which has the same effect, but keeps the |
Thread Sanitizer can't intercept syscall(SYS_close, fd) that's used instead of close(fd); on Linux. That leads to false positives as Thread Sanitizer thinks the descriptor is still being used by the thread. clang defines pre- and post- syscall actions, so wrap the close syscall() into the action macros. For gcc, use close() from glibc instead of the syscall. This allows the thread sanitizer to intercept closing of the file descriptor when libuv is compiled with Thread Sanitizer.
82c614e
to
9de7e7f
Compare
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
bump |
Thread Sanitizer can't intercept syscall(SYS_close, fd) that's used instead of close(fd); on Linux. That leads to false positives as Thread Sanitizer thinks the descriptor is still being used by the thread. clang defines pre- and post- syscall actions, so wrap the close syscall() into the action macros. For gcc, use close() from glibc instead of the syscall. This allows the thread sanitizer to intercept closing of the file descriptor when libuv is compiled with Thread Sanitizer. PR-URL: #3112 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Landed in c3fe3cf. Thanks! |
Thread Sanitizer can't intercept syscall(SYS_close, fd) that's used instead of close(fd); on Linux. That leads to false positives as Thread Sanitizer thinks the descriptor is still being used by the thread. clang defines pre- and post- syscall actions, so wrap the close syscall() into the action macros. For gcc, use close() from glibc instead of the syscall. This allows the thread sanitizer to intercept closing of the file descriptor when libuv is compiled with Thread Sanitizer. PR-URL: libuv#3112 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Thread Sanitizer doesn't intercept syscall(SYS_close, fd) that's used
instead of close(fd); on Linux. That leads to false positives as Thread
Sanitizer thinks the descriptor is still being used by the thread.
Disabling the usage of SYS_close won't help in common case where the
libuv is not instrumented, but at least it gives the developers an
option to prepare a Thread Sanitizer compatible build by compiling an
instrumented version.
Some extra notes:
SYS_close
? I understand the need ofsyscalls()
for interfaces that might not be in libc, but is that really necessary forclose()
?