Skip to content

Commit

Permalink
ASAN: provide default options.
Browse files Browse the repository at this point in the history
(cherry picked from commit 2d9f3a7, ref #18067)
  • Loading branch information
maleadt committed Aug 21, 2016
1 parent be350f2 commit 727daa6
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ extern BOOL (WINAPI *hSymRefreshModuleList)(HANDLE);
#include <unistd.h>
#endif

#ifdef JL_ASAN_ENABLED
JL_DLLEXPORT const char* __asan_default_options() {
return "allow_user_segv_handler=1:detect_leaks=0";
// FIXME: enable LSAN after fixing leaks & defining __lsan_default_suppressions(),
// or defining __lsan_default_options = exitcode=0 once publicly available
}
#endif

static const char system_image_path[256] = "\0" JL_SYSTEM_IMAGE_PATH;

jl_options_t jl_options = { 0, // quiet
Expand Down Expand Up @@ -628,17 +636,6 @@ void _julia_init(JL_IMAGE_SEARCH rel)
}
#endif


#ifdef JL_ASAN_ENABLED
const char *asan_options = getenv("ASAN_OPTIONS");
if (!asan_options || !(strstr(asan_options, "allow_user_segv_handler=1") ||
strstr(asan_options, "handle_segv=0"))) {
jl_printf(JL_STDERR,"WARNING: ASAN overrides Julia's SIGSEGV handler; "
"disable SIGSEGV handling or allow custom handlers.\n");
}

#endif

jl_init_threading();

jl_gc_init();
Expand Down

0 comments on commit 727daa6

Please sign in to comment.