[GH-ISSUE #1859] [Bug] Windows real-Ghidra verifiers fail on every host after #1635, #1419 and #1667 #633

Closed
opened 2026-10-15 18:26:48 +00:00 by bsakaguchi · 0 comments
Owner

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

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Native analysis or decompilation

Observed behavior

On real Windows x64, the real-Ghidra verification lanes fail although Ghidra starts, finishes auto-analysis and serves every read-only operation. There are two independent stale assertions in the verifiers:

  1. npm run verify:ghidra:windows (also -- --x86, -- --dll, -- --x86 --dll) stops at assertSession with Windows Ghidra session commitment drifted. The read-only Windows session reports 27 capabilities; the verifier expects 29. verify:ghidra:windows:package runs every MCP operation and then fails with Packaged verification omitted an admitted operation. for the same reason.
  2. Once (1) is fixed, verify:ghidra:windows:package fails at its last check: assert.deepEqual((await readdir(callerDirectory)).sort(), scriptCollisions) compares a sorted directory listing with a list that is no longer in sorted order.

Reproduction

On Windows x64 with Ghidra 12.1.4, a full JDK 21 and the matching native addon, at main (0b4ce836):

npm run verify:ghidra:windows
npm run verify:ghidra:windows:package

Expected behavior

The Windows P0 bridge is read-only, so the verifiers should expect every session capability except the mutating ones, which the Windows session correctly omits. The caller-script collision check should compare the same set of names regardless of order.

Impact and scope

Only the verifiers are wrong; the provider behaves correctly. But the real Windows Ghidra lanes cannot pass on any host, so they currently do not guard Windows regressions.

  1. #1635 added set_address_name and set_addresses_names to GHIDRA_SESSION_CAPABILITIES and to GHIDRA_MUTATING_OPERATIONS. The Windows verifiers still exclude only annotate_native_function by hand, in three places: scripts/verify-real-ghidra-windows.mjs (SESSION_CAPABILITIES, line 30, and the expected operations, line 237) and scripts/verify-packaged-ghidra-windows.mjs (the expected list, line 405).
  2. scriptCollisions in scripts/verify-packaged-ghidra-windows.mjs was sorted when #800 introduced the sorted comparison. #1419 appended ReaGhidraNoReturnFix.java and #1667 appended ReaGhidraApplySeeds.java, so the hand-written list is no longer in sorted order.

REA version

main at 0b4ce836 (package version 6.4.0)

Runtime and platform

Windows 11 Pro 26H2 (build 26300.9457) x64, Node.js 22.22.3, Ghidra 12.1.4, Temurin JDK 21.0.12.1, local NTFS, non-elevated user. Native addon built with npm run build:windows-native (mingw-w64 13, WSL Ubuntu).

Target and artifact context

The fixtures generated by build:ghidra-windows-fixture (x86-64 and x86 PE, EXE and DLL)

Interface

Other

Earliest failure stage

Setup or provider admission

Relevant output or evidence

Read-only Windows session capabilities (27) = `ping`, `shutdown` and the 25 read-only operations. The verifier expects `GHIDRA_SESSION_CAPABILITIES` minus `annotate_native_function` (29). Missing from the session, as designed on Windows: `set_address_name`, `set_addresses_names`.

Package lane, after fixing (1):

    AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
    + actual - expected
      [
    +   'ReaGhidraApplySeeds.java',
        'ReaGhidraBridge.java',
    +   'ReaGhidraNoReturnFix.java',
        'ReaGhidraPrepareCom.java',
    -   'ReaGhidraApplySeeds.java',
    -   'ReaGhidraNoReturnFix.java'
      ]

Typed outcome or recovery expected

No response

Analysis or suspected cause

  1. Filter with the existing GHIDRA_MUTATING_OPERATIONS set instead of the hard-coded name, in the three places above.
  2. Compare against [...scriptCollisions].sort().

With both changes, on this host:

  • verify:windows-native passes.
  • verify:ghidra:windows, -- --x86, -- --dll and -- --x86 --dll pass: 25 operations each, cleanup complete, Job Object, protected DACL and handle admission on, 12 to 13 s per lane.
  • verify:ghidra:windows:package, -- --x86, -- --dll and -- --x86 --dll pass (168, 189, 50 and 47 s).

I have the change ready on a branch of my fork and can open a PR.

Additional context

No response

Originally created by @pablodiazjorge on GitHub (Oct 11, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/1859 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Native analysis or decompilation ### Observed behavior On real Windows x64, the real-Ghidra verification lanes fail although Ghidra starts, finishes auto-analysis and serves every read-only operation. There are two independent stale assertions in the verifiers: 1. `npm run verify:ghidra:windows` (also `-- --x86`, `-- --dll`, `-- --x86 --dll`) stops at `assertSession` with `Windows Ghidra session commitment drifted`. The read-only Windows session reports 27 capabilities; the verifier expects 29. `verify:ghidra:windows:package` runs every MCP operation and then fails with `Packaged verification omitted an admitted operation.` for the same reason. 2. Once (1) is fixed, `verify:ghidra:windows:package` fails at its last check: `assert.deepEqual((await readdir(callerDirectory)).sort(), scriptCollisions)` compares a sorted directory listing with a list that is no longer in sorted order. ### Reproduction On Windows x64 with Ghidra 12.1.4, a full JDK 21 and the matching native addon, at `main` (`0b4ce836`): npm run verify:ghidra:windows npm run verify:ghidra:windows:package ### Expected behavior The Windows P0 bridge is read-only, so the verifiers should expect every session capability except the mutating ones, which the Windows session correctly omits. The caller-script collision check should compare the same set of names regardless of order. ### Impact and scope Only the verifiers are wrong; the provider behaves correctly. But the real Windows Ghidra lanes cannot pass on any host, so they currently do not guard Windows regressions. 1. #1635 added `set_address_name` and `set_addresses_names` to `GHIDRA_SESSION_CAPABILITIES` and to `GHIDRA_MUTATING_OPERATIONS`. The Windows verifiers still exclude only `annotate_native_function` by hand, in three places: `scripts/verify-real-ghidra-windows.mjs` (`SESSION_CAPABILITIES`, line 30, and the `expected` operations, line 237) and `scripts/verify-packaged-ghidra-windows.mjs` (the `expected` list, line 405). 2. `scriptCollisions` in `scripts/verify-packaged-ghidra-windows.mjs` was sorted when #800 introduced the sorted comparison. #1419 appended `ReaGhidraNoReturnFix.java` and #1667 appended `ReaGhidraApplySeeds.java`, so the hand-written list is no longer in sorted order. ### REA version main at 0b4ce836 (package version 6.4.0) ### Runtime and platform Windows 11 Pro 26H2 (build 26300.9457) x64, Node.js 22.22.3, Ghidra 12.1.4, Temurin JDK 21.0.12.1, local NTFS, non-elevated user. Native addon built with npm run build:windows-native (mingw-w64 13, WSL Ubuntu). ### Target and artifact context The fixtures generated by build:ghidra-windows-fixture (x86-64 and x86 PE, EXE and DLL) ### Interface Other ### Earliest failure stage Setup or provider admission ### Relevant output or evidence ```text Read-only Windows session capabilities (27) = `ping`, `shutdown` and the 25 read-only operations. The verifier expects `GHIDRA_SESSION_CAPABILITIES` minus `annotate_native_function` (29). Missing from the session, as designed on Windows: `set_address_name`, `set_addresses_names`. Package lane, after fixing (1): AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal: + actual - expected [ + 'ReaGhidraApplySeeds.java', 'ReaGhidraBridge.java', + 'ReaGhidraNoReturnFix.java', 'ReaGhidraPrepareCom.java', - 'ReaGhidraApplySeeds.java', - 'ReaGhidraNoReturnFix.java' ] ``` ### Typed outcome or recovery expected _No response_ ### Analysis or suspected cause 1. Filter with the existing `GHIDRA_MUTATING_OPERATIONS` set instead of the hard-coded name, in the three places above. 2. Compare against `[...scriptCollisions].sort()`. With both changes, on this host: - `verify:windows-native` passes. - `verify:ghidra:windows`, `-- --x86`, `-- --dll` and `-- --x86 --dll` pass: 25 operations each, cleanup complete, Job Object, protected DACL and handle admission on, 12 to 13 s per lane. - `verify:ghidra:windows:package`, `-- --x86`, `-- --dll` and `-- --x86 --dll` pass (168, 189, 50 and 47 s). I have the change ready on a branch of my fork and can open a PR. ### Additional context _No response_
bsakaguchi 2026-10-15 18:26:48 +00:00
  • closed this issue
  • added the
    triage
    bug
    labels
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#633
No description provided.