Skip to content

Commit

Permalink
Don't try emergency debugging when the task hasn't had a thread-group…
Browse files Browse the repository at this point in the history
… assigned yet (rr will just crash)
  • Loading branch information
rocallahan committed Oct 14, 2023
1 parent f87e23d commit 403f1c6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -459,13 +459,15 @@ static void emergency_debug(Task* t) {

if (probably_not_interactive() && !Flags::get().force_things &&
!getenv("RUNNING_UNDER_TEST_MONITOR")) {
errno = 0;
FATAL()
CLEAN_FATAL()
<< "(session doesn't look interactive, aborting emergency debugging)";
}
if (!t->thread_group()) {
CLEAN_FATAL() << "(task is in a bad state, aborting emergency debugging)";
}

GdbServer::emergency_debug(t);
FATAL() << "Can't resume execution from invalid state";
CLEAN_FATAL() << "Can't resume execution from invalid state";
}

EmergencyDebugOstream::EmergencyDebugOstream(bool cond, const Task* t,
Expand Down

0 comments on commit 403f1c6

Please sign in to comment.