Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 861837 Details for
Bug 906603
llvm-runtimes/compiler-rt-sanitizers: clang -fsanitize=memory (msan) broken w/ sys-libs/musl-1.2.4
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
0001-msan-Don-t-intercept-LFS-prlimit64-getrlimi64-on-mus.patch
0001-msan-Don-t-intercept-LFS-prlimit64-getrlimi64-on-mus.patch (text/plain), 3.13 KB, created by
Sam James
on 2023-05-17 10:25:04 UTC
(
hide
)
Description:
0001-msan-Don-t-intercept-LFS-prlimit64-getrlimi64-on-mus.patch
Filename:
MIME Type:
Creator:
Sam James
Created:
2023-05-17 10:25:04 UTC
Size:
3.13 KB
patch
obsolete
>From a137eae24b31212fa35df0f814aacc767bbd08de Mon Sep 17 00:00:00 2001 >From: Sam James <sam@gentoo.org> >Date: Wed, 17 May 2023 11:19:13 +0100 >Subject: [PATCH] [msan] Don't intercept LFS prlimit64/getrlimi64 on musl > >These are aliases on musl and as of 1.2.4, aren't visible by default >(only with -D_LARGEFILE64_SOURCE), and will be removed entirely in a future >release. > >This fixes a runtime failure with msan on musl-1.2.4: >``` >$ echo 'int main(){}' | clang -x c - -fsanitize=memory -o /dev/null >/usr/bin/x86_64-gentoo-linux-musl-ld.bfd: /usr/lib/llvm/16/bin/../../../../lib/clang/16/lib/linux/libclang_rt.msan-x86_64.a(msan_interceptors.cpp.o): in function `__interceptor_getrlimit64': >[...] >``` > >Bug: https://bugs.gentoo.org/906603 >Signed-off-by: Sam James <sam@gentoo.org> >--- > compiler-rt/lib/msan/msan_interceptors.cpp | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > >diff --git a/compiler-rt/lib/msan/msan_interceptors.cpp b/compiler-rt/lib/msan/msan_interceptors.cpp >index 8cf724b3949f..3ebcc7f26bf9 100644 >--- a/compiler-rt/lib/msan/msan_interceptors.cpp >+++ b/compiler-rt/lib/msan/msan_interceptors.cpp >@@ -678,7 +678,7 @@ INTERCEPTOR(int, fstat, int fd, void *buf) { > #define MSAN_MAYBE_INTERCEPT_FSTAT > #endif > >-#if SANITIZER_STAT_LINUX >+#if SANITIZER_GLIBC > INTERCEPTOR(int, fstat64, int fd, void *buf) { > ENSURE_MSAN_INITED(); > int res = REAL(fstat64)(fd, buf); >@@ -825,6 +825,7 @@ INTERCEPTOR(int, __getrlimit, int resource, void *rlim) { > INTERCEPTOR_GETRLIMIT_BODY(__getrlimit, resource, rlim); > } > >+#if SANITIZER_GLIBC > INTERCEPTOR(int, getrlimit64, int resource, void *rlim) { > if (msan_init_is_running) return REAL(getrlimit64)(resource, rlim); > ENSURE_MSAN_INITED(); >@@ -832,6 +833,9 @@ INTERCEPTOR(int, getrlimit64, int resource, void *rlim) { > if (!res) __msan_unpoison(rlim, __sanitizer::struct_rlimit64_sz); > return res; > } >+#else >+#define MSAN_MAYBE_INTERCEPT_GETRLIMIT64 INTERCEPT_FUNCTION(getrlimit64) >+#endif > > INTERCEPTOR(int, prlimit, int pid, int resource, void *new_rlimit, > void *old_rlimit) { >@@ -844,6 +848,7 @@ INTERCEPTOR(int, prlimit, int pid, int resource, void *new_rlimit, > return res; > } > >+#if SANITIZER_GLIBC > INTERCEPTOR(int, prlimit64, int pid, int resource, void *new_rlimit, > void *old_rlimit) { > if (msan_init_is_running) >@@ -854,6 +859,9 @@ INTERCEPTOR(int, prlimit64, int pid, int resource, void *new_rlimit, > if (!res) __msan_unpoison(old_rlimit, __sanitizer::struct_rlimit64_sz); > return res; > } >+#else >+#define MSAN_MAYBE_INTERCEPT_PRLIMIT64 INTERCEPT_FUNCTION(prlimit64) >+#endif > > #define MSAN_MAYBE_INTERCEPT___GETRLIMIT INTERCEPT_FUNCTION(__getrlimit) > #define MSAN_MAYBE_INTERCEPT_GETRLIMIT64 INTERCEPT_FUNCTION(getrlimit64) >@@ -1777,9 +1785,13 @@ void InitializeInterceptors() { > MSAN_MAYBE_INTERCEPT_FGETS_UNLOCKED; > INTERCEPT_FUNCTION(getrlimit); > MSAN_MAYBE_INTERCEPT___GETRLIMIT; >+#if SANITIZER_GLIBC > MSAN_MAYBE_INTERCEPT_GETRLIMIT64; >+#endif > MSAN_MAYBE_INTERCEPT_PRLIMIT; >+#if SANITIZER_GLIBC > MSAN_MAYBE_INTERCEPT_PRLIMIT64; >+#endif > INTERCEPT_FUNCTION(gethostname); > MSAN_MAYBE_INTERCEPT_EPOLL_WAIT; > MSAN_MAYBE_INTERCEPT_EPOLL_PWAIT; >-- >2.40.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 906603
: 861837