Open sisou opened 3 weeks ago
Upstream issue: https://github.com/rustwasm/wasm-bindgen/issues/2562
That might be a different issue. @sisou's log shows a panic at wasm-bindgen-futures-0.4.43/src/task/singlethread.rs:102 whereas the linked issue panicked at wasm-bindgen-futures-0.4.23/src/lib.rs:133:39.
Ah, further down, another commenter has wasm-bindgen-futures-0.4.37/src/task/singlethread.rs:85:37, which looks like the same line as we have.
What I find weird is that $wasm_bindgen_futures::task::singlethread::Task::run
appears twice in the backtrace. I believe that is not supposed to happen and it also doesn't happen in the comments in the linked issue.
$wasm_bindgen_futures::task::singlethread::Task::run::h1b648edc6b87103c
$wasm_bindgen_futures::queue::QueueState::run_all::hc8a12e6e9111dd6a
$wasm_bindgen_futures::queue::Queue::new::{{closure}}::h35a0e2c32cdf70bd
$<dyn core::ops::function::FnMut<(A,)>+Output = R as wasm_bindgen::closure::WasmClosure>::describe::invoke::h115103efd84fbeb7
__wbg_adapter_68
real
setTimeout
[…]
$wasm_bindgen_futures::task::singlethread::Task::run::h1b648edc6b87103c
$wasm_bindgen_futures::queue::QueueState::run_all::hc8a12e6e9111dd6a
$wasm_bindgen_futures::queue::Queue::new::{{closure}}::h35a0e2c32cdf70bd
$<dyn core::ops::function::FnMut<(A,)>+Output = R as wasm_bindgen::closure::WasmClosure>::describe::invoke::h115103efd84fbeb7
__wbg_adapter_68
real
Another weird thing is that the stacktrace has setTimeout
in it. AFAIK, setTimeout
is not supposed to call the callback immediately, even if the timeout is set to 0. I tried to test that in my Chromium (Version 129.0.6668.42 (Official Build) Arch Linux (64-bit)) and I get:
> window.setTimeout(() => console.log("from timeout")); console.log("after setTimeout");
after setTimeout
undefined
from timeout
which matches my understanding.
Thanks to @sisou for explaining to me that the stack trace of the callback includes the stack trace of the time when setTimeout
is called. I didn't expect that.
In the latest version
v0.24.0
I am observing a new panic in the WASMweb-client
in the Chrome browser: