-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Avoid calling writeStackCookie to early in worker.js #17063
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
Conversation
6acab22 to
33bbfa5
Compare
kripken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC pthreads will now only call writeStackCookie() - which they always have - but no longer call stackCheckInit() - which they used to before this PR, but that was wrong. But do we not need the other parts of stackCheckInit(), namely emscripten_stack_set_limits /emscripten_stack_init?
I think the answer is that pthreads do all this stuff in emscripten/src/library_pthread.js Lines 945 to 980 in 1f6b136
In the case of a pthread its the explicit |
7204fee to
864aebb
Compare
When running a worker we don't want to write the stack cookie until the worker is actually running a pthread. This is done in `establishStackSpace`. For this reason we don't want to run `writeStackCookie` during `run` (which is used only to initiialize the worker, before its running a thread).
864aebb to
943e0a5
Compare
When running a worker we don't want to write the stack cookie until the
worker is actually running a pthread. This is done in
establishStackSpace.For this reason we don't want to run
writeStackCookieduringrun(which is used only to initiialize the worker, before itsrunning a thread).
The extra call to
writeStackCookiewas not harmfull but its writingthe default stack location (the one used by the main thread!).