Skip to content

Commit

Permalink
Increase the signal stack size.
Browse files Browse the repository at this point in the history
This makes the SIGINT signal handler work in combination with ASAN.

(partially cherry picked from commit 03c3c70, ref #17727)
  • Loading branch information
maleadt committed Aug 21, 2016
1 parent 51d38f5 commit be350f2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
3 changes: 0 additions & 3 deletions src/julia_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ void jl_call_tracer(tracer_cb callback, jl_value_t *tracee);

extern size_t jl_page_size;
extern jl_function_t *jl_typeinf_func;
#if defined(JL_USE_INTEL_JITEVENTS)
extern unsigned sig_stack_size;
#endif

JL_DLLEXPORT extern int jl_lineno;
JL_DLLEXPORT extern const char *jl_filename;
Expand Down
12 changes: 4 additions & 8 deletions src/signals-unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,10 @@
#define HAVE_TIMER
#endif

#if defined(JL_USE_INTEL_JITEVENTS)
unsigned sig_stack_size = SIGSTKSZ;
#elif defined(_CPU_AARCH64_)
// The default SIGSTKSZ causes stack overflow in libunwind.
#define sig_stack_size (1 << 16)
#else
#define sig_stack_size SIGSTKSZ
#endif
// 8M signal stack, same as default stack size and enough
// for reasonable finalizers.
// Should also be enough for parallel GC when we have it =)
#define sig_stack_size (8 * 1024 * 1024)

static bt_context_t *jl_to_bt_context(void *sigctx)
{
Expand Down
7 changes: 0 additions & 7 deletions src/threading.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,13 +778,6 @@ void jl_init_threading(void)
jl_all_tls_states = &_jl_all_tls_states;
jl_n_threads = 1;

#if defined(__linux__) && defined(JL_USE_INTEL_JITEVENTS)
if (jl_using_intel_jitevents)
// Intel VTune Amplifier needs at least 64k for alternate stack.
if (SIGSTKSZ < 1<<16)
sig_stack_size = 1<<16;
#endif

ti_init_master_thread();
}

Expand Down

0 comments on commit be350f2

Please sign in to comment.