Repository navigation
fix(pwntools): report retained process cleanup identities - #2282
1052326311 wants to merge 3 commits into
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
TL;DR: On Linux with the real pwntools 4.15.0, this change works. If a stage cannot confirm its group retired, the error now adds the leader pid and the group id from the retained launch. A launch with no ownership record still gets no made-up ids. Thanks, 1052326311, for the fix and for a test that checks the real numbers. Two other PRs also target #2274: #2281 and #2284. I ran all three the same way. ResultsHead 8eb6a8b, base ec2d251 (#2212). Every pass below exited 0.
The 3 tests your macOS run skipped also ran. Real run. With the real pwntools 4.15.0 and a real core file,
No ownership. In a test file of mine, not part of the PR, I removed the ownership record from the launch. The list stayed Limit. On Linux the group id equals the leader pid, so both labels show one number. No test can catch a swap of the two labels. Not run
Real run setupI wrote a small wrapper for REA_PWNTOOLS_PYTHON. It leaves one child in the same process group, with no run token (the marker REA gives each process it owns). Then it starts the real pwntools. REA cannot prove the child is its own, so it keeps the group. I made the core file with gdb from a small crashing C program. Test setup
Commands🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊 |
|
@greptileai review |
|
This PR is set for a Plus review. TREX isn't supported with Plus or Apex reviews yet, so Greptile reviews this PR at Base while TREX is on. |
|
|
Closing this. The branch has commits, but the diff against main is empty. The retained pwntools cleanup identities are already on main. |
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.resourcespreviously omitted the process identity even while descendants were still alive. Callers should receivepid:<leaderPid>andprocess-group:<processGroupId>from retained launch ownership, matching the existing non-transferredOwnedCommanderror.Change and scope
Extend
PwntoolsDecoder.#retireProcessresource 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
Expected effects of the exercised existing workflow:
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:123andprocess-group:123with 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
Review checklist
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.