Skip to content

Commit 6c5527c

Browse files
authored
Fix segfault on throwing during startup (#36686)
This happens, for example, for invalid CPU name.
1 parent 353e129 commit 6c5527c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/task.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,9 @@ void JL_NORETURN throw_internal(jl_value_t *exception JL_MAYBE_UNROOTED)
470470
ptls->io_wait = 0;
471471
if (ptls->safe_restore)
472472
jl_longjmp(*ptls->safe_restore, 1);
473+
// During startup
474+
if (!ptls->current_task)
475+
jl_no_exc_handler(exception);
473476
JL_GC_PUSH1(&exception);
474477
jl_gc_unsafe_enter(ptls);
475478
if (exception) {

0 commit comments

Comments
 (0)