Skip to content

v0.0.160 — Centralized Ctrl-C handling; drop _VeraExit(130) workaround

Choose a tag to compare

@aallan aallan released this 29 May 08:32
· 328 commits to main since this release
9f5158f

Changed

  • #599 — bumped the wasmtime floor from >=44.0.0 to >=45.0.0. 45.0.0 (released 2026-05-26) is the first PyPI release whose host-import trampoline catches BaseException rather than Exception (bytecodealliance/wasmtime-py#337, merged 2026-05-07 — the 44.0.0 tag predates it). Vera filed the upstream issue (#336) after a Ctrl-C during IO.sleep in a Conway's Life animation aborted with a libmalloc SIGABRT (#595): a raw KeyboardInterrupt (a BaseException) escaped the except Exception trampoline into Rust with an undefined ABI return value. 45.0.0 makes the raw propagation safe — the wasm call unwinds and the original KeyboardInterrupt re-raises in Python at the call site.

Removed

  • #599 / #595 — removed the four per-host-import except KeyboardInterrupt: raise _VeraExit(130) workaround guards (one in host_sleep, three across host_read_char's Unix-non-TTY / Unix-TTY-cbreak / Windows-getwch branches). These laundered KeyboardInterrupt into _VeraExit (an Exception) so the pre-45 buggy trampoline would catch it. With wasmtime>=45.0.0 the launder is unnecessary: a single except KeyboardInterrupt handler at the func(store, ...) call site in execute() now maps a Ctrl-C in any host import to the conventional SIGINT exit code (130), preserving captured stdout/stderr/state exactly as the IO.exit path does. One source of truth replaces four duplicated guards. The Unix-TTY path's terminal restore stays correct — it lives in a finally, so the terminal is returned to canonical mode before the interrupt propagates. Net behaviour is unchanged (clean exit 130, pre-interrupt output preserved); the end-to-end test that pins this contract passes identically before and after the relocation.