yadava5 opened PR #14982 from yadava5:fix-shared-memory-fault-panic to bytecodealliance:main:
Fixes #14584.
Store::wasm_faultasserts that only one instance in the store claims the faulting address. That doesn't hold for shared memories: importing one goes throughSharedMemory::vmimport, which creates a single-memory instance that defines the same memory. So in the example from the issue, both$aand 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_addresseach instance reports. It doesn't comparememory_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 atstore.rs:2061on main and passes with this change.cargo test --test wast,cargo test --test all -- shared_memory threads trapsandcargo test -p wasmtime --libpass locally on macOS (aarch64).I used Claude Code to reproduce the bug and test the fix locally.
yadava5 removed the review request for wasmtime-core-reviewers from PR #14982.
yadava5 requested pchickey for a review on PR #14982.
yadava5 requested wasmtime-core-reviewers for a review on PR #14982.
github-actions[bot] added the label wasmtime:api on PR #14982.
pchickey requested alexcrichton for a review on PR #14982.
pchickey removed the review request for pchickey from PR #14982.
:thumbs_up: alexcrichton submitted PR review.
alexcrichton added PR #14982 Don't panic on an out-of-bounds fault in an imported shared memory to the merge queue.
:check: alexcrichton merged PR #14982.
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