Stream: git-wasmtime

Topic: wasmtime / issue #15332 Guest debugging lets an exception...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 17 2026 at 21:35):

alexcrichton opened issue #15332:

This test:

(component
  (component $A
    (core module $dtor
      (tag $t)
      (func (export "dtor") (param i32) (throw $t)))
    (core instance $dtor (instantiate $dtor))
    (type $t (resource (rep i32) (dtor (core func $dtor "dtor"))))
    (core func $t.new (canon resource.new $t))
    (export $t' "t" (type $t))
    (func (export "new") (param "rep" u32) (result (own $t'))
      (canon lift (core func $t.new))))

  (component $B
    (import "a" (instance $a
      (export "t" (type $t (sub resource)))
      (export "new" (func (param "rep" u32) (result (own $t))))))
    (core func $new (canon lower (func $a "new")))
    (alias export $a "t" (type $t))
    (core func $t.drop (canon resource.drop $t))
    (core module $b
      (import "" "new" (func $new (param i32) (result i32)))
      (import "" "t.drop" (func $t.drop (param i32)))
      (func (export "run")
        (block $caught
          (try_table (catch_all $caught)
            (call $t.drop (call $new (i32.const 0))))
          (return))
        unreachable))
    (core instance $b (instantiate $b
      (with "" (instance
        (export "new" (func $new))
        (export "t.drop" (func $t.drop))))))
    (func (export "run") (canon lift (core func $b "run"))))

  (instance $a (instantiate $A))
  (instance $b (instantiate $B (with "a" (instance $a))))
  (export "run" (func $b "run")))

(assert_trap (invoke "run") "uncaught exception propagated out of component")

passes without guest debugging, but fails with it:

$ cargo run -- wast foo.wast
$ cargo run -- wast -D guest-debug foo.wast
Error: failed to run script file 'foo.wast'

Caused by:
    0: failed directive on foo.wast:39
    1: expected 'uncaught exception propagated out of component', got 'error while executing at wasm backtrace:
           0:    0x27e - wasm-function[2]
                           at ./foo.wast:28:9

       Caused by:
           wasm trap: wasm `unreachable` instruction executed
       '

The unreachable is in component $B's catch_all block, so $B caught the exception thrown by $A's destructor.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 17 2026 at 21:35):

alexcrichton added the wasmtime:debugging label to Issue #15332.


Last updated: Nov 19 2026 at 20:05 UTC