Skip to content

Releases: bytecodealliance/wasmtime

dev: Debugging: allow frame cursor to visit all activations. (#12176)

28 Sep 20:31
23b2fe3

Choose a tag to compare

* Debugging: allow frame cursor to visit all activations.

In the initial design for the `DebugFrameCursor`, I was concerned
about the effects of host async on the stability of visiting earlier
activations (see also the discussion of async combinators in #11896).
The basic hypothesized problem was that when Wasm calls host-code
calls Wasm, the sequence of activations on the stack is not even
stable between async polls; so any debugger hook, which is an async
function, should not be allowed to hold a frame cursor across a yield
point since it could become invalidated if the next poll stacks up the
activations differently.

In further conversations it's become clear that this is not actually a
possibility, for the simple reason that the inner re-entrant
activations into the same store take full ownership (mutably reborrow)
that store, and that mut reborrow becomes part of the future; so the
exact chain of activations will remain in the same sequence when
re-polled. Said another way, it is impossible at any given level of
async host-code to create *more than one* future that re-enters the
same store and somehow poll those in different orders at different
times. The worst that a host-code async combinator can do is drop the
future that re-enters the store. This drops and invalidates whatever
frames a cursor held over a yield might be referencing, but it *also*
drops the async invocation of the debugger hook itself, and due to
lifetimes the cursor cannot escape that hook, so everything is still
sound.

This PR thus updates the `DebugFrameCursor` to visit all
activations. I've generalized the backtrace code a bit to enable this,
and built an internal `StoreBacktrace` that is an iterator over all
activations associated with the store.

At the `DebugFrameCursor` (public API) level, the two basic choices
were to present a sentinel for host frame(s) explicitly and make all
Wasm-specific accessors return `Option<T>`, or skip over host
frames. I opted for the latter, with `move_to_parent()` returning an
enum value now that indicates whether it moved to a new activation.

A note regarding the *async* component ABI: once debugging is possible
within a `run_concurrent` environment, it will again be the case that
a single frame cursor should see only one activation, because
each (re)-entry into the store becomes a new task, if my understanding
is correct. At that time, we should build an API that lets the
debugger see the activation for each task separately. That's a simpler
model ultimately, and it will be nice when we move to it, but as long
as we have the sync component ABI with async host code and the ability
to stack activations as we do today, we need to provide the debugger
this visibility.

(Aside: why does the debugger *need* to see more than one activation?
In addition to presenting a weird and incoherent view of the world to
the user if we don't, it is also necessary to implement the
"next" (step-over) debugger action, because otherwise a call to a host
function that re-enters the store may lead to a state with fewer, but
completely disjoint, stack frames on the "one latest activation" from
which it's not possible to reason about whether we've left the
called-into function yet.)

* Review feedback.

* cargo fmt.

v39.0.1: Release Wasmtime 39.0.1 (#12084)

24 Nov 19:29
Immutable release. Only release title and notes can be modified.
0163804

Choose a tag to compare

39.0.1

Released 2025-11-24.

Fixed

  • Compiling the debug feature without the gc feature enabled has been fixed.
    #12074

v39.0.0: Release Wasmtime 39.0.0 (#12050)

20 Nov 15:59
Immutable release. Only release title and notes can be modified.
56b81c9

Choose a tag to compare

39.0.0

Released 2025-11-20.

Added

  • Initial work has begun to support WebAssembly-level debugging natively in
    Wasmtime. This is intended to complement today's preexisting DWARF-level
    debugging, but this work will be portable and operate at the WebAssembly level
    of abstraction rather than the machine-level. Note that this work is not yet
    complete at this time but is expected to get filled out over the coming
    releases.
    #11768
    #11769
    #11873
    #11892
    #11895

  • The pooling allocator now exposes more metrics about unused slots.
    #11789

  • The Wizer and component-init projects have been merged into Wasmtime under
    a new wasmtime wizer CLI subcommand and wasmtime-wizer crate. This is
    mostly a drop-in replacement for both with a minor caveat that the
    initialization function is now called wizer-initialize instead of
    wizer.initialize to be compatible with components.
    #11805
    #11851
    #11853
    #11855
    #11857
    #11863
    #11866
    #11867
    #11877
    #11876
    #11878
    #11891
    #11897
    #11898

  • The Config::wasm_feature method is now public.
    #11812

  • Enabling the wasm exceptions proposal is now exposed in the C API.
    #11861

  • The wasmtime crate now has a custom-sync-primitives Cargo feature which
    enables using custom synchronization primitives defined by the embedder. This
    is useful in no_std targets where the default panic-on-contention primitives
    are not appropriate.
    #11836

  • Wasmtime now supports unsafe intrinsics to be used for compile-time builtins.
    This can be used to provide give low-level access to host APIs/memory to a
    guest program in a controlled fashion.
    #11825
    #11918

  • The signals_based_traps configuration option is now exposed in the C API.
    #11879

  • A new EqRef::from_i31 function has been added.
    #11884

  • The wasmtime serve subcommand will, by default, now reuse instances when
    used with WASIp3 components. This increases throughput and additionally
    showcases the concurrent features of WASIp3. This can be opted-out-of on the
    CLI as well.
    #11807

  • The C++ API for components has been filled out and implemented.
    #11880
    #11889
    #11988

  • A new ResourceDynamic type, similar to Resource<T>, has been added to
    support host resources that have a dynamic tag at runtime rather than a
    statically known tag at compile time. This is then used to implement resources
    in the C/C++ API as well.
    #11885
    #11920

  • The C/C++ API of Wasmtime now supports the custom-page-sizes wasm proposal.
    #11890

  • Initial support has been added for the cooperative multithreading component
    model proposal in Wasmtime, built on async primitives.
    #11751

  • The epoch_deadline_callback Rust API has been bound in C++.
    #11945

  • A new Request::into_http helper has been added to the WASIp3 implementation
    of wasi:http.
    #11843

  • A define_unknown_imports_as_traps function has been added to the C API.
    #11962

  • A callback-based implementation of stdout and stderr has been added to the
    C API for WASI configuration.
    #11965

Changed

  • Running async functions in the component model now operates at the
    Store-level of abstraction rather than an Instance.
    #11796

  • The wasmtime serve subcommand no longer mistakenly spawns an epoch thread
    per-request and instead uses a single epoch thread.
    #11817

  • The component-model-async Cargo feature is now on-by-default. Note that it
    is still gated at runtime by default. Also note that Wasmtime 39 does not include
    #12031 which means
    that components using async produced with the latest wasm-tools will not run
    in Wasmtime 39. To run async components it's recommended to pin to a
    historical version of wasm-tools and guest toolchains for now.
    #11822

  • Bindings generated by wiggle no longer use async_trait.
    #11839

  • Wasmtime's documentation now has an example of a plugin system using Wasmtime.
    #11848

  • Profiling with perfmap or jitdump now uses O_APPEND to be more amenable to
    other engines in the same process also using perfmap/jitdump.
    #11865

  • The wasmtime-wasi-http crate now uses UnsyncBoxBody to clarify that Sync
    is not required.
    #11941

  • A . character is now used instead of / int he bindgen! macro to separate
    interface members.
    #11947

  • The func_new function for component linkers now provides the type to the
    callee so it knows the type that the component that imported it is using.
    #11944

  • The component::Func type now has a type accessor and the old params/result
    accessors were deleted.
    #11943

  • Wasmtime now requires Rust 1.89.0 or later to compile.
    #11959

Fixed

  • Some panics handling shapes of components with resources in various locations
    has been fixed.
    #11798

  • Bitwise float operations in Cranelift have been fixed on aarch64.
    #11811

  • An off-by-one in the bounds check of wasm atomic operations has been fixed.
    #11977

  • Bounds-check elision now happens again with 4 GiB guard pages.
    #11973

v38.0.4: Release Wasmtime 38.0.4 (#12024)

11 Nov 19:12
Immutable release. Only release title and notes can be modified.
4c22e15

Choose a tag to compare

38.0.4

Released 2025-11-11.

Fixed

v37.0.3: Release Wasmtime 37.0.3 (#12025)

11 Nov 18:34
Immutable release. Only release title and notes can be modified.
fb88a74

Choose a tag to compare

37.0.3

Released 2025-11-11.

Fixed

v36.0.3: Release Wasmtime 36.0.3 (#12023)

11 Nov 18:30
Immutable release. Only release title and notes can be modified.
17d037f

Choose a tag to compare

36.0.3

Released 2025-11-11.

Fixed

v24.0.5: Release Wasmtime 24.0.5 (#12026)

11 Nov 18:19
Immutable release. Only release title and notes can be modified.
ef7b9b7

Choose a tag to compare

24.0.5

Released 2025-11-11.

Fixed

v38.0.3: Release Wasmtime 38.0.3 (#11934)

24 Oct 21:40
Immutable release. Only release title and notes can be modified.
d9dc16b

Choose a tag to compare

38.0.3

Released 2025-10-24.

Fixed

  • Fix possible host crash with host-to-wasm component intrinsics
    CVE-2025-62711

v38.0.2: Release Wasmtime 38.0.2 (#11903)

21 Oct 23:06
Immutable release. Only release title and notes can be modified.
b27d62c

Choose a tag to compare

38.0.2

Released 2025-10-21.

Changed

  • This repository is attempting to start out using GitHub's "Immutable Releases"
    feature with this release, and this'll be the first release, assuming all goes
    well, that has this enabled.
    #11901

Fixed

  • Fix compatibility with the Go runtime on Windows for exceptions.
    #11892

v38.0.1: Release Wasmtime 38.0.1 (#11888)

20 Oct 16:34
f2140f6

Choose a tag to compare

38.0.1

Released 2025-10-20.

Fixed

  • Fixed some automation that went wrong with the 38.0.0 release.