Skip to content

Commit

Permalink
fix deadlock in launch_and_init - don't hold dbgi scopes open too agg…
Browse files Browse the repository at this point in the history
…ressively, as we may need to eliminate dbgi which they refer to.
  • Loading branch information
ryanfleury committed Jan 27, 2024
1 parent f047a0b commit 04b5b36
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ctrl/ctrl_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1931,7 +1931,6 @@ ctrl_thread__launch_and_init(CTRL_Msg *msg)
{
ProfBeginFunction();
Temp scratch = scratch_begin(0, 0);
DBGI_Scope *scope = dbgi_scope_open();

//- rjf: launch
OS_LaunchOptions opts = {0};
Expand Down Expand Up @@ -2016,6 +2015,8 @@ ctrl_thread__launch_and_init(CTRL_Msg *msg)
// rjf: done with handshake -> ready to find entry point. search launched processes
case DEMON_EventKind_HandshakeComplete:
{
DBGI_Scope *scope = dbgi_scope_open();

// rjf: find entry point vaddr
for(U64 process_idx = 0; process_idx < run_ctrls.run_entity_count; process_idx += 1)
{
Expand Down Expand Up @@ -2187,6 +2188,8 @@ ctrl_thread__launch_and_init(CTRL_Msg *msg)
stop_event = event;
}
}

dbgi_scope_close(scope);
}break;
}
}
Expand Down Expand Up @@ -2232,7 +2235,6 @@ ctrl_thread__launch_and_init(CTRL_Msg *msg)
ctrl_c2u_push_events(&evts);
}

dbgi_scope_close(scope);
scratch_end(scratch);
ProfEnd();
}
Expand Down

0 comments on commit 04b5b36

Please sign in to comment.