[GH-ISSUE #4584] [Bug] Ghidra configured artifact readers discard primary failures and failed-close owners #2379

Closed
opened 2026-10-17 21:03:56 +00:00 by bsakaguchi · 1 comment
Owner

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

Area

Provider or capability discovery

Observed behavior

Controlled real-file tests against 61e688070 show both configured Ghidra seed and extension readers replace a physical read failure with the final close failure. The returned provider error has no retained cleanup capability for that descriptor.

Reproduction

Ran npm run test:focused -- tests/boundary/filesystem/ghidraProfileArtifactOwnership.test.ts. The seed and extension cases open real temporary regular files, inject a read rejection and a close rejection, then inspect the returned Result. Both fail: diagnostics contain controlled profile close failure, losing controlled profile read failure. The fixture closes its exact handles in final cleanup. No Ghidra engine or target execution occurred.

Expected behavior

Preserve the physical read failure and cleanup uncertainty, retain the exact descriptor owner, and allow cleanup retry to resolve the originating marker. See AGENTS.md Architecture and Cleanup and docs/testing.md descriptor-backed read regressions.

Impact and scope

Observed in two controlled provider-local file operations. Source-derived: identical raw finally { await file.close() } ownership is used in profile resolution and launch snapshot rereads. Native close-fault frequency and real-provider impact are NOT_ENOUGH_INFO; no native Windows or Ghidra close fault reproduced.

REA version

Main 61e688070f48016b6d178cd04c02fcc2f33e19ad (6.5.0).

Runtime and platform

Pinned Node 24.18.0/npm 11.16.0, Darwin arm64.

Target and artifact context

Disposable synthetic seed TSV and ZIP-header extension JAR; simulated ELF x86_64 target identity. No executable extension loaded.

Interface

Provider boundary

Earliest failure stage

Provider profile resolution

Relevant output or evidence

src/ghidra/GhidraAnalysisSeeds.ts:135 and src/ghidra/extensions/GhidraExtensions.ts:72: raw reads/final close. GhidraProvider.resolveAnalysisProfile and GhidraLauncher.launch are affected consumers. Test output: two primary/cleanup controls failed; expected physical failure, received close failure. Evidence provenance: observed controlled filesystem failure, with source-derived consumer scope.

Typed outcome or recovery expected

A typed failed Result with physical reason and live cleanup resources; no new admission while cleanup remains; retry with the exact owner clears only cleanup state.

Analysis or suspected cause

Final close can override the pending read rejection. Neither helper transfers failed-close ownership into the provider/client resource scope. Proposed fix: canonical owned file operations shared by both artifact types, with whole-operation finalization and preserved cleanup bindings through profile and launch adapters.

Additional context

Related #4521 covers PSP extension scanning; this report concerns separate configured analysis-extension and seed file readers. #4569 owns shared profile selection but cannot recover a descriptor its producer discarded. Open/closed Ghidra seed close search found no focused duplicate. A separate seed-growth control also failed and is distinct extent-validation scope.

Originally created by @morluto on GitHub (Oct 16, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/4584 ### Area Provider or capability discovery ### Observed behavior Controlled real-file tests against `61e688070` show both configured Ghidra seed and extension readers replace a physical read failure with the final close failure. The returned provider error has no retained cleanup capability for that descriptor. ### Reproduction Ran `npm run test:focused -- tests/boundary/filesystem/ghidraProfileArtifactOwnership.test.ts`. The seed and extension cases open real temporary regular files, inject a read rejection and a close rejection, then inspect the returned Result. Both fail: diagnostics contain `controlled profile close failure`, losing `controlled profile read failure`. The fixture closes its exact handles in final cleanup. No Ghidra engine or target execution occurred. ### Expected behavior Preserve the physical read failure and cleanup uncertainty, retain the exact descriptor owner, and allow cleanup retry to resolve the originating marker. See AGENTS.md Architecture and Cleanup and docs/testing.md descriptor-backed read regressions. ### Impact and scope Observed in two controlled provider-local file operations. Source-derived: identical raw `finally { await file.close() }` ownership is used in profile resolution and launch snapshot rereads. Native close-fault frequency and real-provider impact are NOT_ENOUGH_INFO; no native Windows or Ghidra close fault reproduced. ### REA version Main `61e688070f48016b6d178cd04c02fcc2f33e19ad` (6.5.0). ### Runtime and platform Pinned Node 24.18.0/npm 11.16.0, Darwin arm64. ### Target and artifact context Disposable synthetic seed TSV and ZIP-header extension JAR; simulated ELF x86_64 target identity. No executable extension loaded. ### Interface Provider boundary ### Earliest failure stage Provider profile resolution ### Relevant output or evidence `src/ghidra/GhidraAnalysisSeeds.ts:135` and `src/ghidra/extensions/GhidraExtensions.ts:72`: raw reads/final close. `GhidraProvider.resolveAnalysisProfile` and `GhidraLauncher.launch` are affected consumers. Test output: two primary/cleanup controls failed; expected physical failure, received close failure. Evidence provenance: observed controlled filesystem failure, with source-derived consumer scope. ### Typed outcome or recovery expected A typed failed Result with physical reason and live cleanup resources; no new admission while cleanup remains; retry with the exact owner clears only cleanup state. ### Analysis or suspected cause Final close can override the pending read rejection. Neither helper transfers failed-close ownership into the provider/client resource scope. Proposed fix: canonical owned file operations shared by both artifact types, with whole-operation finalization and preserved cleanup bindings through profile and launch adapters. ### Additional context Related #4521 covers PSP extension scanning; this report concerns separate configured analysis-extension and seed file readers. #4569 owns shared profile selection but cannot recover a descriptor its producer discarded. Open/closed `Ghidra seed close` search found no focused duplicate. A separate seed-growth control also failed and is distinct extent-validation scope.
Author
Owner

@morluto commented on GitHub (Oct 18, 2026):

Closing as fixed on main after reconciling this report with the landed owner/consumer changes.

  • f9ccacca2: fix(ghidra): own configured profile artifact lifetimes.

Evidence scope: this closure uses the landed source, regression coverage and validation already recorded in the linked commits/thread. No new local tests or native-provider reproduction were run during this backlog pass; previously documented platform and real-provider gaps still apply.

<!-- gh-comment-id:6256001959 --> @morluto commented on GitHub (Oct 18, 2026): <!-- rea-backlog-reconciliation-2026-10-19-4584 --> Closing as fixed on `main` after reconciling this report with the landed owner/consumer changes. - [f9ccacca2](https://github.com/morluto/rea/commit/f9ccacca2cbf7c7f1c338cddd19160fc0a778074): fix(ghidra): own configured profile artifact lifetimes. Evidence scope: this closure uses the landed source, regression coverage and validation already recorded in the linked commits/thread. No new local tests or native-provider reproduction were run during this backlog pass; previously documented platform and real-provider gaps still apply.
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#2379
No description provided.