[PR #1698] [MERGED] fix(ghidra): keep JVM warnings out of LaunchSupport output #4762

Closed
opened 2026-10-31 00:54:48 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1698
Author: @Petru101
Created: 10/11/2026
Status: ✅ Merged
Merged: 10/12/2026
Merged by: @morluto

Base: main ← Head: fix/ghidra-launchsupport-jvm-warnings


📝 Commits (5)

  • 2375690 fix(ghidra): keep JVM warnings out of LaunchSupport output
  • aa806af Merge remote-tracking branch 'origin/main' into fix/pr-1698-review
  • 211c806 fix(ghidra): retain LaunchSupport warnings in session diagnostics
  • dcb7173 fix(ghidra): select helper logging flags by observed JVM identity
  • 8cfa45f fix(ghidra): preserve diagnostics through typed failure projection

📊 Changes

15 files changed (+647 additions, -85 deletions)

View changed files

📝 src/domain/analysisErrorBase.ts (+9 -0)
📝 src/domain/analysisErrorProjection.test.ts (+27 -19)
📝 src/domain/analysisErrorProjection.ts (+3 -3)
📝 src/domain/explicitSensitiveFailure.test.ts (+60 -0)
📝 src/domain/explicitSensitiveFailure.ts (+46 -23)
📝 src/domain/providerAdapterError.ts (+0 -7)
📝 src/ghidra/GhidraDiagnostics.ts (+7 -0)
📝 src/ghidra/GhidraInstallation.ts (+9 -0)
📝 src/ghidra/GhidraJavaLaunch.ts (+11 -0)
📝 src/ghidra/GhidraLauncher.ts (+68 -8)
📝 src/ghidra/GhidraProvider.behavior.test.ts (+15 -1)
📝 src/ghidra/GhidraProviderClient.ts (+17 -13)
📝 src/ghidra/GhidraSessionError.ts (+17 -5)
📝 tests/boundary/filesystem/ghidraJavaProbe.test.ts (+13 -6)
➕ tests/boundary/providers/ghidra/ghidraJavaLaunch.test.ts (+345 -0)

📄 Description

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 from java.vm.name in the existing installation probe. OpenJ9, unrecognized VMs, and unavailable VM identity preserve their previous helper arguments. Successful helper stderr is retained in session diagnostics under launch_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

  • Addressed the review thread about silently discarded successful helper stderr.
  • Fixed the follow-up cancellation/timeout projection loss: diagnostics are retained by the shared analysis-error context and forwarded through every Ghidra typed mapping. Removed adapter-only diagnostic storage and projection.
  • Updated the existing explicit-sensitive-value redactor to preserve sanitized shared context, captured-output metadata, and cleanup facts. Replaced the cancellation test that bypassed provider projection with actual GhidraClient/provider regressions and serialized error-contract validation for caller cancellation and startup deadline.
  • Addressed the additional OpenJ9 compatibility thread by selecting flags from parsed VM identity without adding a launch-time probe. OpenJ9 documents different -Xlog semantics.
  • Replaced the fixture that suppressed warnings with one that emits them on stderr and verifies launcher diagnostics through success and failure paths.
  • Merged main into the branch without conflicts.

Validation

  • Ghidra focused suite: 28 files, 512 passed, 1 skipped.
  • npm run check:ci, npm run docs:check, and npm run verify:test-discovery: passed; all 951 test files discovered exactly once.
  • Launcher regressions cover both helper modes, malformed output, later command failure, bounded UTF-8 retention, explicit credential redaction, preservation of caller paths, and cancellation after process creation. Java-probe and provider tests verify VM identity parsing and forwarding; helper tests cover HotSpot, OpenJ9, unrecognized, and missing identities.
  • Real Ghidra 12.1.4 with Temurin 21.0.12.1 on macOS arm64: launched an ephemeral analysis, listed two procedures, retained real JVM warnings after client close, and confirmed the target digest was unchanged. The launcher used VM identity observed by the real installation probe. A temporary Java wrapper enabled an unsupported large-page option for the helper probes to produce real JVM stderr; the analysis JVM used its original arguments.
  • Real Ghidra 12.1.4/Temurin 21.0.12.1 on macOS arm64 also retained both helper warning records through the provider-neutral, JSON-serialized cancellation and timeout errors. This run used actual LaunchSupport probes and an owned analysis JVM, with abort/deadline injected after process creation; cleanup was confirmed and the target digest stayed unchanged.
  • Linux distrobox/cgroup before-and-after verification was reported by the contributor and an independent tester. The additional macOS run verifies warning retention with the real provider; it does not reproduce the Linux cgroup condition or establish Windows behavior. OpenJ9 flag selection is fixture-backed; a real OpenJ9 provider run was not performed.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/1698 **Author:** [@Petru101](https://github.com/Petru101) **Created:** 10/11/2026 **Status:** ✅ Merged **Merged:** 10/12/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/ghidra-launchsupport-jvm-warnings` --- ### 📝 Commits (5) - [`2375690`](https://github.com/morluto/rea/commit/2375690842bcab123a5569e393380b1c03a99017) fix(ghidra): keep JVM warnings out of LaunchSupport output - [`aa806af`](https://github.com/morluto/rea/commit/aa806afea5e1892f736bfb6305e3b4bef4efc202) Merge remote-tracking branch 'origin/main' into fix/pr-1698-review - [`211c806`](https://github.com/morluto/rea/commit/211c806b96fc659854b0f817269f40ea339c1bb2) fix(ghidra): retain LaunchSupport warnings in session diagnostics - [`dcb7173`](https://github.com/morluto/rea/commit/dcb71739387ce198e1c8aa0afbc049231f49f8f3) fix(ghidra): select helper logging flags by observed JVM identity - [`8cfa45f`](https://github.com/morluto/rea/commit/8cfa45f04d6e160c4cc5ea5c63519b5711f2caeb) fix(ghidra): preserve diagnostics through typed failure projection ### 📊 Changes **15 files changed** (+647 additions, -85 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/analysisErrorBase.ts` (+9 -0) 📝 `src/domain/analysisErrorProjection.test.ts` (+27 -19) 📝 `src/domain/analysisErrorProjection.ts` (+3 -3) 📝 `src/domain/explicitSensitiveFailure.test.ts` (+60 -0) 📝 `src/domain/explicitSensitiveFailure.ts` (+46 -23) 📝 `src/domain/providerAdapterError.ts` (+0 -7) 📝 `src/ghidra/GhidraDiagnostics.ts` (+7 -0) 📝 `src/ghidra/GhidraInstallation.ts` (+9 -0) 📝 `src/ghidra/GhidraJavaLaunch.ts` (+11 -0) 📝 `src/ghidra/GhidraLauncher.ts` (+68 -8) 📝 `src/ghidra/GhidraProvider.behavior.test.ts` (+15 -1) 📝 `src/ghidra/GhidraProviderClient.ts` (+17 -13) 📝 `src/ghidra/GhidraSessionError.ts` (+17 -5) 📝 `tests/boundary/filesystem/ghidraJavaProbe.test.ts` (+13 -6) ➕ `tests/boundary/providers/ghidra/ghidraJavaLaunch.test.ts` (+345 -0) </details> ### 📄 Description ## 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 from `java.vm.name` in the existing installation probe. OpenJ9, unrecognized VMs, and unavailable VM identity preserve their previous helper arguments. Successful helper stderr is retained in session diagnostics under `launch_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 - Addressed the review thread about silently discarded successful helper stderr. - Fixed the follow-up cancellation/timeout projection loss: diagnostics are retained by the shared analysis-error context and forwarded through every Ghidra typed mapping. Removed adapter-only diagnostic storage and projection. - Updated the existing explicit-sensitive-value redactor to preserve sanitized shared context, captured-output metadata, and cleanup facts. Replaced the cancellation test that bypassed provider projection with actual GhidraClient/provider regressions and serialized error-contract validation for caller cancellation and startup deadline. - Addressed the additional OpenJ9 compatibility thread by selecting flags from parsed VM identity without adding a launch-time probe. [OpenJ9 documents different `-Xlog` semantics](https://eclipse.dev/openj9/docs/xlog/). - Replaced the fixture that suppressed warnings with one that emits them on stderr and verifies launcher diagnostics through success and failure paths. - Merged `main` into the branch without conflicts. ## Validation - Ghidra focused suite: 28 files, 512 passed, 1 skipped. - `npm run check:ci`, `npm run docs:check`, and `npm run verify:test-discovery`: passed; all 951 test files discovered exactly once. - Launcher regressions cover both helper modes, malformed output, later command failure, bounded UTF-8 retention, explicit credential redaction, preservation of caller paths, and cancellation after process creation. Java-probe and provider tests verify VM identity parsing and forwarding; helper tests cover HotSpot, OpenJ9, unrecognized, and missing identities. - Real Ghidra 12.1.4 with Temurin 21.0.12.1 on macOS arm64: launched an ephemeral analysis, listed two procedures, retained real JVM warnings after client close, and confirmed the target digest was unchanged. The launcher used VM identity observed by the real installation probe. A temporary Java wrapper enabled an unsupported large-page option for the helper probes to produce real JVM stderr; the analysis JVM used its original arguments. - Real Ghidra 12.1.4/Temurin 21.0.12.1 on macOS arm64 also retained both helper warning records through the provider-neutral, JSON-serialized cancellation and timeout errors. This run used actual LaunchSupport probes and an owned analysis JVM, with abort/deadline injected after process creation; cleanup was confirmed and the target digest stayed unchanged. - Linux distrobox/cgroup before-and-after verification was reported by the contributor and an independent tester. The additional macOS run verifies warning retention with the real provider; it does not reproduce the Linux cgroup condition or establish Windows behavior. OpenJ9 flag selection is fixture-backed; a real OpenJ9 provider run was not performed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 00:54:48 +00:00
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#4762
No description provided.