Skip to content

Commit

Permalink
macOS: print stackoverflow warning if the overflow happened inside GC (
Browse files Browse the repository at this point in the history
…#55211)

See discussion in #55192.

I'm not sure how easy it is to recover from a stack overflow inside the
GC (or whether we should even try to do it), but we should at least
print a stack overflow warning here IMO.
  • Loading branch information
d-netto authored Jul 22, 2024
1 parent 06467eb commit b75c133
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/signals-mach.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,13 @@ static void segv_handler(int sig, siginfo_t *info, void *context)
jl_task_t *ct = jl_get_current_task();
jl_ptls_t ptls = ct == NULL ? NULL : ct->ptls;
jl_call_in_state(ptls, (host_thread_state_t*)jl_to_bt_context(context), &jl_sig_throw);
return;
}
else {
sigdie_handler(sig, info, context);
jl_task_t *ct = jl_get_current_task();
if ((sig != SIGBUS || info->si_code == BUS_ADRERR) && is_addr_on_stack(ct, info->si_addr)) { // stack overflow and not a BUS_ADRALN (alignment error)
stack_overflow_warning();
}
sigdie_handler(sig, info, context);
}

// n.b. mach_exc_server expects us to define this symbol locally
Expand Down

0 comments on commit b75c133

Please sign in to comment.