Skip to content

Fix flakiness in test_pthread_c11_threads #15178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 29, 2021
Merged

Fix flakiness in test_pthread_c11_threads #15178

merged 2 commits into from
Sep 29, 2021

Conversation

sbc100
Copy link
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
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