Skip to content

Commit 2e17bb5

Browse files
committed
ASAN fixes.
1 parent 86cbb60 commit 2e17bb5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/dlload.c

Lines changed: 1 addition & 1 deletion
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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2159,9 +2159,14 @@ void (ijl_longjmp)(jmp_buf _Buf, int _Value);
21592159
#define jl_setjmp(a,b) sigsetjmp(a,b)
21602160
#if defined(_COMPILER_ASAN_ENABLED_) && __GLIBC__
21612161
// Bypass the ASAN longjmp wrapper - we're unpoisoning the stack ourselves.
2162+
#if !__GLIBC_PREREQ(2, 34)
21622163
JL_DLLIMPORT int __attribute__ ((nothrow)) (__libc_siglongjmp)(jl_jmp_buf buf, int val);
21632164
#define jl_longjmp(a,b) __libc_siglongjmp(a,b)
21642165
#else
2166+
// This broke with glibc 2.34, where the __libc_siglongjmp symbol was removed
2167+
#define jl_longjmp(a,b) siglongjmp(a,b)
2168+
#endif
2169+
#else
21652170
#define jl_longjmp(a,b) siglongjmp(a,b)
21662171
#endif
21672172
#endif

0 commit comments

Comments
 (0)