Repository navigation
Closed
Description
This failure comes through every now and then:
======================================================================
FAIL: test_pthread_proxying (test_core.core0.test_pthread_proxying)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.12/unittest/case.py", line 58, in testPartExecutor
yield
File "/usr/lib/python3.12/unittest/case.py", line 634, in run
self._callTestMethod(testMethod)
File "/usr/lib/python3.12/unittest/case.py", line 589, in _callTestMethod
if method() is not None:
^^^^^^^^
File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/common.py", line 928, in resulting_test
return func(self, *args)
^^^^^^^^^^^^^^^^^
File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/common.py", line 385, in decorated
f(self, *args, **kwargs)
File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/common.py", line 700, in metafunc
f(self, *args, **kwargs)
File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/test_core.py", line 2606, in test_pthread_proxying
self.do_run_in_out_file_test('pthread/test_pthread_proxying.c', interleaved_output=False)
File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/common.py", line 1980, in do_run_in_out_file_test
output = self._build_and_run(srcfile, expected, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/common.py", line 2029, in _build_and_run
self.assertContained(o, js_output, regex=regex)
File "/home/clb/buildbot/h12dsi-linux-mint22/emscripten_linux_x64/build/emscripten/main/test/common.py", line 1687, in assertContained
self.fail("Expected to find '%s' in '%s', diff:\n\n%s\n%s" % (
File "/usr/lib/python3.12/unittest/case.py", line 715, in fail
raise self.failureException(msg)
AssertionError: Expected to find 'Testing async proxying
running widget 1 on main
running widget 2 on looper
running widget 3 on returner
Testing sync proxying
running widget 4 on looper
running widget 5 on returner
Testing sync_with_ctx proxying
running widget 6 on looper
running widget 7 on returner
Testing callback proxying
running widget 8 on main
running widget 9 on looper
running widget 10 on returner
Testing callback_with_ctx proxying
running widget 11 on main
running widget 12 on looper
running widget 13 on returner
Testing promise proxying
running widget 14 on worker
running widget 15 on looper
running widget 16 on returner
Testing promise_with_ctx proxying
running widget 17 on worker
running widget 18 on looper
running widget 19 on returner
Testing tasks queue growth
Testing proxying queue growth
work
work
work
work
done
' in 'Testing async proxying
running widget 1 on main
running widget 2 on looper
running widget 3 on returner
Testing sync proxying
running widget 4 on looper
running widget 5 on returner
Testing sync_with_ctx proxying
running widget 6 on looper
running widget 7 on returner
Testing callback proxying
running widget 8 on main
running widget 9 on looper
running widget 10 on returner
Testing callback_with_ctx proxying
running widget 11 on main
running widget 12 on looper
running widget 13 on returner
Testing promise proxying
running widget 14 on worker
running widget 15 on looper
running widget 16 on returner
Testing promise_with_ctx proxying
running widget 17 on unknown
running widget 18 on looper
running widget 19 on returner
Testing tasks queue growth
Testing proxying queue growth
work
work
work
work
done
looper_main
returner_main
quitting looper
returner_main
returner_main
program exited (with status: 0), but keepRuntimeAlive() is set (counter=0) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)
', diff:
--- expected
+++ actual
@@ -21,7 +21,7 @@
running widget 15 on looper
running widget 16 on returner
Testing promise_with_ctx proxying
-running widget 17 on worker
+running widget 17 on unknown
running widget 18 on looper
running widget 19 on returner
Testing tasks queue growth
@@ -31,4 +31,10 @@
work
work
done
+looper_main
+returner_main
+quitting looper
+returner_main
+returner_main
+program exited (with status: 0), but keepRuntimeAlive() is set (counter=0) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)
which suggests some kind of a race condition in proxying. (a lot of other pthread proxying tests are already marked flaky)
Metadata
Metadata
Assignees
Labels
No labels
Activity
sbc100 commentedon Aug 25, 2025
CC @tlively
tlively commentedon Aug 26, 2025
@brendandahl, would you be able to take a look at this?
brendandahl commentedon Aug 26, 2025
I haven't had any luck reproducing locally. I tried running on repeat and forcing single core.
juj commentedon Aug 27, 2025
Pushed a PR #25066 that adds new test
test_stress_pthread_proxying, which reproduces the issue on my Linux box with ~70% rate - though on Windows PC it never reproduces.RAIHERE commentedon Aug 30, 2025
RAIHERE commentedon Aug 30, 2025
Create a stress test that more deterministically reproduces #20067, #…
sbc100 commentedon Sep 3, 2025
I can't seem to get
test_stress_pthread_proxyingto fail on my machine. I ran it 7 times (after uncommenting the skip line).BTW, I'm not sure the
parallel_stress_test_js_filemechanism is viable when its part of a full test suite like test_core which is already running in in parallel trying to saturate all the cores/juj commentedon Sep 3, 2025
Err hmm, that is very true, I didn't even think about that.. Maybe these tests should go in a own suite
stressfor this.sbc100 commentedon Sep 3, 2025
I also cannot main
core2.test_stress_proxy_to_pthread_hello_worldfail on my linux machine.sbc100 commentedon Sep 3, 2025
Ah, I have to revert #25073 to make
test_stress_proxy_to_pthread_hello_worldfail.juj commentedon Sep 7, 2025
I don't think there is any reason to saturate the cores with the stress test, just saturating with any work will do. That shouldn't reduce the viability.
Fix race condition in assigning the pthread_t object in main thread, …
Fix race condition in assigning the pthread_t object in main thread, …
Fix race condition in assigning the pthread_t object in main thread, …
juj commentedon Sep 7, 2025
Fix in #25209. Fortunately turned out to be simple.
Fix race condition in assigning the pthread_t object in main thread, …
Fix race condition in assigning the pthread_t object in main thread (e…
Create a stress test that more deterministically reproduces emscripte…
Fix race condition in assigning the pthread_t object in main thread (e…