-
Notifications
You must be signed in to change notification settings - Fork 95
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
Notes on RTLD_GLOBAL
in the code ?
#172
Comments
What are you proposing @daohu527 ? IIUC |
I mean that even if We are divided into 2 situations to discuss 1 caseSome static variable with There is not this case in below register code. (static variables in template classes and inline functions) class_loader/include/class_loader/register_macro.hpp Lines 41 to 52 in c012f77
2 caseInstructions in the man manual dlopen not this case too.
The following two descriptions may appear, unless the ros module can be referenced by ros module. we will explain in next subsection.
exampleIf A is an ros module and C is references A.
We first load A and then load C, the A module will Implicit load only once ( reasonSo the core principle is, can ROS modules be referenced by other ROS modules? But it is unreasonable to say that |
I found below notes in code. It say
RTLD_GLOBAL
will cause static global variable initialization problem when reopen the library.I try load and unload the library, and the static variable is int correct. I don't know under what circumstances the problem will occur ? In fact, I found that some static variables in template classes and inline functions will cause this problem. I did not find these situations in the code.
class_loader/src/class_loader_core.cpp
Lines 235 to 244 in 8864be3
I found the
RTLD_NODELETE
dlopen doc, dlopen not use the RTLD_NODELETE option, I also make some test that static variable inited correctly.The text was updated successfully, but these errors were encountered: