-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Namespace-level thread can cause other threads to not start sometimes #20477
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
Comments
I don't see any reason why |
Ok, then ignore my speculating :). The testcase fails nevertheless. |
Anything you can do to narrow down the test case would be great. For example, can you remove the StaticInitStruct completely now? Can s1 - s5 removed? Can i1 and i2 be removed? Can |
As a sanity check - can you try my repro and confirm you can reproduce the issue? |
I don't think I'll have time to look at this today, but maybe next week. The smaller you can make the repro the easier it will be for whoever does look at it. |
This still fails with emscripten sdk 3.1.69. Can you run the testcase? Then you can remove any lines you like. |
I tried to reproduce using the script above and that page seems to keep reloading just fine and doesn't reach "BROKEN". I tried both with and without devtools enabled. How many times does it normally take to fail for you? What browser are you using? Can you try the very latest version 3.1.72? |
I've reproduced it with 3.1.72. I'm using "Chromium Version 131.0.6778.85 (Official Build) snap (64-bit)" on It takes about 30 seconds until the Broken message comes up. |
Version of emscripten/emsdk:
Failing command line in full:
The script will build and run the page, refreshing until the thread fails to start for some time. Due to the namespace-level object, it is random whether
runThread()
runs successfully. When it breaks, it seems to deadlock when attempting to execute thecout
line.This likely can't be made to work, so it should maybe be documented, diagnosed and possibly fail-early if pthread_create is called before
main()
.The text was updated successfully, but these errors were encountered: