[Bug 943] New: DeploymentComponent could fail more gracefully when importing component libraries with the same name ind different paths

http://bugs.orocos.org/show_bug.cgi?id=943

Summary: DeploymentComponent could fail more gracefully when
importing component libraries with the same name ind
different paths
Product: Toolchain
Version: 2.5.0
Platform: All
OS/Version: Xenomai 2.x
Status: NEW
Severity: enhancement
Priority: P3
Component: OCL
AssignedTo: orocos-dev [..] ...
ReportedBy: jbo [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

I've recently refactored some Orocos/RTT components into a couple different ROS
packages. I have an Orocos .ops script for testing each collection of
components separately, but when I create a third package for testing
integration, and combine the contents of the two other .ops scripts, they
segfault when I try to create an object from whichever the second package was
that I imported.

It first complains about one or the other library as being already loaded, and
says "try to RELOAD":

3.834 [ Warning][DeploymentComponent::import] Library
/home/jbohren/versioned/ros/bard/bard_controllers/lib/orocos/xenomai/libcomponents-xenomai.so
already loaded... try to RELOAD

Then the instant an object from the second import()'d package is created, it
segfaults like so:

Program received signal SIGSEGV, Segmentation fault.
0x00007fffe7876910 in ?? () from
/home/jbohren/versioned/ros/bard/bard_simulation/lib/orocos/xenomai/libcomponents-xenomai.so
(gdb) where
#0 0x00007fffe7876910 in ?? ()
from
/home/jbohren/versioned/ros/bard/bard_simulation/lib/orocos/xenomai/libcomponents-xenomai.so
#1 0x00007ffff73140ef in OCL::ComponentLoader::loadComponent (this=<value
optimized out>, name=..., type=...)
at
/home/jbohren/versioned/ros/orocos_toolchain/ocl/deployment/ComponentLoader.cpp:641
#2 0x00007ffff728e90e in OCL::DeploymentComponent::loadComponent
(this=0x7fffffffd590, name=..., type=...)
at
/home/jbohren/versioned/ros/orocos_toolchain/ocl/deployment/DeploymentComponent.cpp:1531
#3 0x00007ffff72c75d4 in boost::function2<bool, std::string const&,
std::string const&>::operator() (
this=<value optimized out>, t1=..., t2=...) at
/usr/include/boost/function/function_template.hpp:1013
#4 call_impl<std::string const&, std::string const&> (this=<value optimized
out>, t1=..., t2=...)
at
/home/jbohren/versioned/ros/orocos_toolchain/install/include/rtt/internal/../internal/LocalOperationCaller.hpp:386
#5 RTT::internal::InvokerImpl<2, bool ()(std::string const&, std::string
const&), RTT::internal::LocalOperationCallerImpl<bool ()(std::string const&,
std::string const&)> >::call(std::string const&, std::string const&)
(this=<value optimized out>,
t1=..., t2=...) at
/home/jbohren/versioned/ros/orocos_toolchain/install/include/rtt/internal/../internal/Invoker.hpp:125

It turns out this was happening because the component libraries had the same
name even though they were in different paths (different ROS packages). I was
still using the default name for the libraries in each CMakeLists.txt file, ie:

pkg_one/CMakeLists.txt:

...
orocos_component(components src_1.cpp src_2.cpp)
...
pkg_two/CMakeLists.txt:

...
orocos_component(components src_3.cpp src_4.cpp)
...
So giving these unique names solved the problem.

[Bug 943] DeploymentComponent could fail more gracefully when im

http://bugs.orocos.org/show_bug.cgi?id=943

Peter Soetens <peter [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED

[Bug 943] DeploymentComponent could fail more gracefully when im

http://bugs.orocos.org/show_bug.cgi?id=943

Peter Soetens <peter [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |peter [..] ...