emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.84k stars 3.31k forks source link

test_pthread_c11_threads_proxied is flaky #22490

Open sbc100 opened 2 months ago

sbc100 commented 2 months ago

e.g.: https://logs.chromium.org/logs/emscripten-releases/buildbucket/cr-buildbucket/8738005946718947137/+/u/Emscripten_testsuite__wasm64l_/stdout

======================================================================
FAIL: test_pthread_c11_threads_proxied (test_core.wasm64l)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/chrome-bot/.cache/.vpython-root/store/cpython+om91v4af6p3vd80bvh1mrrm980/contents/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/home/chrome-bot/.cache/.vpython-root/store/cpython+om91v4af6p3vd80bvh1mrrm980/contents/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/home/chrome-bot/.cache/.vpython-root/store/cpython+om91v4af6p3vd80bvh1mrrm980/contents/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/b/s/w/ir/x/w/install/emscripten/test/common.py", line 771, in resulting_test
    return func(self, *args)
  File "/b/s/w/ir/x/w/install/emscripten/test/common.py", line 330, in decorated
    f(self, *args, **kwargs)
  File "/b/s/w/ir/x/w/install/emscripten/test/test_core.py", line 9131, in test_pthread_c11_threads
    self.do_run_in_out_file_test('pthread/test_pthread_c11_threads.c')
  File "/b/s/w/ir/x/w/install/emscripten/test/common.py", line 1771, in do_run_in_out_file_test
    output = self._build_and_run(srcfile, expected, **kwargs)
  File "/b/s/w/ir/x/w/install/emscripten/test/common.py", line 1809, in _build_and_run
    js_output = self.run_js(js_file, engine, args,
  File "/b/s/w/ir/x/w/install/emscripten/test/common.py", line 1404, in run_js
    self.fail('JS subprocess failed (%s): %s (expected=%s).  Output:\n%s' % (error.cmd, error.returncode, assert_returncode, ret))
  File "/home/chrome-bot/.cache/.vpython-root/store/cpython+om91v4af6p3vd80bvh1mrrm980/contents/lib/python3.8/unittest/case.py", line 753, in fail
    raise self.failureException(msg)
AssertionError: JS subprocess failed (/b/s/w/ir/cache/builder/emscripten-releases/node-v20.14.0-linux-x64/bin/node --stack-trace-limit=50 --trace-uncaught /b/s/w/ir/x/t/emtest_5lbt141g/emscripten_test_wasm64l_dr3ge4qy/test_pthread_c11_threads.js): 1 (expected=0).  Output:
locateFile: test_pthread_c11_threads.wasm scriptDirectory: /b/s/w/ir/x/t/emtest_5lbt141g/emscripten_test_wasm64l_dr3ge4qy/
asynchronously preparing wasm
run() called, but dependencies remain, so not running
initRuntime
threadInitTLS
runtimeKeepalivePush -> counter=1
createThread: 0x00012be0
Allocating a new web worker from /b/s/w/ir/x/t/emtest_5lbt141g/emscripten_test_wasm64l_dr3ge4qy/test_pthread_c11_threads.js
main thread called exit(0): keepRuntimeAlive=true (counter=1)
proc_exit: 0
handleException: unwinding: EXITSTATUS=0
run() called, but dependencies remain, so not running
worker: loading module
initRuntime
establishStackSpace: 0x000230d0 -> 0x000130d0
threadInitTLS
invokeEntryPoint: 0x00000006
thrd_current: 0x12be0
maybeExit: user callback done: runtimeKeepaliveCounter=1
createThread: 0x00024a10
createThread: 0x00024a10
Allocating a new web worker from /b/s/w/ir/x/t/emtest_5lbt141g/emscripten_test_wasm64l_dr3ge4qy/test_pthread_c11_threads.js
maybeExit: user callback done: runtimeKeepaliveCounter=1
createThread: 0x00035ba0
createThread: 0x00035ba0
Allocating a new web worker from /b/s/w/ir/x/t/emtest_5lbt141g/emscripten_test_wasm64l_dr3ge4qy/test_pthread_c11_threads.js
maybeExit: user callback done: runtimeKeepaliveCounter=1
createThread: 0x00046d30
createThread: 0x00046d30
Allocating a new web worker from /b/s/w/ir/x/t/emtest_5lbt141g/emscripten_test_wasm64l_dr3ge4qy/test_pthread_c11_threads.js
maybeExit: user callback done: runtimeKeepaliveCounter=1
createThread: 0x00057ec0
createThread: 0x00057ec0
Allocating a new web worker from /b/s/w/ir/x/t/emtest_5lbt141g/emscripten_test_wasm64l_dr3ge4qy/test_pthread_c11_threads.js
maybeExit: user callback done: runtimeKeepaliveCounter=1
run() called, but dependencies remain, so not running
worker: loading module
initRuntime
establishStackSpace: 0x00034f00 -> 0x00024f00
threadInitTLS
invokeEntryPoint: 0x00000003
in thread_main 0x24a10
maybeExit: user callback done: runtimeKeepaliveCounter=1
in do_once
maybeExit: user callback done: runtimeKeepaliveCounter=1
destructor: 0x24a10
maybeExit: user callback done: runtimeKeepaliveCounter=1
run() called, but dependencies remain, so not running
run() called, but dependencies remain, so not running
worker: loading module
initRuntime
establishStackSpace: 0x00057220 -> 0x00047220
threadInitTLS
invokeEntryPoint: 0x00000003
in thread_main 0x46d30
maybeExit: user callback done: runtimeKeepaliveCounter=1
destructor: 0x46d30
maybeExit: user callback done: runtimeKeepaliveCounter=1
worker: loading module
initRuntime
establishStackSpace: 0x00046090 -> 0x00036090
threadInitTLS
invokeEntryPoint: 0x00000003
in thread_main 0x35ba0
maybeExit: user callback done: runtimeKeepaliveCounter=1
destructor: 0x35ba0
maybeExit: user callback done: runtimeKeepaliveCounter=1
run() called, but dependencies remain, so not running
worker: loading module
initRuntime
establishStackSpace: 0x000683b0 -> 0x000583b0
threadInitTLS
invokeEntryPoint: 0x00000003
in thread_main 0x57ec0
maybeExit: user callback done: runtimeKeepaliveCounter=1
destructor: 0x57ec0
maybeExit: user callback done: runtimeKeepaliveCounter=1
_emscripten_thread_cleanup: 0x00024a10
cleanupThread: 0x00024a10
t1 joined
maybeExit: user callback done: runtimeKeepaliveCounter=1
_emscripten_thread_cleanup: 0x00035ba0
t2 joined
maybeExit: user callback done: runtimeKeepaliveCounter=1
_emscripten_thread_cleanup: 0x00046d30
cleanupThread: 0x00035ba0
cleanupThread: 0x00046d30
t3 joined
maybeExit: user callback done: runtimeKeepaliveCounter=1
_emscripten_thread_cleanup: 0x00057ec0
cleanupThread: 0x00057ec0
t4 joined
maybeExit: user callback done: runtimeKeepaliveCounter=1
createThread: 0x00024a10
createThread: 0x00024a10
maybeExit: user callback done: runtimeKeepaliveCounter=1
establishStackSpace: 0x00034f00 -> 0x00024f00
threadInitTLS
invokeEntryPoint: 0x00000004
_emscripten_thread_cleanup: 0x00024a10
createThread: 0x00034f20
createThread: 0x00034f20
maybeExit: user callback done: runtimeKeepaliveCounter=1
worker: Pthread 0x0 completed its main entry point with an 'unwind', keeping the worker alive for asynchronous operation.
cleanupThread: 0x00024a10
establishStackSpace: 0x00045410 -> 0x00035410
threadInitTLS
invokeEntryPoint: 0x00000005
in thread_main_detached 0x34f20
maybeExit: user callback done: runtimeKeepaliveCounter=1
done!
_emscripten_thread_cleanup: 0x00034f20
maybeExit: user callback done: runtimeKeepaliveCounter=1
Pthread 0x00012be0 called exit(0), posting exitOnMainThread.
cleanupThread: 0x00034f20
worker: Pthread 0x12be0 completed its main entry point with an 'unwind', keeping the worker alive for asynchronous operation.
exitOnMainThread
runtimeKeepalivePop -> counter=0
main thread called exit(0): keepRuntimeAlive=false (counter=0)
exitRuntime
terminateAllThreads
terminateWorker: undefined
terminateWorker: undefined
terminateWorker: undefined
terminateWorker: undefined
terminateWorker: undefined
proc_exit: 0
terminateAllThreads

node:internal/event_target:1099
  process.nextTick(() => { throw err; });
                           ^
ExitStatus {
  name: 'ExitStatus',
  message: 'Program terminated with exit(0)',
  status: 0
}
Thrown at:
    at node:internal/event_target:1099:28
    at processTicksAndRejections (node:internal/process/task_queues:77:11)

Node.js v20.14.0

and


======================================================================
FAIL: test_pthread_c11_threads_proxied (test_core.core0)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\chrome-bot\AppData\Local\.vpython-root\store\cpython+ml1s5c39krmoj92702hi8ng33o\contents\bin\Lib\unittest\case.py", line 60, in testPartExecutor
    yield
  File "C:\Users\chrome-bot\AppData\Local\.vpython-root\store\cpython+ml1s5c39krmoj92702hi8ng33o\contents\bin\Lib\unittest\case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "C:\Users\chrome-bot\AppData\Local\.vpython-root\store\cpython+ml1s5c39krmoj92702hi8ng33o\contents\bin\Lib\unittest\case.py", line 633, in _callTestMethod
    method()
  File "C:\b\s\w\ir\x\w\install\emscripten\test\common.py", line 771, in resulting_test
    return func(self, *args)
  File "C:\b\s\w\ir\x\w\install\emscripten\test\common.py", line 330, in decorated
    f(self, *args, **kwargs)
  File "C:\b\s\w\ir\x\w\install\emscripten\test\test_core.py", line 9131, in test_pthread_c11_threads
    self.do_run_in_out_file_test('pthread/test_pthread_c11_threads.c')
  File "C:\b\s\w\ir\x\w\install\emscripten\test\common.py", line 1771, in do_run_in_out_file_test
    output = self._build_and_run(srcfile, expected, **kwargs)
  File "C:\b\s\w\ir\x\w\install\emscripten\test\common.py", line 1809, in _build_and_run
    js_output = self.run_js(js_file, engine, args,
  File "C:\b\s\w\ir\x\w\install\emscripten\test\common.py", line 1404, in run_js
    self.fail('JS subprocess failed (%s): %s (expected=%s).  Output:\n%s' % (error.cmd, error.returncode, assert_returncode, ret))
  File "C:\Users\chrome-bot\AppData\Local\.vpython-root\store\cpython+ml1s5c39krmoj92702hi8ng33o\contents\bin\Lib\unittest\case.py", line 753, in fail
    raise self.failureException(msg)
AssertionError: JS subprocess failed (C:/b/s/w/ir/cache/builder/emscripten-releases/node-v20.14.0-win-x64/node.exe --stack-trace-limit=50 --trace-uncaught C:\b\s\w\ir\x\t\emtest_ivq2ig90\emscripten_test_core0_xqz4unt9\test_pthread_c11_threads.js): 1 (expected=0).  Output:
w:0,t:0x00000000: locateFile: test_pthread_c11_threads.wasm scriptDirectory: C:\b\s\w\ir\x\t\emtest_ivq2ig90\emscripten_test_core0_xqz4unt9/
w:0,t:0x00000000: asynchronously preparing wasm
w:0,t:0x00000000: run() called, but dependencies remain, so not running
w:0,t:0x00000000: writeStackCookie: 0x00000000
w:0,t:0x00000000: initRuntime
w:0,t:0x00000000: checkStackCookie: 0x00000000
w:0,t:0x000116a4: threadInitTLS
w:0,t:0x000116a4: checkStackCookie: 0x00000000
w:0,t:0x000116a4: runtimeKeepalivePush -> counter=1
w:0,t:0x000116a4: createThread: 0x00012870
w:0,t:0x000116a4: Allocating a new web worker from C:\b\s\w\ir\x\t\emtest_ivq2ig90\emscripten_test_core0_xqz4unt9\test_pthread_c11_threads.js
w:0,t:0x000116a4: main thread called exit(0): keepRuntimeAlive=true (counter=1)
w:0,t:0x000116a4: proc_exit: 0
w:0,t:0x000116a4: handleException: unwinding: EXITSTATUS=0
w:0,t:0x000116a4: checkStackCookie: 0x00000000
w:0,t:0x000116a4: checkStackCookie: 0x00000000
w:0,t:0x00000000: run() called, but dependencies remain, so not running
w:1,t:0x00000000: worker: loading module
w:1,t:0x00000000: initRuntime
w:1,t:0x00000000: establishStackSpace: 0x00022b00 -> 0x00012b00
w:1,t:0x00000000: writeStackCookie: 0x00012b00
w:1,t:0x00012870: threadInitTLS
w:1,t:0x00012870: invokeEntryPoint: 0x00000006
thrd_current: 0x12870
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:1,t:0x00012870: createThread: 0x000237b8
w:0,t:0x000116a4: createThread: 0x000237b8
w:0,t:0x000116a4: Allocating a new web worker from C:\b\s\w\ir\x\t\emtest_ivq2ig90\emscripten_test_core0_xqz4unt9\test_pthread_c11_threads.js
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:1,t:0x00012870: createThread: 0x000340a8
w:0,t:0x000116a4: createThread: 0x000340a8
w:0,t:0x000116a4: Allocating a new web worker from C:\b\s\w\ir\x\t\emtest_ivq2ig90\emscripten_test_core0_xqz4unt9\test_pthread_c11_threads.js
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:1,t:0x00012870: createThread: 0x00044998
w:0,t:0x000116a4: createThread: 0x00044998
w:0,t:0x000116a4: Allocating a new web worker from C:\b\s\w\ir\x\t\emtest_ivq2ig90\emscripten_test_core0_xqz4unt9\test_pthread_c11_threads.js
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:1,t:0x00012870: createThread: 0x00055288
w:0,t:0x000116a4: createThread: 0x00055288
w:0,t:0x000116a4: Allocating a new web worker from C:\b\s\w\ir\x\t\emtest_ivq2ig90\emscripten_test_core0_xqz4unt9\test_pthread_c11_threads.js
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:0,t:0x00000000: run() called, but dependencies remain, so not running
w:2,t:0x00000000: worker: loading module
w:2,t:0x00000000: initRuntime
w:2,t:0x00000000: establishStackSpace: 0x00033a50 -> 0x00023a50
w:2,t:0x00000000: writeStackCookie: 0x00023a50
w:2,t:0x000237b8: threadInitTLS
w:2,t:0x000237b8: invokeEntryPoint: 0x00000003
in thread_main 0x237b8
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
in do_once
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:2,t:0x000237b8: checkStackCookie: 0x00023a50
destructor: 0x237b8
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:0,t:0x00000000: run() called, but dependencies remain, so not running
w:3,t:0x00000000: worker: loading module
w:3,t:0x00000000: initRuntime
w:3,t:0x00000000: establishStackSpace: 0x00044340 -> 0x00034340
w:3,t:0x00000000: writeStackCookie: 0x00034340
w:3,t:0x000340a8: threadInitTLS
w:3,t:0x000340a8: invokeEntryPoint: 0x00000003
in thread_main 0x340a8
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:3,t:0x000340a8: checkStackCookie: 0x00034340
destructor: 0x340a8
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:0,t:0x00000000: run() called, but dependencies remain, so not running
w:5,t:0x00000000: worker: loading module
w:5,t:0x00000000: initRuntime
w:5,t:0x00000000: establishStackSpace: 0x00065520 -> 0x00055520
w:5,t:0x00000000: writeStackCookie: 0x00055520
w:5,t:0x00055288: threadInitTLS
w:5,t:0x00055288: invokeEntryPoint: 0x00000003
in thread_main 0x55288
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:5,t:0x00055288: checkStackCookie: 0x00055520
destructor: 0x55288
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:0,t:0x00000000: run() called, but dependencies remain, so not running
w:4,t:0x00000000: worker: loading module
w:4,t:0x00000000: initRuntime
w:4,t:0x00000000: establishStackSpace: 0x00054c30 -> 0x00044c30
w:4,t:0x00000000: writeStackCookie: 0x00044c30
w:4,t:0x00044998: threadInitTLS
w:4,t:0x00044998: invokeEntryPoint: 0x00000003
in thread_main 0x44998
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:4,t:0x00044998: checkStackCookie: 0x00044c30
w:1,t:0x00012870: _emscripten_thread_cleanup: 0x000237b8
destructor: 0x44998
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:0,t:0x000116a4: cleanupThread: 0x000237b8
t1 joined
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:1,t:0x00012870: _emscripten_thread_cleanup: 0x000340a8
w:0,t:0x000116a4: cleanupThread: 0x000340a8
t2 joined
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:1,t:0x00012870: _emscripten_thread_cleanup: 0x00044998
w:0,t:0x000116a4: cleanupThread: 0x00044998
t3 joined
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:1,t:0x00012870: _emscripten_thread_cleanup: 0x00055288
w:0,t:0x000116a4: cleanupThread: 0x00055288
t4 joined
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:1,t:0x00012870: createThread: 0x000237b8
w:0,t:0x000116a4: createThread: 0x000237b8
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:5,t:0x00000000: establishStackSpace: 0x00033a50 -> 0x00023a50
w:5,t:0x00000000: writeStackCookie: 0x00023a50
w:5,t:0x000237b8: threadInitTLS
w:5,t:0x000237b8: invokeEntryPoint: 0x00000004
w:1,t:0x00012870: _emscripten_thread_cleanup: 0x000237b8
w:1,t:0x00012870: createThread: 0x00033a60
w:5,t:0x00000000: worker: Pthread 0x0 completed its main entry point with an 'unwind', keeping the worker alive for asynchronous operation.
w:0,t:0x000116a4: cleanupThread: 0x000237b8
w:0,t:0x000116a4: createThread: 0x00033a60
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:5,t:0x00000000: establishStackSpace: 0x00043cf0 -> 0x00033cf0
w:5,t:0x00000000: writeStackCookie: 0x00033cf0
w:5,t:0x00033a60: threadInitTLS
w:5,t:0x00033a60: invokeEntryPoint: 0x00000005
in thread_main_detached 0x33a60
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:5,t:0x00033a60: checkStackCookie: 0x00033cf0
done!
w:5,t:0x00000000: _emscripten_thread_cleanup: 0x00033a60
w:1,t:0x00012870: Pthread 0x00012870 called exit(0), posting exitOnMainThread.
w:0,t:0x000116a4: maybeExit: user callback done: runtimeKeepaliveCounter=1
w:0,t:0x000116a4: cleanupThread: 0x00033a60
w:1,t:0x00012870: worker: Pthread 0x12870 completed its main entry point with an 'unwind', keeping the worker alive for asynchronous operation.
w:0,t:0x000116a4: exitOnMainThread
w:0,t:0x000116a4: runtimeKeepalivePop -> counter=0
w:0,t:0x000116a4: main thread called exit(0): keepRuntimeAlive=false (counter=0)
w:0,t:0x000116a4: exitRuntime
w:0,t:0x000116a4: checkStackCookie: 0x00000000
w:0,t:0x000116a4: terminateAllThreads
w:0,t:0x000116a4: terminateWorker: 1
w:0,t:0x000116a4: terminateWorker: 2
w:0,t:0x000116a4: terminateWorker: 3
w:0,t:0x000116a4: terminateWorker: 4
w:0,t:0x000116a4: terminateWorker: 5
w:0,t:0x00000000: proc_exit: 0
w:0,t:0x00000000: terminateAllThreads

node:internal/event_target:1099
  process.nextTick(() => { throw err; });
                           ^
ExitStatus {
  name: 'ExitStatus',
  message: 'Program terminated with exit(0)',
  status: 0
}
Thrown at:
    at node:internal/event_target:1099:28
    at processTicksAndRejections (node:internal/process/task_queues:77:11)

Node.js v20.14.0