Repository navigation
fix(pcap): report a refused tool launch as an unavailable tool - #10553
Conversation
When a capture read's tool launch was refused with EPERM, pcap reported it as unreadable tool output (AnalysisProtocolError) instead of an unavailable tool. Pcap also never told "not executable" apart from "missing". Add classifyLaunchFailure in src/process as the one owner of which spawn errnos mean missing (ENOENT, ENOTDIR) and which mean present but not executable (EACCES, EPERM, ENOEXEC, EISDIR). Pcap, apktool and gdb used three different errno lists; all three now use it.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The reviewed follow-up appears safe to merge; the previous Linux test failure is addressed. SummaryThis PR shares launch-refusal classification across providers and gives pcap errors repair advice for the selected tool or limiter.
Reviews (7) · Last reviewed commit: "test(pcap): prove synchronous launch nam..." · Reviewed by Greptile |
…red owner (#10598) The Ghidra and JADX Java probes and adb's version probe now take missing-versus-not-executable from classifyLaunchFailure instead of their own errno checks. ELOOP and ENAMETOOLONG join the owner's missing set, so adb keeps its existing classification and both Java probes now treat a non-directory path component as a missing runtime.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b35bb6b1f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Follow-up to the resolved pcap provider thread: per the maintainer's decision to keep platforms consistent, d3f2880 replaces the unknown-stage result with attribution through the prlimit wrapper. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d3f288002e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Name the executable on errnos Node throws synchronously from spawn (ENOEXEC, ENOTDIR, ...) and read the Windows native launcher's executable-launch constraint, so pcap attributes those refusals to the selected tool or limiter instead of an unknown stage.
…sal owner superseded #10553 moved the last caller of isUnresolvedPathErrorCode onto the shared launch-failure classifier, leaving the export unused. knip in the deep static checks lane fails on it, keeping main red. The errno set stays: the selected-regular-file predicate still uses it.
Summary
A refused packet-tool launch could be reported as unreadable output, and matching an errno without its origin could blame TShark when the failure came from preparation or the Linux limiter. This change shares launch-refusal classification across pcap, apktool, GDB, ADB, and Java probes. Pcap uses the spawn error's path and syscall to attribute a direct refusal to the selected tool or limiter and supplies the corresponding repair guidance.
On Linux the tool runs through util-linux prlimit, which sets limits and then replaces itself with the tool.
attributePcapLimitedExit(owned byPcapNativeBound, which selects and validates prlimit) reads prlimit's own err(3) diagnostics:prlimit: failed to execute ...with exit 127/126 is a missing or non-executable selected tool, any otherprlimit: ...exit 1 is a limiter failure with the limiter repair, and everything else is the tool's own exit, classified exactly as without a limiter. A non-capture file therefore reportsunsupported_targeton Linux as on other platforms. Only a failure observed before any exit (stream collection failure) keeps the stage unknown. No new process authority or schema is introduced.Validation
npm run check:fastand formatting checks passed.No issue was filed; the problem was found during an error-boundary audit.
unsupported_targetand added prlimit stand-in tests that run on every POSIX host (tool exit attributed to the tool, failed exec attributed to the selected tool, prlimit's own refusal attributed to the limiter).npm run test:focused -- tests/boundary/pcap/pcapCommand.test.ts— 15 passed; the 3 new tests fail on the previous head. Pre-pushnpm run check:fastpassed. The real-prlimit path is covered by the Linux-onlypcapProvidertests in CI.src/process/launchFailure.tsnow owns which executable a launcher refused (executableLaunchRefusalOf): Node'sspawn <path>errors and the Windows native launcher's executable-launch constraint withrequestedPath.spawnOwnedProviderProcessgives errnos Node throws synchronously with a barespawnsyscall (ENOEXEC, ENOTDIR, ... — probed on Node 24.22.1/darwin) the same shape. Pcap no longer readssyscall/pathitself.npm run test:focused -- src/process/launchFailure.test.ts tests/boundary/pcap/pcapCommand.test.ts src/process/ProviderProcess.launcherExit.test.ts src/windows/WindowsOwnedProcess.test.ts— 66 passed; the real-ENOEXEC and Windows-shaped pcap tests fail without the fix.npm run check:fastpassed. Not run on a real Windows host./bin/shon Linux.npm run test:focused -- tests/boundary/pcap/pcapCommand.test.ts— 17 passed; the test fails withnameSpawnedExecutableremoved. Not run on Linux locally.Author readiness
Human owner:
Before merge
type(scope): outcome.