Repository navigation
fix(ghidra): keep unreported Java bitness unknown - #2771
yasshmittal wants to merge 13 commits into
Conversation
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: 9b87b94ea1
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 257314dfd6
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9bc2145017
ℹ️ 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".
The Java probe substituted 0 when sun.arch.data.model was absent, so the Java check described the runtime as 0-bit and reported unsupported_version. Keep bitness null when it is not reported, describe it as unknown, and report version_unresolved when it is the only unestablished requirement. Admission still requires an established 64-bit JDK; known 32-bit runtimes remain unsupported_version. Fixes morluto#2532 Co-Authored-By: Claude Opus 5.5 <[email protected]>
A reported sun.arch.data.model that is not decimal was collapsed into the same null as an omitted property, losing the observed value. Keep it as unparsedBits and include it in the Java check detail, so absent and malformed reports remain distinguishable. Cover "64junk", which the original parseInt read as 64 and admitted. Co-Authored-By: Claude Opus 5.5 <[email protected]>
javaProperty matched surrounding whitespace with \s, which also consumes line breaks. An explicitly empty setting such as "sun.arch.data.model =" therefore took the following line as its value, and could not be told apart from an absent setting. Match horizontal whitespace only and return "" for an empty value. An empty java.version or java.home still cannot identify the runtime. Co-Authored-By: Claude Opus 5.5 <[email protected]>
An all-digit data model beyond the safe-integer range converted to a rounded number or Infinity, so the check detail reported a bitness that was never observed. Accept only an exactly representable decimal and keep any other reported text as unparsedBits. Co-Authored-By: Claude Opus 5.5 <[email protected]>
be06143 to
e8315ea
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e47205540
ℹ️ 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".
javaProperty trimmed all whitespace around a setting value, so a padded data model such as " 64 " was normalized to "64" and admitted as a 64-bit runtime, a whitespace-only value became "", and a java.home ending in a space lost it. -XshowSettings prints "<indent>key = value"; consume the delimiter and its single space, then keep the value verbatim. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 93d5f95610
ℹ️ 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".
|
Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open. Handled by contributor commit 93d5f95, preserved after live-head verification. The producer now consumes only the property delimiter's optional single formatting space and captures all remaining value whitespace verbatim. Padded numeric and whitespace-only reports therefore remain unknown and their source values survive diagnostics. The contributor added both regressions. I inspected the current parser, exact decimal validator, and bitness diagnostic consumers, then discarded my superseded equivalent local edit and fast-forwarded to their commit. Tests/checks/Java workloads were not run at the user's request. No related cleanup remains. |
|
The failing |
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ad062848f6
ℹ️ 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".
|
Source fixes and publication evidence for the review findings below. Tests and executable checks were skipped at the maintainer's request. Findings that still require a decision or execution evidence remain open. The Java probe parser discarded empty |
The incomplete Java observation cases took the rejection-diagnostics describe block past the 150-line max-lines-per-function limit enforced by lint. Move them, unchanged, into their own describe block. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks for taking the incomplete-observation change into this PR. I ran the checks you skipped against ad06284 (Windows 11 x64, Node 24.21.0):
I pushed a30bb98 without the local pre-push hook. The hook fails only on |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 38c6cde298
ℹ️ 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".
|
Source fixes and publication evidence for the review findings below. Tests and executable checks were skipped at the maintainer's request. Findings that still require a decision or execution evidence remain open. Addressed: Preserve known mismatch codes for incomplete Java probes. The reported trigger was: When a required property is empty but another retained fact already proves incompatibility—for example, Addressed: Keep runtime evidence in incomplete Java diagnostics. The reported trigger was: When |
|
Ran the skipped checks on 38c6cde (Windows 11 x64, Node 24.21.0):
|
|
Source fixes and publication evidence for the review findings below. Tests and executable checks were skipped at the maintainer's request. Findings that still require a decision or execution evidence remain open. The owner-level fix is public in |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b3f8d2c660
ℹ️ 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".
| const javaProperty = (output: string, name: string): string | null => | ||
| new RegExp( | ||
| `^\\s*${name.replaceAll(".", "\\.")}\\s*=\\s*(.+?)\\s*$`, | ||
| `^[ \\t]*${name.replaceAll(".", "\\.")}[ \\t]*= ?([^\\r\\n]*)$`, |
There was a problem hiding this comment.
Stop values at Unicode line separators
When a selected Java launcher emits U+2028 or U+2029 line separators (reproduced with the installed OpenJDK 25 using line.separator), this negated class does not stop at the separator even though the regex's m-mode $ recognizes it as a line boundary. The greedy capture therefore folds all following settings into java.version, java.home, and sun.arch.data.model, causing a valid JDK to be reported as runtime-only with unknown bitness instead of preserving the individual observations; exclude every ECMAScript line terminator or split the output using the same line grammar.
AGENTS.md reference: AGENTS.md:L29-L29
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b7bb6d0ea6
ℹ️ 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".
| if (observation.bits !== null) return `${String(observation.bits)}-bit`; | ||
| return observation.unparsedBits === undefined | ||
| ? "bitness unknown" | ||
| : `bitness unknown (sun.arch.data.model = ${JSON.stringify(observation.unparsedBits)})`; |
There was a problem hiding this comment.
Bound malformed bitness text in diagnostics
When a selected Java launcher emits a malformed sun.arch.data.model line near the 1 MiB probe budget, this renders the entire retained value into check.detail. ghidraInstallationDiagnostics and the doctor projection publish that string (and the doctor report carries both provider and projected checks), so one malformed property can produce megabyte-scale provider/CLI output and consume an agent context even though only a preview plus length/digest is needed; retain the source observation separately but bound the displayed diagnostic.
AGENTS.md reference: AGENTS.md:L41-L45
Useful? React with 👍 / 👎.
Share tagged readiness observations, retain partial provider facts, authenticate bridge identity, bound diagnostics, and preserve cancellation and lost-session reasons. Fail closed for unparsed MIPS ABI attributes and macOS saved Hopper databases without a script-capable bridge route. Reviewed fixes: #2010, #2108, #2513, #2695, #2731, #2771, #2828, #2867, #2868, #2870, #2880, #2919, #2945, #2961, #2981, #2998, #3000, #3002. Validation: 285 focused source/boundary tests passed. Real Ghidra, IDA, Linux Hopper, and Windows provider runs were not repeated. BREAKING CHANGE: MIPS targets with unresolved GNU ABI attributes and saved Hopper databases on macOS are refused rather than advertised as supported.
…ases The incomplete-evidence matrix read `name` without destructuring it from the case, which fails typechecking (TS2304) and makes every case throw. Destructure `name` so each case selects its expected check code. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks @morluto for including #2771 and #2867 in d4bd65c, and for all the review work on both. If it's easy in future batch merges, a |
|
Compared this PR with main Main already preserves unknown/malformed Java bitness. The remaining distinct case here is successful probe output with empty java.version or java.home: main discards that result, losing partial observations. Please narrow the PR around that partial-evidence ownership. Keep known JDK/JRE, VM name, bitness and source property facts even when identity is incomplete; report known mismatches only from safely parsed values and resolved bounds, and retain unknowns otherwise. The existing branch review updates address these details in source, but this triage comparison does not supply the missing executed verification. PR head reviewed: |
|
Backlog check: this PR remains open. Full qualification was requested with Please resolve the conflicts and push the updated branch so CI can qualify the new revision. The |
Summary
Fixes #2532.
When the Java settings probe reported version, home and VM name but omitted
sun.arch.data.model, Ghidra inspection and doctor described the runtime as0-bitand returnedunsupported_version. The probe never established a bitness, so the result stated a measurement that did not exist.Problem and expected behavior
The probe parser in
src/ghidra/GhidraInstallation.tssubstituted"0"for the absent property, and the Java check formatted that as a determined0-bitruntime. AGENTS.md requires unresolved identity to stay unknown. Admission must still be refused until a 64-bit JDK is established, but without claiming a measured incompatible bitness.Change and scope
GhidraJavaObservation.bitsis nownumber | null. The parser returnsnullwhen the property is absent or is not a decimal value.unparsedBits, so absent and malformed reports stay distinguishable (review feedback).javaPropertymatches horizontal whitespace only, so an explicitly empty setting returns""instead of absorbing the next line (review feedback). An emptyjava.versionorjava.homestill cannot identify the runtime.bitness unknownorbitness unknown (sun.arch.data.model = "64-bit")and still fails.version_unresolved. Known mismatches (32-bit, JRE, wrong major version) keepunsupported_version.Judgment call for review: the issue does not name a code for unknown bitness. I chose the existing
version_unresolvedbecause the runtime's required identity is unresolved rather than known to be incompatible. If you prefer to keepunsupported_version, that is a one-line change and thebitness unknownwording fix stands on its own.Contribution scope: an ordinary fix within existing boundaries; no maintainer scope decision applies.
Contract and boundary impact
Semantic owner and earliest changed stage: Java settings parsing in the system Ghidra installation host (
probeJava).Contribution scope fit and linked maintainer decision: not applicable (bug fix).
CLI and MCP/tool-catalog contract: the doctor/provider Java check detail changes from
0-bittobitness unknown, and its code becomesversion_unresolvedin that case. No schema change.Provider, bridge, target-format, or platform compatibility: JDKs that report bitness behave exactly as before.
Evidence, artifact, provenance, or reconstruction contract: unchanged.
Target selection, authority, upstream behavior, and cleanup details: Ghidra is not launched; admission still requires an established 64-bit JDK.
Generated metadata, package, or installation impact: none.
Read existing files or captured data.
Launch or attach to a process. (Existing behavior: the
java -XshowSettings:properties -versionprobe, unchanged.)Evidence and regression coverage
Tests added or updated:
tests/boundary/filesystem/ghidraJavaProbe.test.ts: the real parser on probe output withoutsun.arch.data.modelgives a failed check,version_unresolved, and detail21.0.11; bitness unknown; JDK;. An emptysun.arch.data.model =line keeps""instead of reading the next line. A lossy9007199254740993keeps its text instead of reporting9007199254740992-bit. A malformed64junkgivesversion_unresolvedand retains the reported text; on the base revisionparseIntread it as 64 and the check passed. A32control gives32-bitandunsupported_version.src/ghidra/GhidraInstallation.test.ts: two rows in the existing check-code table (32-bit and unreported bitness).Base reproduction or other evidence: run against the base
GhidraInstallation.ts, the new boundary test fails with detail21.0.11; 0-bit; JDK; …; with this change it passes.User-visible CLI/MCP output: Java check detail
21.0.11; bitness unknown; JDK; <home>; accepted a 64-bit full JDK 21 or newer.Remaining proof gaps: no real JDK that omits the property is known; this was exercised with controlled probe output, as in the issue.
Observed, derived, and inferred claims remain distinguishable.
Artifact identity, source provenance, and failed attempts remain preserved.
Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.
Validation performed
Host: Windows 11, Node.js 24.21.0.
npx vitest run --project boundary tests/boundary/filesystem/ghidraJavaProbe.test.ts: 8 passed (fails on the base revision as described above).npm run test:local -- src/ghidra/GhidraInstallation.test.ts: 53 passed.npm run check: passed.npm run verify:test-discovery: passed.Compatibility, safety, and release
Before merge
type(scope): outcome.🤖 Generated with Claude Code