Skip to content

Commit

Permalink
Backport the signal stack size change from #17727.
Browse files Browse the repository at this point in the history
This makes the SIGINT signal handler work in combination with ASAN.
  • Loading branch information
maleadt committed Aug 20, 2016
1 parent 7ce1bed commit 467e181
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

3 comments on commit 467e181

@tkelman
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably best to open this as a PR against my backport PR branch

@maleadt
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so my branch is already fine then, right? It's based on release-0.5, and contains refs to all the PR's I merged into it. Or you can just merge it into #18156.

@tkelman
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be preferable to avoid needing to rebase my huge pr, would rather get the changes into that branch first. the other commits are missing the cherry-pick -x cross references.

Please sign in to comment.