[PR #1027] [MERGED] fix(windows): allow Java to read retained target snapshots #2591

Closed
opened 2026-10-17 21:07:57 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1027
Author: @N0zoM1z0
Created: 10/7/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/windows-ghidra-snapshot-sharing


📝 Commits (1)

  • b9ae930 fix(windows): allow Java to read retained target snapshots

📊 Changes

2 files changed (+50 additions, -5 deletions)

View changed files

📝 native/windows/src/filesystem.cc (+27 -5)
📝 scripts/verify-windows-native.mjs (+23 -0)

📄 Description

Windows Ghidra could not import an admitted target because REA retained a snapshot handle with DELETE access. Java’s reader does not share delete access, so even the supported x86-64 PE fixture failed before bridge startup.

Snapshot creation now omits DELETE access while retaining read-only sharing, which continues to deny competing writes, renames, and deletion. Failed-copy cleanup pins the parent, records the file identity, closes the writer, and removes the verified same file through a dedicated cleanup handle. Other runtime files retain their existing access modes.

Closes #1026. This removes a separate prerequisite blocker for #806; x86 admission remains a follow-up.

Validation:

  • npm run build:windows-native and npm run verify:windows-native:artifact
  • Real Windows npm run verify:windows-native: independent read/write-sharing reader digest, mutation denial, cancellation, identity admission, private DACL, junction-safe cleanup, and process ownership checks passed. The new reader check fails against the published 5.0.0 native artifact.
  • Real Windows npm run verify:ghidra:windows: all 25 read-only operations passed with Ghidra 12.1.4 / JDK 21 / Node 22.19.0, including complete runtime and process cleanup. Peak combined working set was approximately 709 MiB with a 512 MiB JVM heap and two CPUs.
  • npm run build:cached -- --concurrency=1
  • Real Windows npm-packed artifact, installed with npm ci in an isolated prefix using an integrity-verified offline cache: CLI providers / inspect, 28 MCP operations, ordinary-user token, unchanged target bytes, and complete cleanup passed. Peak combined working set was approximately 979 MiB. Optional dependencies were omitted in this Ghidra lane. The initial live-registry install timed out before REA execution.
  • npm run check:fast -- --concurrency=1
  • npm run test:focused -- src/windows/WindowsNativeLoader.test.ts tests/boundary/providers/ghidra/ghidraTargetSnapshot.test.ts
  • Oxfmt and git diff --check

No real Hopper verification was 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/1027 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/windows-ghidra-snapshot-sharing` --- ### 📝 Commits (1) - [`b9ae930`](https://github.com/morluto/rea/commit/b9ae930ad0debc3b5a5de13b1781481729e838b7) fix(windows): allow Java to read retained target snapshots ### 📊 Changes **2 files changed** (+50 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `native/windows/src/filesystem.cc` (+27 -5) 📝 `scripts/verify-windows-native.mjs` (+23 -0) </details> ### 📄 Description Windows Ghidra could not import an admitted target because REA retained a snapshot handle with DELETE access. Java’s reader does not share delete access, so even the supported x86-64 PE fixture failed before bridge startup. Snapshot creation now omits DELETE access while retaining read-only sharing, which continues to deny competing writes, renames, and deletion. Failed-copy cleanup pins the parent, records the file identity, closes the writer, and removes the verified same file through a dedicated cleanup handle. Other runtime files retain their existing access modes. Closes #1026. This removes a separate prerequisite blocker for #806; x86 admission remains a follow-up. Validation: - `npm run build:windows-native` and `npm run verify:windows-native:artifact` - Real Windows `npm run verify:windows-native`: independent read/write-sharing reader digest, mutation denial, cancellation, identity admission, private DACL, junction-safe cleanup, and process ownership checks passed. The new reader check fails against the published 5.0.0 native artifact. - Real Windows `npm run verify:ghidra:windows`: all 25 read-only operations passed with Ghidra 12.1.4 / JDK 21 / Node 22.19.0, including complete runtime and process cleanup. Peak combined working set was approximately 709 MiB with a 512 MiB JVM heap and two CPUs. - `npm run build:cached -- --concurrency=1` - Real Windows npm-packed artifact, installed with `npm ci` in an isolated prefix using an integrity-verified offline cache: CLI `providers` / `inspect`, 28 MCP operations, ordinary-user token, unchanged target bytes, and complete cleanup passed. Peak combined working set was approximately 979 MiB. Optional dependencies were omitted in this Ghidra lane. The initial live-registry install timed out before REA execution. - `npm run check:fast -- --concurrency=1` - `npm run test:focused -- src/windows/WindowsNativeLoader.test.ts tests/boundary/providers/ghidra/ghidraTargetSnapshot.test.ts` - Oxfmt and `git diff --check` No real Hopper verification was performed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:07:57 +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#2591
No description provided.