Stream: git-wasmtime

Topic: wasmtime / issue #10459 [GC] id from different slab


view this post on Zulip Wasmtime GitHub notifications bot (Mar 21 2025 at 23:39):

vouillon added the bug label to Issue #10459.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 21 2025 at 23:40):

vouillon opened issue #10459:

Test Case

fail.zip

Steps to Reproduce

Run the following command:

./target/debug/wasmtime  -W=all-proposals=y fail.wasm

Expected Results

It should not crash.

Actual Results

We get a panic:

thread 'main' panicked at /home/jerome/sources/wasmtime/crates/slab/src/lib.rs:387:14:
id from different slab

Versions and Environment

Wasmtime commit: dbed370c8a0e1522c33a7cb8e086f04cffcf8378 (PR #10456)

Operating system: Linux

Architecture: x64

view this post on Zulip Wasmtime GitHub notifications bot (Mar 21 2025 at 23:42):

fitzgen commented on issue #10459:

Thanks! Will look into this next week

view this post on Zulip Wasmtime GitHub notifications bot (Mar 24 2025 at 19:47):

fitzgen commented on issue #10459:

Ah, it turns out that our struct field packing/reordering is invalid in the presence of subtyping. D'oh.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 24 2025 at 19:51):

fitzgen commented on issue #10459:

Slightly reduced test case:

(module
  (type $func (func))

  (type $super (sub (struct (field (ref $func)))))
  (type $sub (sub final $super (struct (field (ref $func)) (field (ref eq)))))

  (elem declare func $f)
  (func $f)

  (func (export "_start")
    (drop
      (struct.get $super 0
        (struct.new $sub
          (ref.func $f)
          (ref.i31 (i32.const 0)))))
  )
)

view this post on Zulip Wasmtime GitHub notifications bot (Mar 25 2025 at 23:19):

fitzgen closed issue #10459:

Test Case

fail.zip

Steps to Reproduce

Run the following command:

./target/debug/wasmtime  -W=all-proposals=y fail.wasm

Expected Results

It should not crash.

Actual Results

We get a panic:

thread 'main' panicked at /home/jerome/sources/wasmtime/crates/slab/src/lib.rs:387:14:
id from different slab

Versions and Environment

Wasmtime commit: dbed370c8a0e1522c33a7cb8e086f04cffcf8378 (PR #10456)

Operating system: Linux

Architecture: x64


Last updated: Apr 17 2025 at 19:03 UTC