Files
reverse-engineering-anything/docs/guides/runtime
morluto 4d84c6919f fix(frida): recover detached sessions and report why Frida detached them (#15357)
* fix(frida): give detached and unknown sessions lifecycle recovery

A session whose target detached was refused with the unknown-session error,
"No open Frida session; start one with start_frida_session", although the
session is still held, frida_session_status still returns its remaining
messages and close_frida_session must still release it. Following the advice
abandoned the session and its messages.

load_frida_script and resume_frida_session now refuse a detached session with
a capability refusal naming frida_session_status, then close_frida_session.
Unknown session and script IDs conform to the input contract, so their
recovery names the lifecycle tools instead of schema guidance, matching the
gdb and rizin session errors.

Refs #15329

* fix(frida): track session phase and report why a session detached

ManagedSession kept attachment as a `detached` boolean beside
`cleanupStarted` and `resumeAfterDetachPending`, and the `detached`
signal handler ignored Frida's (reason, crash) arguments, so an agent
could see that a session detached but not whether the target exited,
crashed, or the connection dropped.

The session now has one phase: attached, detached with its detachment,
or closing with the detachment seen so far and whether a paused spawn
still owes a resume. The signal arguments are parsed at the native
boundary; a detach seen only through isDetached() is recorded as
`unobserved`. frida_session_status, start_frida_session and
instrument_with_frida report an optional `detachment` with Frida's
reason and crash summary, and the detached-session refusal names the
reason. close_frida_session cleanup is unchanged.

Refs #15329

* fix(frida): report whether a retained crash summary was truncated

A crash summary is bounded to 4096 bytes; detachment output now carries
crash_summary_truncated so a clipped summary is not presented as
complete. The detached-session test also proves messages captured before
the detach stay readable. Commits the advertised schema summary for
start_frida_session.

* docs(frida): state why the crash summary bound is fixed

* fix(frida): keep Frida's one-line crash summary complete instead of capping it

The 4096-byte cap had no format, protocol or resource reason, and cutting
the summary left no way to read the rest. The summary is now kept whole
apart from credential redaction, so the truncation flag and constant are
removed.
2026-12-01 02:36:09 +00:00
..