Stream: git-wasmtime

Topic: wasmtime / issue #14585 CoW initialization of memories in...


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

alexcrichton opened issue #14585:

This test:

``wasm
(module $M
(type $t (func (result i32)))
(table (export "t") 2 funcref)
(func (export "call") (param i32) (result i32)
(call_indirect (type $t) (local.get 0))))
(register "M" $M)

(assert_trap
(module
(import "M" "t" (table 2 funcref))
(memory 1)
(func $f (result i32) (i32.load8_u (i32.const 0)))
(elem (table 0) (i32.const 0) func $f)
(elem (table 0) (i32.const 2) func $f)
(data (i32.const 0) "\2a"))
"out of bounds table access")

(assert_return (invoke $M "call" (i32.const 0)) (i32.const 0))

fails:

$ wasmtime wast cow-order.wast
Error: failed to run script file 'cow-order.wast'

Caused by:
0: failed directive on cow-order.wast:26
1: result 0 didn't match
2: expected 0 / 0x0000000000000000
actual 42 / 0x000000000000002a

The `data` segment is aplied even though there's an out-of-bounds `elem` segment.
````

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

alexcrichton edited issue #14585:

This test:

(module $M
  (type $t (func (result i32)))
  (table (export "t") 2 funcref)
  (func (export "call") (param i32) (result i32)
    (call_indirect (type $t) (local.get 0))))
(register "M" $M)

(assert_trap
  (module
    (import "M" "t" (table 2 funcref))
    (memory 1)
    (func $f (result i32) (i32.load8_u (i32.const 0)))
    (elem (table 0) (i32.const 0) func $f)
    (elem (table 0) (i32.const 2) func $f)
    (data (i32.const 0) "\2a"))
  "out of bounds table access")

(assert_return (invoke $M "call" (i32.const 0)) (i32.const 0))

fails:

$ wasmtime wast cow-order.wast
Error: failed to run script file 'cow-order.wast'

Caused by:
    0: failed directive on cow-order.wast:26
    1: result 0 didn't match
    2: expected                  0 / 0x0000000000000000
actual                   42 / 0x000000000000002a

The data segment is aplied even though there's an out-of-bounds elem segment.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 08 2026 at 16:49):

fitzgen added the bug label to Issue #14585.


Last updated: Oct 11 2026 at 04:10 UTC