-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
Labels
A-thread-localsArea: Thread local storage (TLS)Area: Thread local storage (TLS)C-bugCategory: This is a bug.Category: This is a bug.O-linuxOperating system: LinuxOperating system: LinuxT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
OS: Ubuntu 18.04
Doesn't seem to happen on Windows, untested on MacOS.
I created cr-sys
crate to wrap cr.h: A Simple C Hot Reload Header-only Library.
It works, except that each version of the plugin isn't unloaded correctly, if the plugin uses TLS destructors registered with __cxa_thread_atexit_impl
.
C++ plugins can be compiled with -fno-use-cxa-atexit
to disable the use of __cxa_thread_atexit
. But I can't find away to do this with Rust plugins.
Right now the only work around is to not unload old plugin and make sure to use a different name for each plugin version.
Is there any way to run the TLS destructors registered by the plugin or to disable TLS destructors for a Rust shared library?
Related issue on cr.h
:
fungos/cr#35
LifeIsStrange, roamic, peter50216, kanerogers, SGauvin and 4 more
Metadata
Metadata
Assignees
Labels
A-thread-localsArea: Thread local storage (TLS)Area: Thread local storage (TLS)C-bugCategory: This is a bug.Category: This is a bug.O-linuxOperating system: LinuxOperating system: LinuxT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.