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
Thread-local variables corruption after setjmp/longjmp with threads+dynlink #14461
Comments
Thanks for the report. Interesting/useful that you don't even need to start any threads to reproduce. |
cc @tlively as this is about thread-local. |
This looks related to the fact the TLS variables cannot be exported across module boundaries today. Its one of the limitations of pthreads + dynamic linking that we have right now. The codegen for setjmp/longjmp lowering on llvm generates references to The mystery is why we don't see a linker error here... I'm continuing to investigate that part. |
Indeed, this is not a supported configuration right now since setjmp/longjmp rely on cross module TLS variables which are not yet supported with threading. Once this lands you will see a nice error at link time: https://reviews.llvm.org/D106385 |
This relies on exporting TLS symbols which we currently do not support. By default we disable SUPPORT_LONGJMP in this configuration. If the user tries to explicitly enable it we error out. See #14461
This relies on exporting TLS symbols which we currently do not support. By default we disable SUPPORT_LONGJMP in this configuration. If the user tries to explicitly enable it we error out. See #14461
This relies on exporting TLS symbols which we currently do not support. By default we disable SUPPORT_LONGJMP in this configuration. If the user tries to explicitly enable it we error out. See #14461
In https://reviews.llvm.org/D102044 we made exporting a TLS symbol into an error, but we also want to error on import. See emscripten-core/emscripten#14461 Differential Revision: https://reviews.llvm.org/D106385
This relies on exporting TLS symbols which we currently do not support. By default we disable SUPPORT_LONGJMP in this configuration. If the user tries to explicitly enable it we error out. See #14461
This relies on exporting TLS symbols which we currently do not support. By default we disable SUPPORT_LONGJMP in this configuration. If the user tries to explicitly enable it we error out. See #14461
In https://reviews.llvm.org/D102044 we made exporting a TLS symbol into an error, but we also want to error on import. See emscripten-core/emscripten#14461 Differential Revision: https://reviews.llvm.org/D106385
The underlying bug that caused this configuration not to work (lack of TLS import/export) was fixed in #14461.
In https://reviews.llvm.org/D102044 we made exporting a TLS symbol into an error, but we also want to error on import. See emscripten-core/emscripten#14461 Differential Revision: https://reviews.llvm.org/D106385
While working on the Godot web port, trying to build a threads+dynlink binary I stumbled upon some weird deadlocks which traced back to corrupted thread-local variables after doing a setjmp/longjmp on the main thread.
Here is a minimal reproduction:
Build with:
Or see the attached zip for both sources and binary (compiled with
emcc 2.0.24
)thread_local.zip
The text was updated successfully, but these errors were encountered: