fix(native): name the retained pwntools process group in cleanup resources (#2281)
When a pwntools or pwndbg stage cannot confirm that its owned process group stopped, the cleanup_incomplete result listed only the run ID and runtime directory, although a descendant can still be live. Add the retained supervisor's pid and process-group coordinates, as OwnedCommand reports for a non-transferred cleanup failure. Fixes #2274 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
a86deecac5
commit
4303dcdcf6
|
|
@ -518,6 +518,13 @@ export class PwntoolsDecoder<
|
|||
[
|
||||
pending.process.launch.ownership?.runId ?? "owned-decoder",
|
||||
...(pending.root === undefined ? [] : [pending.root.path]),
|
||||
// The retained group may still be live; name it as OwnedCommand does.
|
||||
...(pending.process.launch.ownership === undefined
|
||||
? []
|
||||
: [
|
||||
`pid:${pending.process.launch.ownership.leaderPid}`,
|
||||
`process-group:${pending.process.launch.ownership.processGroupId}`,
|
||||
]),
|
||||
],
|
||||
{
|
||||
reason: stopped.reason,
|
||||
|
|
|
|||
|
|
@ -261,6 +261,14 @@ it.runIf(supportedHost).each([
|
|||
if (result.ok) throw new Error("Expected unresolved process ownership");
|
||||
const projected = projectAnalysisError(result.error);
|
||||
expect(projected.code).toBe("cleanup_incomplete");
|
||||
expect(projected).toMatchObject({
|
||||
details: {
|
||||
resources: expect.arrayContaining([
|
||||
expect.stringMatching(/^pid:\d+$/u),
|
||||
expect.stringMatching(/^process-group:\d+$/u),
|
||||
]),
|
||||
},
|
||||
});
|
||||
if (stage === "debugger")
|
||||
expect(projected).toMatchObject({
|
||||
details: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue