Summary
Bookmark for tracking the removal of Vera's host_sleep _VeraExit(130) workaround once a wasmtime-py release containing bytecodealliance/wasmtime-py#337 lands on PyPI.
Context
#595 tracked the macOS malloc abort during wasmtime cleanup after Ctrl+C arrives in a host import (originally observed with IO.sleep). Diagnosis: the wasmtime-py trampoline at wasmtime/_func.py:212 caught Exception rather than BaseException, so BaseException subclasses (KeyboardInterrupt, SystemExit, custom BaseException subclasses) escaped the handler and caused a SIGABRT inside Rust's array_call_trampoline with an undefined ABI return value. Filed upstream as bytecodealliance/wasmtime-py#336; fixed by bytecodealliance/wasmtime-py#337 (one-line change to except BaseException), merged 2026-05-07.
In the meantime, Vera v0.0.137 added a defensive workaround in vera/codegen/api.py::host_sleep:
def host_sleep(_caller: wasmtime.Caller, ms: int) -> None:
if ms > 0:
try:
time.sleep(ms / 1000.0)
except KeyboardInterrupt:
# ... long comment about the wasmtime-py trampoline bug ...
raise _VeraExit(130) from None
This converts KeyboardInterrupt to a _VeraExit (an Exception subclass, which the buggy trampoline does catch) and the execute() chain unwraps _VeraExit into a clean exit code 130. User-visible UX is correct (clean SIGINT exit), but the workaround duplicates effort the upstream fix already does properly.
What this bookmark tracks
When the next wasmtime-py release lands on PyPI containing commit 5c84f841:
- Bump
pyproject.toml to require that wasmtime-py minimum (current pin: 43.0.0). Run the full test matrix before merging — this is the broader-surface change.
- Then, in a separate follow-up PR, remove the
_VeraExit(130) guard in vera/codegen/api.py::host_sleep and let KeyboardInterrupt propagate naturally. Keeping the dependency bump and the workaround removal in separate PRs means each can be reverted independently if anything goes wrong.
- Update the test at
tests/test_runtime_traps.py::TestHostSleepKeyboardInterrupt — the structural assertion for the guard becomes a structural assertion that the guard is absent (or just delete it; the end-to-end test stands on its own).
- Close #595 and remove the runtime-workaround entry from
KNOWN_ISSUES.md.
- Close this bookmark issue.
Why a bookmark and not a normal open issue
There's nothing actionable in the Vera codebase today — the work is gated entirely on an upstream release timeline we don't control. The bookmark prevents the workaround from rotting silently in host_sleep once the underlying bug is gone.
Watching
Related
Summary
Bookmark for tracking the removal of Vera's
host_sleep_VeraExit(130)workaround once a wasmtime-py release containing bytecodealliance/wasmtime-py#337 lands on PyPI.Context
#595 tracked the macOS malloc abort during wasmtime cleanup after
Ctrl+Carrives in a host import (originally observed withIO.sleep). Diagnosis: the wasmtime-py trampoline atwasmtime/_func.py:212caughtExceptionrather thanBaseException, soBaseExceptionsubclasses (KeyboardInterrupt,SystemExit, customBaseExceptionsubclasses) escaped the handler and caused a SIGABRT inside Rust'sarray_call_trampolinewith an undefined ABI return value. Filed upstream as bytecodealliance/wasmtime-py#336; fixed by bytecodealliance/wasmtime-py#337 (one-line change toexcept BaseException), merged 2026-05-07.In the meantime, Vera v0.0.137 added a defensive workaround in
vera/codegen/api.py::host_sleep:This converts
KeyboardInterruptto a_VeraExit(anExceptionsubclass, which the buggy trampoline does catch) and theexecute()chain unwraps_VeraExitinto a clean exit code 130. User-visible UX is correct (clean SIGINT exit), but the workaround duplicates effort the upstream fix already does properly.What this bookmark tracks
When the next wasmtime-py release lands on PyPI containing commit
5c84f841:pyproject.tomlto require that wasmtime-py minimum (current pin: 43.0.0). Run the full test matrix before merging — this is the broader-surface change._VeraExit(130)guard invera/codegen/api.py::host_sleepand letKeyboardInterruptpropagate naturally. Keeping the dependency bump and the workaround removal in separate PRs means each can be reverted independently if anything goes wrong.tests/test_runtime_traps.py::TestHostSleepKeyboardInterrupt— the structural assertion for the guard becomes a structural assertion that the guard is absent (or just delete it; the end-to-end test stands on its own).KNOWN_ISSUES.md.Why a bookmark and not a normal open issue
There's nothing actionable in the Vera codebase today — the work is gated entirely on an upstream release timeline we don't control. The bookmark prevents the workaround from rotting silently in
host_sleeponce the underlying bug is gone.Watching
main— confirms the merge is at HEAD (it is, as of 2026-05-07)Related