Skip to content

Commit 04b5b36

Browse files
committed
fix deadlock in launch_and_init - don't hold dbgi scopes open too aggressively, as we may need to eliminate dbgi which they refer to.
1 parent f047a0b commit 04b5b36

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ctrl/ctrl_core.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -1931,7 +1931,6 @@ ctrl_thread__launch_and_init(CTRL_Msg *msg)
19311931
{
19321932
ProfBeginFunction();
19331933
Temp scratch = scratch_begin(0, 0);
1934-
DBGI_Scope *scope = dbgi_scope_open();
19351934

19361935
//- rjf: launch
19371936
OS_LaunchOptions opts = {0};
@@ -2016,6 +2015,8 @@ ctrl_thread__launch_and_init(CTRL_Msg *msg)
20162015
// rjf: done with handshake -> ready to find entry point. search launched processes
20172016
case DEMON_EventKind_HandshakeComplete:
20182017
{
2018+
DBGI_Scope *scope = dbgi_scope_open();
2019+
20192020
// rjf: find entry point vaddr
20202021
for(U64 process_idx = 0; process_idx < run_ctrls.run_entity_count; process_idx += 1)
20212022
{
@@ -2187,6 +2188,8 @@ ctrl_thread__launch_and_init(CTRL_Msg *msg)
21872188
stop_event = event;
21882189
}
21892190
}
2191+
2192+
dbgi_scope_close(scope);
21902193
}break;
21912194
}
21922195
}
@@ -2232,7 +2235,6 @@ ctrl_thread__launch_and_init(CTRL_Msg *msg)
22322235
ctrl_c2u_push_events(&evts);
22332236
}
22342237

2235-
dbgi_scope_close(scope);
22362238
scratch_end(scratch);
22372239
ProfEnd();
22382240
}

0 commit comments

Comments
 (0)