[GH-ISSUE #4560] [Bug] Failing Java prerequisite commands are reported as missing and lose process outcomes #2373

Closed
opened 2026-10-17 21:03:51 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @morluto on GitHub (Oct 16, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/4560

Before submitting

  • Searched open and closed issues for related reports.
  • Removed credentials and sensitive target data.

Area

Provider or capability discovery

Observed behavior

A configured Java command that starts and exits 7 is reported by rea doctor --provider ghidra --json as missing_dependency. Its stderr and exit status disappear; the detail is only the command path.

Reproduction

Ran once on source 8116dc06512b4609d8db63cebc9f2ff8cb964151 with Node 24.18.0 on macOS arm64. Created a temporary JAVA_HOME/bin/java executable with the pinned Node shebang and body process.stderr.write("controlled java runtime failure\n"); process.exit(7);, then ran the compiled public doctor CLI with that JAVA_HOME. The controlled prerequisite program ran; doctor exited 1 and returned the evidence below. Temporary fixture was removed. This is a controlled executable fixture, not a real JVM crash reproduction.

Expected behavior

Keep the producer's process outcome and classify a present but failing runtime separately from an absent command. Malformed successful property output should remain unresolved, not prove absence. Existing runtime_missing, runtime_unavailable, and version_unresolved rejection reasons support this distinction.

Impact and scope

Observed once through public CLI before target admission. Provider discovery shares this probe. Other platforms and real JVM failure modes: NOT_ENOUGH_INFO; not rerun.

REA version

8116dc0651 (6.5.0 source)

Runtime and platform

Node 24.18.0, macOS arm64. Controlled Node prerequisite executable; no Ghidra analysis launched.

Target and artifact context

No target opened. Java prerequisite probe only.

Interface

CLI

Earliest failure stage

Setup or provider admission

Relevant output or evidence

ghidra-java: ok:false, classification:"missing_dependency", detail:"<fixture JAVA_HOME>/bin/java"; remediation asks to update JAVA_HOME. Producer emitted controlled java runtime failure and exited 7. Exact temporary pathname is irrelevant to classification and was removed.

Typed outcome or recovery expected

Return actionable runtime-failure diagnostics with bounded process output; reserve missing-command classification for observed command absence.

Analysis or suspected cause

Source-confirmed: systemGhidraInstallationHost().probeJava returns undefined for any spawn error, nonzero exit, or missing Java properties. javaCheck maps that single value to runtime_missing, and doctor projects it to missing_dependency. The probe result representation loses the producing facts before consumers can distinguish these cases.

Additional context

Related #4556 concerns an installed keg-only JDK not found by discovery; this finding concerns a selected command that actually ran and failed. No automatic JDK selection, installation, or broader execution capability is proposed.

Originally created by @morluto on GitHub (Oct 16, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/4560 ### Before submitting - [x] Searched open and closed issues for related reports. - [x] Removed credentials and sensitive target data. ### Area Provider or capability discovery ### Observed behavior A configured Java command that starts and exits 7 is reported by `rea doctor --provider ghidra --json` as `missing_dependency`. Its stderr and exit status disappear; the detail is only the command path. ### Reproduction Ran once on source `8116dc06512b4609d8db63cebc9f2ff8cb964151` with Node 24.18.0 on macOS arm64. Created a temporary `JAVA_HOME/bin/java` executable with the pinned Node shebang and body `process.stderr.write("controlled java runtime failure\n"); process.exit(7);`, then ran the compiled public doctor CLI with that JAVA_HOME. The controlled prerequisite program ran; doctor exited 1 and returned the evidence below. Temporary fixture was removed. This is a controlled executable fixture, not a real JVM crash reproduction. ### Expected behavior Keep the producer's process outcome and classify a present but failing runtime separately from an absent command. Malformed successful property output should remain unresolved, not prove absence. Existing `runtime_missing`, `runtime_unavailable`, and `version_unresolved` rejection reasons support this distinction. ### Impact and scope Observed once through public CLI before target admission. Provider discovery shares this probe. Other platforms and real JVM failure modes: NOT_ENOUGH_INFO; not rerun. ### REA version 8116dc06512b4609d8db63cebc9f2ff8cb964151 (6.5.0 source) ### Runtime and platform Node 24.18.0, macOS arm64. Controlled Node prerequisite executable; no Ghidra analysis launched. ### Target and artifact context No target opened. Java prerequisite probe only. ### Interface CLI ### Earliest failure stage Setup or provider admission ### Relevant output or evidence `ghidra-java`: `ok:false`, `classification:"missing_dependency"`, `detail:"<fixture JAVA_HOME>/bin/java"`; remediation asks to update JAVA_HOME. Producer emitted `controlled java runtime failure` and exited 7. Exact temporary pathname is irrelevant to classification and was removed. ### Typed outcome or recovery expected Return actionable runtime-failure diagnostics with bounded process output; reserve missing-command classification for observed command absence. ### Analysis or suspected cause Source-confirmed: `systemGhidraInstallationHost().probeJava` returns undefined for any spawn error, nonzero exit, or missing Java properties. `javaCheck` maps that single value to `runtime_missing`, and doctor projects it to `missing_dependency`. The probe result representation loses the producing facts before consumers can distinguish these cases. ### Additional context Related #4556 concerns an installed keg-only JDK not found by discovery; this finding concerns a selected command that actually ran and failed. No automatic JDK selection, installation, or broader execution capability is proposed.
Author
Owner

@nikhilsaxena04 commented on GitHub (Oct 16, 2026):

This appears to already be resolved on main via commit c75cf827e (fix(ghidra): preserve Java probe failure details and exit codes).

<!-- gh-comment-id:6224427134 --> @nikhilsaxena04 commented on GitHub (Oct 16, 2026): This appears to already be resolved on `main` via commit c75cf827e (`fix(ghidra): preserve Java probe failure details and exit codes`).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2373
No description provided.