Repository navigation
fix(native): recover macOS command deadlines - #6059
Conversation
Promote native_command_timeout_ms (default 60000), native_ui_deadline_ms (default 180000), and pwntools_timeout_ms (default 30000) as validated per-call settings. Keep cpuSeconds, byte allowances, LLDB grace, and plist probes fixed, and say those caps have no runtime override. Co-authored-by: morluto <morluto@users.noreply.github.com>
Codex Review SummaryThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4803c81071
ℹ️ 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".
[Medium impact] The PR appears safe to merge; no actionable issue remains from this review. SummaryAdds optional per-call deadlines for macOS native commands, native UI observations, and offline pwntools commands.
Source review found no new actionable or security issue. No runtime tests were run during this review. Whether this PR was superseded could not be verified because GitHub access was unavailable. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
Input["CLI or MCP input"] --> Schema["Validate optional deadline"]
Schema --> Native["Native command deadline"]
Schema --> UI["UI operation deadline"]
Schema --> Python["pwntools command deadline"]
Native --> Lookup["xcrun lookup"]
Native --> Command["Resolved tool"]
UI --> Prepare["Compile helper"]
UI --> Capture["Captures and waits"]
Python --> Decoder["Offline decoder"]
Python --> Debugger["Optional core-only debugger"]
Lookup --> Result["Result or error with selected deadline"]
Command --> Result
Prepare --> Result
Capture --> Result
Decoder --> Result
Debugger --> Result
Reviews (3) · Last reviewed commit: "fix(native): honor the selected deadline..." · Reviewed by Greptile |
…eadlines-9c89 Co-authored-by: morluto <morluto@users.noreply.github.com>
Pass the selected native command timeout through xcrun resolution, thread the pwntools deadline into pwndbg failures, and state the selected UI deadline apart from the fixed wait-step cap. SIGXFSZ and EFBIG recovery names the file-size allowance. Co-authored-by: morluto <morluto@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4bd8cbed55
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…eadlines-9c89 Co-authored-by: morluto <morluto@users.noreply.github.com>
The UI helper compile and capture subprocesses used fixed 60s and 30s exec timeouts, so a longer native_ui_deadline_ms still failed as a generic provider error. Preparation timeouts reported the 60000 ms default instead of the selected native_command_timeout_ms. Memory resource-constraint recovery names memory again, and the Darwin plist CLI expectation matches the byte-counted input allowance. Co-authored-by: morluto <morluto@users.noreply.github.com>
Summary
Part of #5910 (parent #5808). macOS native commands, native UI observation, and offline pwntools commands now take a validated per-call deadline at today's default. Fixed byte, CPU, LLDB grace, and plist probe caps stay at the same numbers and say there is no runtime override.
The native command setting is
native_command_timeout_ms, notcommand_timeout_ms. That name already means the separate objdump/rizin deadline (default 120000) and is also used by WABT.Review follow-up on this branch:
xcrun --finduses the selected native command deadline; pwndbg failure text uses the selected pwntools deadline; UI limitations state that deadline and the fixed 180000 ms wait-step cap separately; SIGXFSZ/EFBIG recovery namesoutputBytesandfile_size_bytes. The UI helper compile and capture subprocesses use the selectednative_ui_deadline_ms, and an exec timeout is reported as that deadline. A Darwin ownership-helper preparation timeout uses the selectednative_command_timeout_msand the same recovery as a later command timeout, including cleanup details. Memory resource-constraint recovery names memory. The Darwin plist input-allowance CLI expectation matches the byte-counted allowance.Problem and expected behavior
Those three wall clocks were fixed constants. A caller who needed a longer command, UI observation, or pwntools run could not raise them, and the failure text did not name a setting, the effective milliseconds, the range, or the sibling caps that stay fixed.
Omitted values stay 60000, 180000, and 30000 ms. An integer from 1 to 2147483647 applies on the next call. CLI flags are
--native-command-timeout-ms,--native-ui-deadline-ms, and--pwntools-timeout-ms.Change and scope
Domain schemas own the three fields. Native macOS command dispatch, UI interruption, and the pwntools decoder read the selected deadline. Recovery names the setting, the effective milliseconds, the range, the omitted default, and that a change applies on the next call.
resolveXcrunToolreceives the sametimeoutMsas the resolved tool, so a short deadline cannot spend 60000 ms inxcrun --findand a long deadline is not reported as if resolution had waited for it.inspectPwndbgCoreputs that effectivepwntools_timeout_mson its failure context. Successful UI observations name the selectednative_ui_deadline_msand, separately, the fixed wait-step cap. File-size recovery names the reportedfile_size_byteswhen present and theoutputBytescap (67108864), including when a tighter inherited limit applies. Both UI helper stages receive that same UI deadline. Preparation failure reports the selected command deadline. Memory recovery keeps the budget sentence and includes the word memory.Follow the contribution scope. Maintainer scope decision: not applicable. This stays inside existing native inspection, UI observation, and offline pwntools boundaries. It does not add target execution, injection, mutation, or protection recovery.
Intentionally not included: MCP transport, provider engines, JavaScript, Android, browser, swiftc, ASAR/hdiutil, and objdump/rizin
command_timeout_ms.Contract and boundary impact
docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): none authored. CI regenerates catalogs from the tool contracts.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
list_architecturespasses 60000 or the selectednative_command_timeout_msand rejects 0 before launch; productionXcrunCommandRunnerresolution records 120000 or the omitted 60000 onxcrun --find; UI timeout text namesnative_ui_deadline_msand--native-ui-deadline-ms; successful UI evidence states 2500 ms or the omitted 180000 ms and the fixed 180000 ms wait-step cap; both helper subprocesses receive 250000 ms or the omitted 180000 ms; anETIMEDOUThelper failure reports 2500 ms; a preparation timeout at 1500 ms reports that deadline and keeps cleanup incomplete until the marker resolves; pwntools timeout text namespwntools_timeout_msand leaves cpuSeconds 30 fixed; a pwndbg timeout at 60000 ms and a recorded-crash debugger timeout at 1500 ms report that deadline; SIGXFSZ/EFBIG remediation namesfile_size_bytesandoutputBytes(67108864); memory marker and resource-limit replies include memory and the address-space allowance; CLI help advertises the three flags; plist allowance names include no runtime override, including the Darwin input-allowance CLI expectation.NATIVE_COMMAND_TIMEOUT_MS60000,NATIVE_UI_DEADLINE_MS180000, andPWNTOOLS_LIMITS.timeoutMs30000. Those defaults are unchanged. The Python worker file cap isoutputBytes(67108864), notaddressSpaceBytes. On head4bd8cbed, CI required failed becausebinary_layout / real-binary-layoutrequired the word memory in a memoryresource_constraintremediation, and Real Apple artifact CLI/MCP E2E expected the shorter plist input-allowance sentence. Both failures come from this PR's wording.rea inspect-macho --helpprints--native-command-timeout-msand states the omitted 60000 ms default, the 1..2147483647 range, and that it is distinct from objdump/rizincommand_timeout_ms. A successful UI observation limitation names the selectednative_ui_deadline_msand the fixed wait-step cap.scripts/verify-binary-layout.mjsmemory case was not re-run here; it needs pwntools andprlimit. No real Xcode, LLDB, or pwntools process was timed out. The recorded-crash debugger timeout used a fixture launcher. CI on this push was not waited on.For evidence-bearing changes:
Validation performed
npm run check:fast— passed (typecheck and lint) on this revision, after mergingorigin/main(a0214e0e0).npx oxfmt --checkon the edited files — passed.npm run test:focusedforsrc/native/NativeUiHelperRuntime.test.ts,src/native/NativeUiObservation.test.ts,src/native/NativeUiInterruptionControl.test.ts,src/native/pwntools/PwntoolsFailures.test.ts,tests/boundary/providers/native/nativeProvider.test.ts,tests/boundary/binaryDiagnostics/pwntoolsLayoutProvider.test.ts, andtests/boundary/cli/nativePlistSelectionFailureCli.test.ts— 6 files passed, 1 skipped; 139 passed, 13 skipped. The plist CLI file skipped on this Linux host.NativeUiObservation.test.tswas rerun after the lint move: 30 passed.Compatibility, safety, and release
Author readiness
Human owner: @morluto
Before merge
type(scope): outcome.