Repository navigation
Description
Problem and local reproduction
A test timeout can stop wavec while its generated program continues running. This can leave CPU work, listening sockets or temporary-file writes active after the runner reports a timeout.
At e204bbebbbede0086fbb670d43a65b9cf38f0231:
tools/check_wave_corpus.py::run_std_exampleslauncheswavec runwithsubprocess.run(..., timeout=...).tools/run_tests.py::run_and_classifyuses the same direct-child timeout pattern.wavec runitself launches the generated executable as a child (src/cli.rs).
I reproduced the lifecycle defect on Linux by calling the actual run_std_examples helper against a temporary fake compiler. The fake compiler starts a child that waits 1.5 seconds and writes a marker, then itself waits 10 seconds. With a 0.4-second runner timeout, the runner reports RUN TIMEOUT, but the marker is written afterward. The reproducer uses no network or LLVM and the child exits on its own after writing the marker.
A minimal fake compiler body is:
import subprocess, sys, time
subprocess.Popen(
[sys.executable, "-c", "import time,pathlib; time.sleep(1.5); pathlib.Path('child-survived').write_text('alive')"],
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
)
time.sleep(10)Run it through the corpus helper with an isolated temporary root containing one examples/std/*.wave source, then check for the marker after the timeout. Give the fake compiler an executable wrapper appropriate for the host.
Scope and acceptance
- Timeouts terminate and reap the launched compiler/program tree, including generated descendants, using host-appropriate process supervision.
- Cover the corpus/example runner and end-to-end runner, including server-case cleanup where applicable.
- Only terminate processes started for the current test; never kill by broad executable name.
- Preserve timeout classification and useful captured stdout/stderr.
- Add fake-process regression tests proving a delayed child side effect cannot occur after timeout cleanup.
- Verify Linux and Windows behavior; distinguish cancellation from normal program failure.
Related: #354 covers corpus-runner unit tests, while #356 concerns a fixed inter-test delay. This is a separate process-lifecycle bug. It is not marked good first issue because reliable process-tree cleanup differs by OS.
Activity
fix: stabilize linker outputs, test cleanup, and Darwin pipes (#574)
LunaStev commentedon Nov 3, 2026
Current-master reproduction in the Rust process owner: escaped session survives timeout
Audited canonical master
e1f8effd195b6339c3979b1e091e63c25f1da983on Linux amd64 with checkout-built Wave 0.0.1-alpha-dev, matching std, Rust 1.89.0, Cargo jobs=2 and LLVM 21.1.8. The master SHA was rechecked before registration. The historical Python runner has been retired by #1071; the same descendant-cleanup acceptance requirement now applies to the shared native process owner.The Unix owner sends SIGKILL to its owned process group, but a launched descendant can start a new session and leave that group. If that descendant inherits captured stdout/stderr, the subsequent collector joins also wait beyond the command deadline.
Starting points: Owner::stop, process group setup and unbounded collector joins after stopping.
Executed Linux reproduction; all child processes finish on their own within a few seconds and no remote service is needed:
Observed:
The tool reports timeout, but the detached descendant completes its delayed side effect after the one-second limit. The retained output pipe makes collector completion depend on that surviving process rather than the requested deadline.
Remaining scope:
This belongs to #507's existing process-tree lifecycle contract, not a new Python migration issue. Existing issue state, labels and assignees are retained. No implementation or CI run is included.