aboutsummaryrefslogtreecommitdiffstats
path: root/idatui/launch.py
diff options
context:
space:
mode:
authorblasty <blasty@local>2026-07-23 23:43:37 +0200
committerblasty <blasty@local>2026-07-23 23:43:37 +0200
commit0d7e5c7910ce05c1e8ce1237a14f6e4af9f90701 (patch)
tree17ffc98b1f01b5b473d4eadb7fd96d2da7dec571 /idatui/launch.py
parentux: show TUI chrome + a "loading…" overlay during binary open/analysis (diff)
downloadida-tui-0d7e5c7910ce05c1e8ce1237a14f6e4af9f90701.tar.gz
ida-tui-0d7e5c7910ce05c1e8ce1237a14f6e4af9f90701.tar.xz
ida-tui-0d7e5c7910ce05c1e8ce1237a14f6e4af9f90701.zip
launch: sweep a crashed worker's stale DB locks before starting the supervisor
A binary whose worker was hard-killed mid-analysis leaves unpacked .id0/.id1/ .id2/.nam/.til files (no .i64). The supervisor is seeded with the target and opens it on startup, so a wedged DB there crash-loops the whole supervisor ("Failed to open initial binary: Remote end closed connection") and the launcher reports "supervisor exited during startup" -- before the TUI's own open-time recovery can ever run. When the launcher is about to start a fresh supervisor (server is down, so nothing can hold the DB), proactively sweep the target's stale unpacked lock files first (never the packed .i64). Safe because no server == no live session. Verified: after clearing bash's stale locks the supervisor starts and stays up 20/20 checks over 20s with no crash loop and a clean log.
Diffstat (limited to 'idatui/launch.py')
-rw-r--r--idatui/launch.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/idatui/launch.py b/idatui/launch.py
index b02bf05..1acd99a 100644
--- a/idatui/launch.py
+++ b/idatui/launch.py
@@ -196,6 +196,15 @@ def main(argv: list[str] | None = None) -> int:
# 1) supervisor up (seed it with our target so its initial worker is useful)
if not args.no_server:
+ # If we're about to start a fresh supervisor (it's down), nothing holds
+ # this binary's DB, so clear any stale unpacked lock files a crashed
+ # worker left behind. The supervisor is seeded with this target and opens
+ # it on startup; a wedged DB there crash-loops the whole supervisor
+ # before the TUI's own recovery can ever run.
+ if binary is not None and not _server_up(*_server_addr(args.url)):
+ swept = _sweep_locks(binary)
+ if swept:
+ _log(f"cleared {swept} stale lock file(s) from a crashed worker")
if not _ensure_server(args.url, binary):
return 1
elif not _server_up(*_server_addr(args.url)):