Stream: git-wasmtime

Topic: wasmtime / PR #14982 Don't panic on an out-of-bounds faul...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 24 2026 at 09:03):

yadava5 opened PR #14982 from yadava5:fix-shared-memory-fault-panic to bytecodealliance:main:

Fixes #14584.

Store::wasm_fault asserts that only one instance in the store claims the faulting address. That doesn't hold for shared memories: importing one goes through SharedMemory::vmimport, which creates a single-memory instance that defines the same memory. So in the example from the issue, both $a and that instance report the fault, and the assert fires instead of the trap.

This keeps the check but only panics when the address belongs to two different memories, by comparing the wasm_address each instance reports. It doesn't compare memory_size, since a shared memory can be grown by another thread between the two reads.

I added the example from the issue as tests/misc_testsuite/threads/shared-memory-imported-oob.wast. It panics at store.rs:2061 on main and passes with this change. cargo test --test wast, cargo test --test all -- shared_memory threads traps and cargo test -p wasmtime --lib pass locally on macOS (aarch64).

I used Claude Code to reproduce the bug and test the fix locally.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 24 2026 at 09:03):

yadava5 removed the review request for wasmtime-core-reviewers from PR #14982.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 24 2026 at 09:03):

yadava5 requested pchickey for a review on PR #14982.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 24 2026 at 09:03):

yadava5 requested wasmtime-core-reviewers for a review on PR #14982.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 24 2026 at 11:44):

github-actions[bot] added the label wasmtime:api on PR #14982.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 26 2026 at 17:54):

pchickey requested alexcrichton for a review on PR #14982.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 26 2026 at 17:54):

pchickey removed the review request for pchickey from PR #14982.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 26 2026 at 22:18):

:thumbs_up: alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 26 2026 at 22:18):

alexcrichton added PR #14982 Don't panic on an out-of-bounds fault in an imported shared memory to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 26 2026 at 23:11):

:check: alexcrichton merged PR #14982.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 26 2026 at 23:11):

alexcrichton removed PR #14982 Don't panic on an out-of-bounds fault in an imported shared memory from the merge queue.


Last updated: Oct 31 2026 at 23:03 UTC