Skip to content

Commit

Permalink
Fix dyld lock not getting unlocked on invalid threads. (JuliaLang#49446)
Browse files Browse the repository at this point in the history
  • Loading branch information
gbaraldi authored Apr 29, 2023
1 parent faced27 commit b4d1530
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/signals-mach.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,12 +614,12 @@ void *mach_profile_listener(void *arg)
if (_dyld_atfork_prepare != NULL && _dyld_atfork_parent != NULL)
_dyld_atfork_prepare(); // briefly acquire the dlsym lock
host_thread_state_t state;
if (!jl_thread_suspend_and_get_state2(i, &state))
continue;
int valid_thread = jl_thread_suspend_and_get_state2(i, &state);
unw_context_t *uc = (unw_context_t*)&state;
if (_dyld_atfork_prepare != NULL && _dyld_atfork_parent != NULL)
_dyld_atfork_parent(); // quickly release the dlsym lock

if (!valid_thread)
continue;
if (running) {
#ifdef LLVMLIBUNWIND
/*
Expand Down

0 comments on commit b4d1530

Please sign in to comment.