Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ install(TARGETS ${PROJECT_NAME}
install(DIRECTORY include/class_loader/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})

install(PROGRAMS scripts/class_loader_headers_update.py
catkin_install_python(PROGRAMS scripts/class_loader_headers_update.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

if(CATKIN_ENABLE_TESTING)
Expand Down
16 changes: 15 additions & 1 deletion include/class_loader/class_loader_core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,15 @@ bool hasANonPurePluginLibraryBeenOpened();
CLASS_LOADER_PUBLIC
void hasANonPurePluginLibraryBeenOpened(bool hasIt);

#if defined(__has_feature)
#if __has_feature(address_sanitizer) // for clang
#define __SANITIZE_ADDRESS__ // GCC already sets this
#endif
#endif

#if defined(__SANITIZE_ADDRESS__)
#include <sanitizer/lsan_interface.h>
#endif
// Plugin Functions

/**
Expand Down Expand Up @@ -207,6 +216,11 @@ void registerPlugin(const std::string & class_name, const std::string & base_cla
// Create factory
impl::AbstractMetaObject<Base> * new_factory =
new impl::MetaObject<Derived, Base>(class_name, base_class_name);

#if defined(__SANITIZE_ADDRESS__)
__lsan_ignore_object(new_factory);
#endif

new_factory->addOwningClassLoader(getCurrentlyActiveClassLoader());
new_factory->setAssociatedLibraryPath(getCurrentlyLoadingLibraryName());

Expand All @@ -217,7 +231,7 @@ void registerPlugin(const std::string & class_name, const std::string & base_cla
if (factoryMap.find(class_name) != factoryMap.end()) {
CONSOLE_BRIDGE_logWarn(
"class_loader.impl: SEVERE WARNING!!! "
"A namespace collision has occured with plugin factory for class %s. "
"A namespace collision has occurred with plugin factory for class %s. "
"New factory will OVERWRITE existing one. "
"This situation occurs when libraries containing plugins are directly linked against an "
"executable (the one running right now generating this message). "
Expand Down
4 changes: 3 additions & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
<description>
The class_loader package is a ROS-independent package for loading plugins during runtime and the foundation of the higher level ROS "pluginlib" library. class_loader utilizes the host operating system's runtime loader to open runtime libraries (e.g. .so/.dll files), introspect the library for exported plugin classes, and allows users to instantiate objects of said exported classes without the explicit declaration (i.e. header file) for those classes.
</description>
<maintainer email="stevenragnarok@osrfoundation.org">Steven! Ragnarök</maintainer>
<maintainer email="michael@openrobotics.org">Michael Carroll</maintainer>
<maintainer email="geoff@openrobotics.org">Geoffrey Biggs</maintainer>
<license>BSD</license>

<url type="website">http://ros.org/wiki/class_loader</url>
<url type="bugtracker">https://github.com/ros/class_loader/issues</url>
<url type="repository">https://github.com/ros/class_loader</url>

<author>Mirza Shah</author>
<author email="stevenragnarok@openrobotics.org">Steven! Ragnarök</author>

<buildtool_depend version_gte="0.5.68">catkin</buildtool_depend>

Expand Down