Skip to content

Commit e506dee

Browse files
authored
Update init.c for error on --handle-signals=no with multiple threads (#58464)
1 parent 6f52a98 commit e506dee

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/init.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,12 @@ static void restore_fp_env(void)
557557
if (jl_set_zero_subnormals(0) || jl_set_default_nans(0)) {
558558
jl_error("Failed to configure floating point environment");
559559
}
560+
if (jl_options.handle_signals == JL_OPTIONS_HANDLE_SIGNALS_OFF && jl_atomic_load_relaxed(&jl_n_threads) > 1) {
561+
jl_error("Cannot use `--handle-signals=no` with multiple threads (JULIA_NUM_THREADS > 1).\n"
562+
"This will cause segmentation faults due to GC safepoint failures.\n"
563+
"Remove `--handle-signals=no` or set JULIA_NUM_THREADS=1.\n"
564+
"See: https://github.com/JuliaLang/julia/issues/50278");
565+
}
560566
}
561567
static NOINLINE void _finish_jl_init_(jl_image_buf_t sysimage, jl_ptls_t ptls, jl_task_t *ct)
562568
{

0 commit comments

Comments
 (0)