Skip to content

Fail fast on decompiler server startup errors#213

Merged
mahaloz merged 1 commit into
binsync:mainfrom
subwire:cli-startup-diagnostics
Jul 22, 2026
Merged

Fail fast on decompiler server startup errors#213
mahaloz merged 1 commit into
binsync:mainfrom
subwire:cli-startup-diagnostics

Conversation

@subwire

@subwire subwire commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • capture detached decompiler-server stdout/stderr in a per-server log beside its socket
  • monitor the spawned child while waiting for registry registration
  • fail immediately when the child exits, including its status, log path, and final 8 KiB of output
  • include the same bounded diagnostic tail on startup timeout
  • add decompiler load --timeout SECONDS (default remains 300 seconds)
  • return log_path when a new server starts successfully
  • document the behavior in the CLI guide and bundled agent skill

Motivation

decompiler load previously sent detached child output to /dev/null and only watched the registry. A missing dependency, license problem, socket failure, or backend crash therefore looked identical to slow analysis and consumed the full five-minute timeout.

We reproduced this both during an ENOWARS workload replay and locally. In the local regression case, angr initialized but the server could not bind its socket. Before this change, load waited 300 seconds and reported only a generic timeout. With this change, it failed in 2.9 seconds and surfaced the exact child error:

Decompiler server ... exited with status 1 before registering.
Server log: .../declib_server_.../server.log
Server log tail:
...
Failed to start server: [Errno 1] Operation not permitted

The configurable timeout also lets automation choose between a strict task budget and unusually slow initial Ghidra/IDA analysis.

Testing

  • lifecycle helper tests: early child exit, bounded log tail, timeout reporting, and parser contract — 5 passed
  • tests/test_artifacts.py plus backend-independent test_decompiler_cli.py cases — 28 passed, 209 skipped, 1 pre-existing environment-sensitive test deselected
  • documented core suite (tests/test_artifacts.py tests/test_cli.py) — 11 passed
  • end-to-end failure regression — returned the child error and log in 2.9 seconds instead of 300 seconds
  • end-to-end success regression — temporary angr server started in 2.2 seconds, JSON included an existing log_path, and the server stopped cleanly

The decompiler CI job now includes test_decompiler_cli.py, so the existing backend matrix also verifies that newly started IDA, Ghidra, Binary Ninja, and angr servers return a real log path where available.

@mahaloz

mahaloz commented Jul 22, 2026

Copy link
Copy Markdown
Member

LGTM!

@mahaloz
mahaloz merged commit bf2fcbb into binsync:main Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants