[PR #2282] [CLOSED] fix(pwntools): report retained process cleanup identities #5138

Closed
opened 2026-10-31 01:04:16 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2282
Author: @1052326311
Created: 10/12/2026
Status: ❌ Closed

Base: main ← Head: fix/pwntools-cleanup-identities


📝 Commits (3)

  • 8eb6a8b fix(pwntools): report retained process cleanup identities
  • de1901a fix(pwntools): reconcile retained cleanup identities with main
  • 922eda9 fix: reconcile final main for PR #2282

📄 Description

Summary

Fixes #2274. Retained pwntools/pwndbg cleanup failures now identify the owned process leader and process group, alongside the run ID and runtime directory.

Problem and expected behavior

When a stage cannot confirm process-group retirement, cleanup_incomplete.details.resources previously omitted the process identity even while descendants were still alive. Callers should receive pid:<leaderPid> and process-group:<processGroupId> from retained launch ownership, matching the existing non-transferred OwnedCommand error.

Change and scope

Extend PwntoolsDecoder.#retireProcess resource projection using the retained supervisor's ownership. Do not infer ownership from a raw PID, and do not invent IDs for launches without ownership. Cleanup execution, retained supervisors, retry behavior and source-read guards are unchanged.

Contract and boundary impact

  • Semantic owner and earliest changed stage: pwntools stage retirement error construction.
  • Contribution scope fit and linked maintainer decision: ordinary error-evidence fix within existing provider; no new-capability scope decision applicable.
  • CLI and MCP/tool-catalog contract: unchanged schemas; more complete existing resource list.
  • Provider, bridge, target-format, or platform compatibility: shared decoder/debugger retirement path; no changes to supported hosts or tools.
  • Evidence, artifact, provenance, or reconstruction contract: preserve retained process identity and existing partial observations/primary failures.
  • Target selection, authority, upstream behavior, and cleanup details: no new authority or cleanup actions; process-group IDs are diagnostic ownership evidence, not authorization to kill an arbitrary PID.
  • Generated metadata, package, or installation impact: none.

Expected effects of the exercised existing workflow:

  • Read existing files or captured data.
  • Launch or attach to a process.

Evidence and regression coverage

Extended the existing real owned-process regression for decoder/debugger × command success/failure. Assertions compare projected resource IDs to the actual launch ownership while the existing test confirms the descendant remains alive, producer files are not consumed, and cleanup retries run during teardown.

  • Base 2e45b4d7: four new assertions fail, four existing cases pass.

  • Candidate: 17 tests passed across retirement, cleanup and CLI finalization; three Linux-only decoder integration tests skipped on macOS.

  • Representative resources retain run ID/directory and additionally include pid:123 and process-group:123 with actual launched values.

  • Remaining proof gaps: real macOS process ownership exercised while the existing fixture simulates the Linux x64 provider admission gate and producer output. This is not a real pwntools/pwndbg installation run or Windows proof.

  • 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

  • npm run test:focused -- tests/process-global/pwntoolsStageRetirement.test.ts tests/process-global/pwntoolsCleanup.test.ts tests/process-global/pwntoolsCliFinalization.test.ts tests/boundary/binaryDiagnostics/pwntoolsDecoderOwnership.test.ts — 17 passed, 3 platform-skipped.
  • npm run check — six tasks and architecture guards passed.
  • git diff --check — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none; additive diagnostics.
  • Real Hopper/Ghidra, browser, or OS coverage: real macOS owned processes; no real debugger engine claimed.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: report only retained launch ownership; no additional process actions or ambient-data capture.

Review checklist

  • Concrete issue, focused conventional title and existing-boundary scope.
  • Regression covers actual owner and shared error projection.
  • Existing cleanup/source-read protections retained.
  • No schema or generated metadata changes needed.
  • Proof limitations and representative output stated.
  • Final diff checked for secrets, generated output and unrelated edits.

Independent validation — 2026-10-13

CassieFox23 reported Linux validation of head 8eb6a8b7a: all 8 retirement tests passed on Node 22/24/26; the focused pwntools/ownership set passed 32 tests on Node 24, including the three cases skipped in our macOS run. A real pwntools 4.15.0 decoder/core-file run retained the expected leader PID and process-group identity; a separate no-ownership case added no invented IDs. These are third-party reported results, not author-run tests or maintainer approval. Real GDB/pwndbg, Windows, and newest-main execution were not covered by that report.


🔄 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/2282 **Author:** [@1052326311](https://github.com/1052326311) **Created:** 10/12/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/pwntools-cleanup-identities` --- ### 📝 Commits (3) - [`8eb6a8b`](https://github.com/morluto/rea/commit/8eb6a8b7a104675c44a7bccd9d1ecac526898ee3) fix(pwntools): report retained process cleanup identities - [`de1901a`](https://github.com/morluto/rea/commit/de1901adaa187d4eefd8c16da1cd2f44ea897161) fix(pwntools): reconcile retained cleanup identities with main - [`922eda9`](https://github.com/morluto/rea/commit/922eda9a08f758871655adc052842178c1bbcb34) fix: reconcile final main for PR #2282 ### 📄 Description ## Summary Fixes #2274. Retained pwntools/pwndbg cleanup failures now identify the owned process leader and process group, alongside the run ID and runtime directory. ## Problem and expected behavior When a stage cannot confirm process-group retirement, `cleanup_incomplete.details.resources` previously omitted the process identity even while descendants were still alive. Callers should receive `pid:<leaderPid>` and `process-group:<processGroupId>` from retained launch ownership, matching the existing non-transferred `OwnedCommand` error. ## Change and scope Extend `PwntoolsDecoder.#retireProcess` resource projection using the retained supervisor's ownership. Do not infer ownership from a raw PID, and do not invent IDs for launches without ownership. Cleanup execution, retained supervisors, retry behavior and source-read guards are unchanged. ## Contract and boundary impact - Semantic owner and earliest changed stage: pwntools stage retirement error construction. - Contribution scope fit and linked maintainer decision: ordinary error-evidence fix within existing provider; no new-capability scope decision applicable. - CLI and MCP/tool-catalog contract: unchanged schemas; more complete existing resource list. - Provider, bridge, target-format, or platform compatibility: shared decoder/debugger retirement path; no changes to supported hosts or tools. - Evidence, artifact, provenance, or reconstruction contract: preserve retained process identity and existing partial observations/primary failures. - Target selection, authority, upstream behavior, and cleanup details: no new authority or cleanup actions; process-group IDs are diagnostic ownership evidence, not authorization to kill an arbitrary PID. - Generated metadata, package, or installation impact: none. Expected effects of the exercised existing workflow: - [x] Read existing files or captured data. - [x] Launch or attach to a process. ## Evidence and regression coverage Extended the existing real owned-process regression for decoder/debugger × command success/failure. Assertions compare projected resource IDs to the actual launch ownership while the existing test confirms the descendant remains alive, producer files are not consumed, and cleanup retries run during teardown. - Base `2e45b4d7`: four new assertions fail, four existing cases pass. - Candidate: 17 tests passed across retirement, cleanup and CLI finalization; three Linux-only decoder integration tests skipped on macOS. - Representative resources retain run ID/directory and additionally include `pid:123` and `process-group:123` with actual launched values. - Remaining proof gaps: real macOS process ownership exercised while the existing fixture simulates the Linux x64 provider admission gate and producer output. This is not a real pwntools/pwndbg installation run or Windows proof. - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npm run test:focused -- tests/process-global/pwntoolsStageRetirement.test.ts tests/process-global/pwntoolsCleanup.test.ts tests/process-global/pwntoolsCliFinalization.test.ts tests/boundary/binaryDiagnostics/pwntoolsDecoderOwnership.test.ts` — 17 passed, 3 platform-skipped. - `npm run check` — six tasks and architecture guards passed. - `git diff --check` — passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none; additive diagnostics. - Real Hopper/Ghidra, browser, or OS coverage: real macOS owned processes; no real debugger engine claimed. - Package or release metadata impact: none. - Security, privacy, process, or containment review: report only retained launch ownership; no additional process actions or ambient-data capture. ## Review checklist - [x] Concrete issue, focused conventional title and existing-boundary scope. - [x] Regression covers actual owner and shared error projection. - [x] Existing cleanup/source-read protections retained. - [x] No schema or generated metadata changes needed. - [x] Proof limitations and representative output stated. - [x] Final diff checked for secrets, generated output and unrelated edits. ## Independent validation — 2026-10-13 [CassieFox23 reported Linux validation of head 8eb6a8b7a](https://github.com/morluto/rea/pull/2282#issuecomment-6131847625): all 8 retirement tests passed on Node 22/24/26; the focused pwntools/ownership set passed 32 tests on Node 24, including the three cases skipped in our macOS run. A real pwntools 4.15.0 decoder/core-file run retained the expected leader PID and process-group identity; a separate no-ownership case added no invented IDs. These are third-party reported results, not author-run tests or maintainer approval. Real GDB/pwndbg, Windows, and newest-main execution were not covered by that report. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:04:16 +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#5138
No description provided.