-
Notifications
You must be signed in to change notification settings - Fork 419
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
use unique ptr and remove unuseful container #2013
use unique ptr and remove unuseful container #2013
Conversation
Signed-off-by: Chen Lihui <[email protected]>
Would you mind providing more details about the lifespan of the loaded libraries? |
Thanks for asking questions. (gdb) bt
#0 class_loader::impl::loadLibrary (library_path="libtopics_library.so", loader=0x5555555fca20)
at /home/chenlh/Projects/ROS2/ros2-master/src/ros/class_loader/src/class_loader_core.cpp:432
#1 0x00007ffff71ab25f in class_loader::ClassLoader::loadLibrary (this=0x5555555fca20)
at /home/chenlh/Projects/ROS2/ros2-master/src/ros/class_loader/src/class_loader.cpp:106
#2 0x00007ffff71ab091 in class_loader::ClassLoader::ClassLoader (this=0x5555555fca20, library_path="libtopics_library.so", ondemand_load_unload=false)
at /home/chenlh/Projects/ROS2/ros2-master/src/ros/class_loader/src/class_loader.cpp:65
#3 0x00005555555683ca in std::make_unique<class_loader::ClassLoader, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&>
() at /usr/include/c++/9/bits/unique_ptr.h:857
#4 0x0000555555565f65 in main (argc=1, argv=0x7fffffffc5d8)
at /home/chenlh/Projects/ROS2/ros2-master/build/demo_nodes_cpp/rclcpp_components/node_main_talker.cpp:39
(gdb) bt
#0 class_loader::impl::unloadLibrary (library_path="libtopics_library.so", loader=0x5555555fca20)
at /home/chenlh/Projects/ROS2/ros2-master/src/ros/class_loader/src/class_loader_core.cpp:539
#1 0x00007ffff71ab3b4 in class_loader::ClassLoader::unloadLibraryInternal (this=0x5555555fca20, lock_plugin_ref_count=true)
at /home/chenlh/Projects/ROS2/ros2-master/src/ros/class_loader/src/class_loader.cpp:136
#2 0x00007ffff71ab2ef in class_loader::ClassLoader::unloadLibrary (this=0x5555555fca20)
at /home/chenlh/Projects/ROS2/ros2-master/src/ros/class_loader/src/class_loader.cpp:115
#3 0x00007ffff71ab115 in class_loader::ClassLoader::~ClassLoader (this=0x5555555fca20, __in_chrg=<optimized out>)
at /home/chenlh/Projects/ROS2/ros2-master/src/ros/class_loader/src/class_loader.cpp:75
#4 0x00007ffff71ab144 in class_loader::ClassLoader::~ClassLoader (this=0x5555555fca20, __in_chrg=<optimized out>)
at /home/chenlh/Projects/ROS2/ros2-master/src/ros/class_loader/src/class_loader.cpp:76
#5 0x00005555555691c0 in std::default_delete<class_loader::ClassLoader>::operator() (this=0x7fffffffb638, __ptr=0x5555555fca20)
at /usr/include/c++/9/bits/unique_ptr.h:81
#6 0x000055555556845e in std::unique_ptr<class_loader::ClassLoader, std::default_delete<class_loader::ClassLoader> >::~unique_ptr (
this=0x7fffffffb638, __in_chrg=<optimized out>) at /usr/include/c++/9/bits/unique_ptr.h:292
#7 0x00005555555664b9 in main (argc=1, argv=0x7fffffffc5d8)
at /home/chenlh/Projects/ROS2/ros2-master/build/demo_nodes_cpp/rclcpp_components/node_main_talker.cpp:39 The key to fix ros2/rcl#1009 is to call |
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.
lgtm
this does not depend on ros/class_loader#200, but related. |
@iuhilnehc-ynos thank you. I'm a little bit concerned about this. I think we should keep the libraries loaded until we have destroyed the nodes. |
|
@ros-pull-request-builder retest this please |
Error happened in the CI as following Give it another shot, |
@Mergifyio backport humble galactic foxy |
Signed-off-by: Chen Lihui <[email protected]> Signed-off-by: Chen Lihui <[email protected]> (cherry picked from commit 6a8c61c)
Signed-off-by: Chen Lihui <[email protected]> Signed-off-by: Chen Lihui <[email protected]> (cherry picked from commit 6a8c61c)
✅ Backports have been created
|
Signed-off-by: Chen Lihui <[email protected]> Signed-off-by: Chen Lihui <[email protected]> (cherry picked from commit 6a8c61c)
@iuhilnehc-ynos can you take care of the backpors for foxy/galactic/humble? |
related to ros2/rcl#1009 (comment)
Signed-off-by: Chen Lihui [email protected]