Skip to content

Commit c03702a

Browse files
committed
ASAN fixes.
1 parent 86cbb60 commit c03702a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/dlload.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ JL_DLLEXPORT JL_NO_SANITIZE void *jl_dlopen(const char *filename, unsigned flags
188188
dlopen = (dlopen_prototype*)dlsym(RTLD_NEXT, "dlopen");
189189
if (!dlopen)
190190
return NULL;
191-
void *libdl_handle = dlopen("libdl.so", RTLD_NOW | RTLD_NOLOAD);
191+
void *libdl_handle = dlopen("libdl.so.2", RTLD_NOW | RTLD_NOLOAD);
192192
assert(libdl_handle);
193193
dlopen = (dlopen_prototype*)dlsym(libdl_handle, "dlopen");
194194
dlclose(libdl_handle);

src/julia.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -2157,8 +2157,10 @@ void (ijl_longjmp)(jmp_buf _Buf, int _Value);
21572157
#define jl_setjmp_name "sigsetjmp"
21582158
#endif
21592159
#define jl_setjmp(a,b) sigsetjmp(a,b)
2160-
#if defined(_COMPILER_ASAN_ENABLED_) && __GLIBC__
2160+
#if defined(_COMPILER_ASAN_ENABLED_) && __GLIBC__ && !__GLIBC_PREREQ(2, 34)
21612161
// Bypass the ASAN longjmp wrapper - we're unpoisoning the stack ourselves.
2162+
// Note that this broke with glibc 2.34, where the __libc_siglongjmp symbol
2163+
// was made private, necessitating a different way to bypass the interceptor.
21622164
JL_DLLIMPORT int __attribute__ ((nothrow)) (__libc_siglongjmp)(jl_jmp_buf buf, int val);
21632165
#define jl_longjmp(a,b) __libc_siglongjmp(a,b)
21642166
#else

0 commit comments

Comments
 (0)