Repository navigation
Conversation
Since the late-November deps refresh the wasm smoke test hangs on Linux CI with no output at all, while it passes on macOS with the same Node, rustc and wasm. Run it through scripts/ci/hang-report.sh with a 120 s deadline: a preload writes every JS Atomics.wait, Worker creation and binding module load to stderr synchronously, and on a hang the script dumps the threads, a Node report and gdb backtraces of every thread. The job also gets a 30 minute timeout so a deadlock no longer holds the runner for 6 hours. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first traced run showed the wasm smoke test does not deadlock: the main thread spins at 100% CPU in JIT code right after the runtime modules load, before any Worker exists, and never takes the report interrupt. gdb could not unwind past frame 0. Run node with --perf-basic-prof, sample the main thread's frame pointer chain five times, and name each return address through V8's perf map. The debug build keeps the wasm name section so wasm frames resolve to Rust functions; the wasm and the perf map are uploaded with the reports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The traced run put the spinning main thread in wasi-libc's __pthread_key_delete during module init, walking a thread list whose main thread entry was never linked. Local builds with the same rustc 1.100 link Rust's self-contained wasi-libc and call __init_tp before that delete; the CI wasm links a different libc. Drop the wasi-sdk install to test whether the SDK's libc is what hangs. Nothing in the wasm build compiles C. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Debug only. The hang is traced to wasi-sdk-29 + rustc 1.100 (wasi-libc __pthread_key_delete spin at init); fixed in #54. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Debug PR, not meant to merge as is.
Since the deps refresh in 03ee2a9 the
Test (wasm32-wasip1-threads fallback)smoke step hangs on Linux CI every time (main run, release PR #52 and its rerun), printing nothing at all, not even the WASIExperimentalWarningthat the last green run printed within 0.1 s. The same wasm passes on macOS with the same Node 26.13.1, rustc 1.100.0 and deps, so the main thread most likely blocks synchronously before the first tick, on Linux only (the runner also moved from ubuntu-24.04 to ubuntu-26.04).This PR runs the smoke step through
scripts/ci/hang-report.shwith a 120 s deadline:scripts/ci/trace-blocking.cjsis preloaded and writes every JSAtomics.wait, Worker creation and binding/napi-rs/emnapi module load to stderr synchronously, so the last lines name the call that never returned.SIGUSR2, and gdb backtraces of every thread, then fails with exit code 124. Reports are uploaded as thewasm-hang-reportartifact.timeout-minutes: 30.Checked locally: the smoke test passes through the wrapper, exit codes pass through, and a synthetic hang (main thread and a Worker in
Atomics.wait) shows both stuck calls with stacks.🤖 Generated with Claude Code