alexcrichton edited issue #11666:
Test Case
composed.wasm
runner-c.wasm
test-c.wasmSteps to Reproduce
- Use the WIT interface:
package my:test; interface i { ping: async func(x: future<string>, y: string) -> future<string>; pong: async func(x: future<string>) -> string; } world test { export i; } world runner { import i; }
- Compile two components: runner-c.wasm (UTF-8) and test-c.wasm (UTF-16). Both of these components are built from
wit-bindgenping-pong test- Compose these components into a single composed.wasm using wasm-tools component compose.
- Run composed.wasm using Wasmtime.
Expected Results
The async function should complete successfully, and the
task.returnoperation should not panic.Actual Results
Error: failed to run main module `composed.wasm` Caused by: 0: failed to invoke `run` function 1: error while executing at wasm backtrace: 0: 0x2ca9f - test-c.core.wasm!exports_test_async_ping_return 1: 0x2bf63 - test-c.core.wasm!exports_test_async_ping_callback 2: 0x2ca51 - test-c.core.wasm!__wasm_export_exports_test_async_ping_callback note: using the `WASMTIME_BACKTRACE_DETAILS=1` environment variable may show more debugging information 2: invalid `task.return` signature and/or options for current taskVersions and Environment
Wasmtime version or commit: wasmtime 38.0.0 (024db5b4e 2025-09-08)
Operating system: MacOS 15.6.1
Architecture: arm64
Extra Info
The async lift of the function's signature contains UTF-16 encoding information. If this encoding is modified to UTF-8, the program will continue to run.
alexcrichton added the wasm-proposal:component-model-async label to Issue #11666.
alexcrichton transferred issue #11666 component model async: trap in task.return when using different string encodings to bytecodealliance/wasm-tools/#2301.
Last updated: Dec 06 2025 at 06:05 UTC