fix(process): classify every launcher failure once by errno in the shared launch owner (#11615)

* fix(process): classify every launcher failure once by errno in the shared launch owner

* fix(process): keep the launch owner's syscall, cause and facts in RE and pwntools unavailable reports
This commit is contained in:
morluto authored and GitHub committed 2026-11-16 08:24:39 +08:00
1 parent 0884836abf
commit dbb4bc29f0
29 files changed
+712 -289

No files matched your search

+4 -12
View File
@@ -1,5 +1,6 @@
import type { AnalysisCapturedOutput } from "../domain/analysisErrorBase.js";
import { HOST_PLATFORM } from "../platform/HostPlatform.js";
import { launchExhaustedResource } from "./launchFailure.js";
import {
execFile,
spawn,
@@ -136,25 +137,16 @@ export const execFileOutputFailure = (
};
};
/** Spawn errnos reporting exhausted host capacity rather than an unusable command. */
export const HOST_SPAWN_CAPACITY_CODES: ReadonlySet<string> = new Set([
"EAGAIN",
"EMFILE",
"ENFILE",
"ENOMEM",
]);
/**
* Whether the command never started because the host lacked process, memory
* or file-descriptor capacity. The command itself may be usable; a retry after
* capacity is freed can succeed.
* or file-descriptor capacity (classified by `launchExhaustedResource`). The
* command itself may be usable; a retry after capacity is freed can succeed.
*/
export const spawnCapacityExhausted = (
failure: ExecFileOutputFailure | undefined,
): boolean =>
failure?.spawnFailed === true &&
typeof failure.code === "string" &&
HOST_SPAWN_CAPACITY_CODES.has(failure.code);
launchExhaustedResource(failure.code) !== undefined;
/** Project admitted command failure facts without reinterpreting failure policy. */
export const execFileFailureCapturedOutput = (