Skip to content

Commit

Permalink
linux: Handle process gone when detaching (#543)
Browse files Browse the repository at this point in the history
This is an attempt to handle the situation where the process has gone
away and we're shutting down. I've observed the system looping
attempting to move the state out of ATTACHED. It's possible that the
state machine here needs to be made more complex (ALREADY_ATTACHED is
misleading).

Informs #478.
  • Loading branch information
ajwerner authored Aug 30, 2024
1 parent 1f9e24e commit 2376f42
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/linux/frida-helper-backend.vala
Original file line number Diff line number Diff line change
Expand Up @@ -1931,6 +1931,10 @@ namespace Frida {
try {
yield suspend (null);
close ();
} catch (Error e) {
// If the process is gone, then there's no point in retrying.
if (e is Error.PROCESS_NOT_FOUND)
attach_state = ALREADY_ATTACHED;
} catch (GLib.Error e) {
}
}
Expand Down

0 comments on commit 2376f42

Please sign in to comment.