Repository navigation
Description
======================================================================
FAIL: test_pthread_c11_threads (test_core.wasm2js1)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.6/unittest/case.py", line 59, in testPartExecutor
yield
File "/usr/lib/python3.6/unittest/case.py", line 605, in run
testMethod()
File "/root/project/tests/common.py", line 193, in decorated
f(self)
File "/root/project/tests/test_core.py", line 8246, in test_pthread_c11_threads
self.do_run_in_out_file_test('pthread/test_pthread_c11_threads.c')
File "/root/project/tests/common.py", line 1004, in do_run_in_out_file_test
self._build_and_run(srcfile, expected, **kwargs)
File "/root/project/tests/common.py", line 1055, in _build_and_run
self.assertContained(expected_output, js_output)
File "/root/project/tests/common.py", line 731, in assertContained
additional_info
File "/usr/lib/python3.6/unittest/case.py", line 670, in fail
raise self.failureException(msg)
AssertionError: Expected to find 'done!
' in 'thrd_current: 0xa01b00
in thread_main 0xc02018
in do_oncemain 0xc02018in thread_main 0xe02330in thread_main
in do_once
in do_oncemain 0xc02018in thread_main 0xe02330in thread_main 0x1202940
done thread_main
done thread_main
done thread_main
destructor: 0xc02018
destructor: 0xc02018destructor: 0xe02330
destructor: 0x1202940
in thread_main 0x1002628
done thread_main
destructor: 0x1002628
in thread_main 0xc02018
in th
', diff:
--- expected
+++ actual
@@ -1,2 +1,17 @@
-done!
+thrd_current: 0xa01b00
+in thread_main 0xc02018
+in do_oncemain 0xc02018in thread_main 0xe02330in thread_main
+in do_once
+in do_oncemain 0xc02018in thread_main 0xe02330in thread_main 0x1202940
+done thread_main
+done thread_main
+done thread_main
+destructor: 0xc02018
+destructor: 0xc02018destructor: 0xe02330
+destructor: 0x1202940
+in thread_main 0x1002628
+done thread_main
+destructor: 0x1002628
+in thread_main 0xc02018
+in th
Metadata
Metadata
Assignees
Labels
No labels
Activity
kleisauke commentedon Jul 1, 2021
Perhaps commit f21de99 could help here? I'm not sure if that actually fixed that, but it's worth a try.
sbc100 commentedon Sep 1, 2021
I'm hoping that #12861 could improve flakiness around thread termination and re-use. Lets see if this one cotninues..
Add some debugging for help with #14579. NFC
Add some debugging for help with #14579. NFC
Fix flaky test_pthread_c11_threads
Add some debugging for help with #14579. NFC (#15177)
sbc100 commentedon Sep 29, 2021
I tracked down this issue to a deadlock between the detached thread
calling
printf()(calling proxied write call while hold the stdoutlock) and the main thread trying to shut down the runtime by (calling
fflush(0)).The problem could be addressed if we allowed nested calls to
emscripten_current_thread_process_queued_calls, but in the meantime I have workaround in the test itself that avoids the deadlock.
Fix flaky test_pthread_c11_threads
Fix flaky test_pthread_c11_threads
Fix flakiness in test_pthread_c11_threads (#15178)
sbc100 commentedon Sep 29, 2021
My fix didn't fully address the issue and I still see occasional flakiness. We still need to address the underlying issue of exiting while threads are holding the stdio lock
Second attempt at fixing test_pthread_c11_threads
Second attempt at fixing test_pthread_c11_threads
Second attempt at fixing test_pthread_c11_threads (#15187)