Repository navigation
feat: stop a runaway solver within seconds on Linux and macOS (stage 11f) - #104
Merged
Merged
Conversation
Decision 7 of the 2026-11-13 second set (#83). cvc5 1.4.2 raises its own stack limit and, on a quantifier over a sequence, recurses without bound (cvc5/cvc5#13161). On Linux it then grew its stack until the time limit killed it: on WSL Ubuntu, a six-line script was still running at 20 s, while capped at 256 MiB it crashed after 5.3 s, and at 16 MiB after 3.6 s. Each solver now starts through /bin/sh, which caps its soft and hard stack at 256 MiB and then becomes it, so no dependency or unsafe code is needed. Tests cover a solver that crashes, one that hangs (already covered), one that exhausts its stack (the cvc5 script, undecided within half its time limit) and, on Linux and macOS, that the cap reaches the solver's process. Refs #83
macOS's hard stack limit is about 64 MiB, below the 256 MiB cap, so `ulimit -s` failed there and, chained with `&&`, no solver ever ran: the platforms job on #104 saw every solver give no answer. The wrapper now lowers the limit only when it is above the cap, and starts the solver either way. The cap's test ran the stand-in through the test harness, whose own output came first; it now runs `ulimit -Hs` through the wrapper directly. Refs #83
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cvc5 1.4.2 raises its own stack limit and, on a quantifier over a sequence, recurses without bound (cvc5/cvc5#13161). On Linux it then grows its stack, about 0.7 GB a second, until Accord's time limit kills it. Slice 11f of stage 11 (#83), decision 7 of the 2026-11-13 second set: each solver's stack is capped on Linux and macOS, so that recursion crashes within seconds, which is undecided like any crash.
What it changes
/bin/sh -c '…' <solver> <args>. The shell lowers the soft and hard stack limit to 256 MiB when the hard limit is above it, then becomes the solver, keeping its process (the time limit still kills it) and its arguments as they are. A hard limit already below the cap stays: macOS's is about 64 MiB, and raising it would fail. The solver starts either way. No dependency and nounsafe. Windows is unchanged.Measurement
WSL Ubuntu, pinned cvc5 1.4.2 (Linux static build),
--mbqi --tlimit-per=10000, memory capped at 4 GB for safety, on the six-line scriptRUNAWAYinsolver.rs:timeout256 MiB is the largest tried, leaving room for legitimate recursion. On Windows the same script overflows by itself (
0xC00000FD) after about 2.4 s.Verification
ulimit -Hsrun through the wrapper reports the cap, or the original limit where it was already lower.cargo fmt --all --checkpassed;cargo clippy --workspace --all-targets --locked -- -D warningspassed, and with--target x86_64-unknown-linux-gnu, which compiles the Unix path;cargo test --workspace --locked: 126 passed, 0 failed, 2 ignored (the crash stand-in and the existing hang stand-in);score.py --self-testandmaterials.py: passed.a bas one argument.linuxpassed;full-cipassed on Windows and macOS.ulimit -s 262144 && exec, and under macOS's lower hard limitulimitfailed, so no solver started. The fix commit lowers the limit only when above the cap and starts the solver either way.Not established
Risk note
Two-way door: one constant and how a solver process starts. Blast radius: every solver run on Linux and macOS; a solver that needed more than 256 MiB of stack would now crash, and its obligation would be undecided, never proved. Evidence: the measurement and checks above, and the full suite on CI.
Refs #83
Atrium: 01a1e493-5da7-7233-b16e-14dba79d4ede