-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 safety issue when loading dynamic modules on Linux #1314
Milestone
Comments
Solana uses dynamic loading for native programs and native programs are loaded once and kept loaded so this issue does not apply |
vkomenda
pushed a commit
to vkomenda/solana
that referenced
this issue
Aug 29, 2021
…olana-labs#1314) Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.15.1 to 4.15.2. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.15.2/packages/parser) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This was referenced Jan 17, 2022
yihau
added a commit
to yihau/solana
that referenced
this issue
May 15, 2024
clippy: legacy_numeric_constants
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Observed while using crate libloading
Given a multi-threaded test that loads a dynamic module, calls a function, and then unloads the module in a loop, the expected behavior is for the module to be loaded/unloaded and it's init/fini called respectively everytime. Like so:
The expected behavior is observed when running on MacOS but not on Linux.
On Linux we observe the module's init/deinit function being called at the beginning and end of the test but also sporadically (but always in order) throughout the test. This hints that modules are not being unloaded each time (and instead shared amongst threads).
In addition to the behavior difference, on Linux this behavior also mostly results in a segmentation fault at some point in the program's execution.
No workaround to the behavior differences is known, but there is a workaround to the segmentation fault. Using RTLD_NODELETE when loading the module forces the loader to not unload the module until the process is killed (init called at beginning of test and fini at the very end).
solana/src/dynamic_program.rs
Line 78 in dffb77b
The following repository will recreate the issue: https://github.com/jackcmay/dynamic_module_segfault
This issue is not to be confused with another loading issue on Linux having to do with TLS:
The text was updated successfully, but these errors were encountered: