Repository navigation
fix(ghidra): keep JVM warnings out of LaunchSupport output - #1698
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2375690842
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
TL;DR: Fixed: a HotSpot warning on standard output no longer breaks the Ghidra launch. With real Ghidra 12.1.4, the base commit failed and this PR passed. Still open: the warning now goes to stderr, and REA throws it away. Thanks, Petru101, for the fix and for the clear report. ResultsBase is 17f7040, where the PR branched. Head is 2375690.
Base throws an error about a bad LaunchSupport entry. The CLI shows "Ghidra headless launch failed". On a clean launch, the output files have the same sha256 (191efda12d91 prefix) and the JVM arguments match, 32 of 32.
Which warning lands on stdout. HotSpot's own log lines, like Why the real run needed a cgroup trick. REA clears One more thing. On head, that warning shows up nowhere in the CLI output. A search of the head logs for "Cgroup" found nothing. This matches the Codex review note. The stderr text is captured and then dropped. Not run
Commands# real warning on stdout, plain JVM
java -XX:+UseLargePages -version
# cgroup warning: run inside a delegated user scope (cgrun.sh moves the child to a sibling cgroup)
systemd-run --user --scope -q -p Delegate=yes -- cgrun.sh run-ghidra.sh base base-cgroup X=1
systemd-run --user --scope -q -p Delegate=yes -- cgrun.sh run-ghidra.sh head head-cgroup X=1
# run-ghidra.sh runs this inside the tree:
node scripts/rea.mjs analyze /tmp/pr1698/elf/hello --provider ghidra --format json
# launch code only
node direct-launch.mjs /tmp/pr1698/base
JTO=-XX:+UseLargePages node direct-launch.mjs /tmp/pr1698/head
# new test file, one run per Node (that Node first on PATH)
node scripts/run-development-tests.mjs focused tests/boundary/providers/ghidra/ghidraJavaLaunch.test.ts
# patch check on main
git diff 17f704050 237569084 | git apply --checkThe test program is a six-line C file: Test setup
🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊 |
dandgabr
left a comment
There was a problem hiding this comment.
Consolidated review
- P2 — Preserve JVM warnings in launch diagnostics.
GhidraJavaLaunch.tsnow directs JVM warnings tostderr, but bothexecFileOutputcall sites consume only.stdoutand discard.stderr. This hides warnings such as cgroup/resource-limit diagnostics from the launch result. Capture and surface the redirected stderr while keeping the machine-readable LaunchSupport output parseable. This consolidates the still-applicable inline finding; no additional actionable findings were confirmed.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 211c806b96
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dcb7173938
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@Petru101, thank you for tracking down how HotSpot’s warning output could break Ghidra’s machine-readable LaunchSupport response. Keeping the helper diagnostics while applying JVM flags only when the VM is identified makes the fix useful without assuming OpenJ9 behaves the same way. Welcome to REA! |
|
Thank you :) |
Summary
On POSIX, REA parses Ghidra LaunchSupport stdout as environment entries and JVM arguments. HotSpot unified-logging warnings can corrupt that output and prevent Ghidra sessions from opening. The reported reproduction uses Ubuntu 24.04 distrobox, Ghidra 12.1.4, and JDK 21.0.12, where a cgroup namespace warning produces
Invalid Ghidra LaunchSupport environment entry.For an identified HotSpot VM, both LaunchSupport probes now use
-Xlog:disable -Xlog:all=warning:stderr. VM identity comes fromjava.vm.namein the existing installation probe. OpenJ9, unrecognized VMs, and unavailable VM identity preserve their previous helper arguments. Successful helper stderr is retained in session diagnostics underlaunch_support, with its probe mode, original byte count, and truncation status. Completed probe warnings also survive parsing errors, later helper failures, cancellation, and incomplete cleanup. Retention uses the existing 8 KiB per-stream diagnostic budget and redacts the session transport credential before truncation.The analysis JVM arguments and Windows script launch are unchanged. CLI/MCP tool contracts and installation behavior are unchanged; diagnostics gain helper stderr and observed VM identity. Existing process ownership and cleanup responsibilities are preserved.
Review fixes
-Xlogsemantics.maininto the branch without conflicts.Validation
npm run check:ci,npm run docs:check, andnpm run verify:test-discovery: passed; all 951 test files discovered exactly once.