Repository navigation
Closed
Description
Seeing this
C:\emsdk\emscripten\main>test\runner core2ss.test_wasm_worker_futex_wait
Running 1 tests
[1/1] test_wasm_worker_futex_wait (test_core.core2ss.test_wasm_worker_futex_wait) ... FAIL
Stdout:
-- begin program output --
Worker sleeping on futex...
Aborted(stack overflow (Attempt to set SP to 0x00010e30, with stack limits [0x00010ea0 - 0x000112a0]). If you require more stack space build with -sSTACK_SIZE=<bytes>)
worker sent an error! Aborted(stack overflow (Attempt to set SP to 0x00010e30, with stack limits [0x00010ea0 - 0x000112a0]). If you require more stack space build with -sSTACK_SIZE=<bytes>). Build with -sASSERTIONS for more info.
node:internal/event_target:1101
process.nextTick(() => { throw err; });
^
RuntimeError: Aborted(stack overflow (Attempt to set SP to 0x00010e30, with stack limits [0x00010ea0 - 0x000112a0]). If you require more stack space build with -sSTACK_SIZE=<bytes>). Build with -sASSERTIONS for more info.
at abort (C:\emsdk\emscripten\main\out\test\wasm_worker_futex_wait.js:1:6159)
at ___handle_stack_overflow (C:\emsdk\emscripten\main\out\test\wasm_worker_futex_wait.js:1:12797)
at wasm://wasm/0001364a:wasm-function[44]:0x34af
at wasm://wasm/0001364a:wasm-function[45]:0x3e2b
at wasm://wasm/0001364a:wasm-function[39]:0x2fed
at wasm://wasm/0001364a:wasm-function[38]:0x2685
at wasm://wasm/0001364a:wasm-function[19]:0x61b
at C:\emsdk\emscripten\main\out\test\wasm_worker_futex_wait.js:1:9729
at callUserCallback (C:\emsdk\emscripten\main\out\test\wasm_worker_futex_wait.js:1:9373)
at _wasmWorkerRunPostMessage (C:\emsdk\emscripten\main\out\test\wasm_worker_futex_wait.js:1:9681)
at MessagePort.f (C:\emsdk\emscripten\main\out\test\wasm_worker_futex_wait.js:1:4345)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:827:20)
at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)
Thrown at:
at node:internal/event_target:1101:28
at processTicksAndRejections (node:internal/process/task_queues:85:11)
Node.js v22.16.0
-- end program output --
======================================================================
FAIL: test_wasm_worker_futex_wait (test_core.core2ss.test_wasm_worker_futex_wait)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\emsdk\emscripten\main\test\test_core.py", line 130, in decorated
return func(self, *args, **kwargs)
File "C:\emsdk\emscripten\main\test\test_core.py", line 382, in decorated
return func(self, *args, **kwargs)
File "C:\emsdk\emscripten\main\test\test_core.py", line 171, in decorated
return func(self, *args, **kwargs)
File "C:\emsdk\emscripten\main\test\test_core.py", line 9728, in test_wasm_worker_futex_wait
self.do_runf('wasm_worker/wasm_worker_futex_wait.c', cflags=['-sWASM_WORKERS'])
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\emsdk\emscripten\main\test\common.py", line 1387, in do_runf
return self._build_and_run(filename, expected_output, **kwargs)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\emsdk\emscripten\main\test\common.py", line 1435, in _build_and_run
js_output = self.run_js(js_file, engine, args,
input=input,
assert_returncode=assert_returncode,
interleaved_output=interleaved_output)
File "C:\emsdk\emscripten\main\test\common.py", line 1019, in run_js
self.fail('JS subprocess failed (%s): %s (expected=%s). Output:\n%s' % (error.cmd, error.returncode, assert_returncode, ret))
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: JS subprocess failed (C:/emsdk/node/22.16.0_64bit/bin/node.exe --stack-trace-limit=50 --trace-uncaught C:\emsdk\emscripten\main\out\test\wasm_worker_futex_wait.js): 1 (expected=0). Output:
Worker sleeping on futex...
Aborted(stack overflow (Attempt to set SP to 0x00010e30, with stack limits [0x00010ea0 - 0x000112a0]). If you require more stack space build with -sSTACK_SIZE=<bytes>)
worker sent an error! Aborted(stack overflow (Attempt to set SP to 0x00010e30, with stack limits [0x00010ea0 - 0x000112a0]). If you require more stack space build with -sSTACK_SIZE=<bytes>). Build with -sASSERTIONS for more info.
node:internal/event_target:1101
process.nextTick(() => { throw err; });
^
RuntimeError: Aborted(stack overflow (Attempt to set SP to 0x00010e30, with stack limits [0x00010ea0 - 0x000112a0]). If you require more stack space build with -sSTACK_SIZE=<bytes>). Build with -sASSERTIONS for more info.
at abort (C:\emsdk\emscripten\main\out\test\wasm_worker_futex_wait.js:1:6159)
at ___handle_stack_overflow (C:\emsdk\emscripten\main\out\test\wasm_worker_futex_wait.js:1:12797)
at wasm://wasm/0001364a:wasm-function[44]:0x34af
at wasm://wasm/0001364a:wasm-function[45]:0x3e2b
at wasm://wasm/0001364a:wasm-function[39]:0x2fed
at wasm://wasm/0001364a:wasm-function[38]:0x2685
at wasm://wasm/0001364a:wasm-function[19]:0x61b
at C:\emsdk\emscripten\main\out\test\wasm_worker_futex_wait.js:1:9729
at callUserCallback (C:\emsdk\emscripten\main\out\test\wasm_worker_futex_wait.js:1:9373)
at _wasmWorkerRunPostMessage (C:\emsdk\emscripten\main\out\test\wasm_worker_futex_wait.js:1:9681)
at MessagePort.f (C:\emsdk\emscripten\main\out\test\wasm_worker_futex_wait.js:1:4345)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:827:20)
at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)
Thrown at:
at node:internal/event_target:1101:28
at processTicksAndRejections (node:internal/process/task_queues:85:11)
Node.js v22.16.0
Stdout:
-- begin program output --
Worker sleeping on futex...
Aborted(stack overflow (Attempt to set SP to 0x00010e30, with stack limits [0x00010ea0 - 0x000112a0]). If you require more stack space build with -sSTACK_SIZE=<bytes>)
worker sent an error! Aborted(stack overflow (Attempt to set SP to 0x00010e30, with stack limits [0x00010ea0 - 0x000112a0]). If you require more stack space build with -sSTACK_SIZE=<bytes>). Build with -sASSERTIONS for more info.
node:internal/event_target:1101
process.nextTick(() => { throw err; });
^
RuntimeError: Aborted(stack overflow (Attempt to set SP to 0x00010e30, with stack limits [0x00010ea0 - 0x000112a0]). If you require more stack space build with -sSTACK_SIZE=<bytes>). Build with -sASSERTIONS for more info.
at abort (C:\emsdk\emscripten\main\out\test\wasm_worker_futex_wait.js:1:6159)
at ___handle_stack_overflow (C:\emsdk\emscripten\main\out\test\wasm_worker_futex_wait.js:1:12797)
at wasm://wasm/0001364a:wasm-function[44]:0x34af
at wasm://wasm/0001364a:wasm-function[45]:0x3e2b
at wasm://wasm/0001364a:wasm-function[39]:0x2fed
at wasm://wasm/0001364a:wasm-function[38]:0x2685
at wasm://wasm/0001364a:wasm-function[19]:0x61b
at C:\emsdk\emscripten\main\out\test\wasm_worker_futex_wait.js:1:9729
at callUserCallback (C:\emsdk\emscripten\main\out\test\wasm_worker_futex_wait.js:1:9373)
at _wasmWorkerRunPostMessage (C:\emsdk\emscripten\main\out\test\wasm_worker_futex_wait.js:1:9681)
at MessagePort.f (C:\emsdk\emscripten\main\out\test\wasm_worker_futex_wait.js:1:4345)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:827:20)
at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)
Thrown at:
at node:internal/event_target:1101:28
at processTicksAndRejections (node:internal/process/task_queues:85:11)
Node.js v22.16.0
-- end program output --
----------------------------------------------------------------------
Ran 1 test in 1.623s
FAILED (failures=1)
in
Bisected this back to
4cadbe344f6b9f471a609637588ea6d99a3d100c is the first bad commit
commit 4cadbe344f6b9f471a609637588ea6d99a3d100c
Author: Sam Clegg <[email protected]>
Date: Wed Apr 8 12:00:47 2026 -0700
Fix for exceptions in Wasm Workers under node (#26650)
Under node we install the `uncaughtException` handler in workers (both
in pthread and wasm worker). This means that `uncaughtException` is sent
via `postMessage` back to the main thread. See
https://github.com/nodejs/node/issues/59617 for why we do this.
However, these message was simply being ignored by the main thread in
the case of Wasm Workers.
With this change we honor the `uncaughtException` message and avoid
completely loosing the uncaught exception.
src/lib/libwasm_worker.js | 12 +++++++++++-
test/test_core.py | 4 ++++
test/wasm_worker/test_wasm_worker_exceptions.c | 19 +++++++++++++++++++
3 files changed, 34 insertions(+), 1 deletion(-)
create mode 100644 test/wasm_worker/test_wasm_worker_exceptions.c
Metadata
Metadata
Assignees
Labels
No labels
Activity
juj commentedon Apr 21, 2026
Dropping a
-gthere prints a cleaner callstacksbc100 commentedon Apr 21, 2026
I wonder if the error was already there but just not being reported prior to the fix in #26650?
juj commentedon Apr 21, 2026
That could very well be. The callstack does not seem recursive, so I wonder if the root cause is just that the default callstack size is too small for printf()..
Increase stack size in test_wasm_worker_futex_wait (#26744)