Skip to content

Fix flakiness in test_pthread_c11_threads#15178

Merged
sbc100 merged 2 commits into
mainfrom
fix_flakey_test
Sep 29, 2021
Merged

Fix flakiness in test_pthread_c11_threads#15178
sbc100 merged 2 commits into
mainfrom
fix_flakey_test

Conversation

@sbc100
Copy link
Copy Markdown
Collaborator

@sbc100 sbc100 commented Sep 29, 2021

I tracked down this issue to a deadlock between the detached thread
calling printf() (calling proxied write call while hold the stdout
lock) 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.

Fixes: #14579

@sbc100 sbc100 requested review from kleisauke and kripken September 29, 2021 21:09
@sbc100 sbc100 changed the title Fix flaky test_pthread_c11_threads Fix flaky test: test_pthread_c11_threads Sep 29, 2021
@sbc100 sbc100 changed the title Fix flaky test: test_pthread_c11_threads Fix flakiness in test_pthread_c11_threads Sep 29, 2021
I tracked down this issue to a deadlock between the detached thread
calling `printf()` (calling proxied write call while hold the stdout
lock) 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`.

Fixes: #14579
Comment thread src/library_pthread.js Outdated
Co-authored-by: Alon Zakai <azakai@google.com>
@sbc100 sbc100 merged commit f20313b into main Sep 29, 2021
@sbc100 sbc100 deleted the fix_flakey_test branch September 29, 2021 22:55
@sbc100 sbc100 restored the fix_flakey_test branch September 29, 2021 23:16
@sbc100 sbc100 deleted the fix_flakey_test branch September 29, 2021 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wasm2js1.test_pthread_c11_threads is showing flakiness

2 participants