-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[compiler-rt][rtsan] Fix recvmmsg rtsan interceptor for glibc < 2.21 #123664
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
Conversation
cc @Zentrik would you mind trying the build when you get the chance ? |
@llvm/pr-subscribers-compiler-rt-sanitizer Author: David CARLIER (devnexen) Changeslinux/glibc prior to 2.21 had a different signature for recvmmsg. Full diff: https://github.com/llvm/llvm-project/pull/123664.diff 1 Files Affected:
diff --git a/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp b/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
index 34c2d4cb37fd0c..2d8ab696835081 100644
--- a/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
+++ b/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
@@ -927,8 +927,13 @@ INTERCEPTOR(ssize_t, recvmsg, int socket, struct msghdr *message, int flags) {
}
#if SANITIZER_INTERCEPT_RECVMMSG
+#if defined(__GLIBC_MINOR__) && __GLIBC_MINOR__ < 21
+INTERCEPTOR(int, recvmmsg, int socket, struct mmsghdr *message,
+ unsigned int len, int flags, const struct timespec *timeout) {
+#else
INTERCEPTOR(int, recvmmsg, int socket, struct mmsghdr *message,
unsigned int len, int flags, struct timespec *timeout) {
+#endif
__rtsan_notify_intercepted_call("recvmmsg");
return REAL(recvmmsg)(socket, message, len, flags, timeout);
}
|
Worked for me thanks. |
INTERCEPTOR(int, recvmmsg, int socket, struct mmsghdr *message, | ||
unsigned int len, int flags, struct timespec *timeout) { | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have a comment here saying what this is finishing
#endif defined(GLIBC_MINOR) && GLIBC_MINOR < 21
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM
Noticed in the code these macros haven't been used in other compiler-rt code so pinging @fmayer to take a peek and see if this is OK
I may have to commit soon some people start to be annoyed. Cheers. |
I would prefer a more self contained commit message that doesn't require me to look up another CL. "Fix recvmsg interceptor [..]"? |
I think this is fine, because it only cares about build time checks, the ABI should be the same for both versions. |
e5b02db
to
e08634b
Compare
linux/glibc prior to 2.21 had a different signature for recvmmsg. Fix llvm#123484
e08634b
to
c300775
Compare
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/73/builds/12110 Here is the relevant piece of the build log for the reference
|
This is not sufficient as musl targets are still failing, please look at the issue |
Normally should be fixed by #123907 |
linux/glibc prior to 2.21 had a different signature for recvmmsg.