Segmentation fault in orocos-ros integration and possible solution

Hi everyone,

I faced a very weird situation and on doing some browsing and tries figured
out the way out but still have no idea of why it worked.

1. I made a component using
rosrun ocl orocreate-pkg test_component

2. Added some dependcies like
<depend package="rtt" />
<depend package="orocos_kdl" />
<depend package="rtt_motion_control_msgs" />
<depend package="rtt_rosnode" />
in manigest file

3. rosmake
4 Build was successful

5 deployer-gnulinux

6 import("test_component")

got segmentation fault

7 gdb output wid backtrace looks like:

aviator@aviator-laptop:~/youbot_hardware/test$ gdb deployer-gnulinux
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs />...
Reading symbols from
/opt/ros/electric/stacks/orocos_toolchain/install/bin/deployer-gnulinux...done.
(gdb) run
Starting program:
/opt/ros/electric/stacks/orocos_toolchain/install/bin/deployer-gnulinux
[Thread debugging using libthread_db enabled]
[New Thread 0x7ffff21f5700 (LWP 5288)]
[New Thread 0x7ffff19f4700 (LWP 5289)]
2.701 [ Warning][DeploymentComponent::import] The ROS package 'ocl' in
'/opt/ros/electric/stacks/orocos_toolchain/ocl' nor its dependencies
contained a lib/orocos directory. I'll look in the RTT_COMPONENT_PATH next.
[New Thread 0x7fffeb0cf700 (LWP 5290)]
Switched to : Deployer

This console reader allows you to browse and manipulate TaskContexts.
You can type in an operation, expression, create or change variables.
(type 'help' for instructions and 'ls' for context info)

TAB completion and HISTORY is available ('bash' like)

Use 'Ctrl-D' or type 'quit' to exit this program.

Deployer [S]> import("test")
[New Thread 0x7fffe59c0700 (LWP 5293)]
[New Thread 0x7fffe51bf700 (LWP 5294)]
[New Thread 0x7fffe49be700 (LWP 5295)]
[New Thread 0x7fffe41bd700 (LWP 5300)]
[New Thread 0x7fffe39bc700 (LWP 5301)]
16.633 [ ERROR ][TypekitRepository::Import] A protocol with id 2 was
already added for type /std/vector<double>
16.666 [ ERROR ][TypekitRepository::Import] A protocol with id 1 was
already added for type /std/string
16.666 [ ERROR ][TypekitRepository::Import] A protocol with id 1 was
already added for type /std/vector<double>
Plugin of test loaded in process.

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00007ffff7b66dcf in RTT::types::TypeInfoRepository::getTypeById (
this=<value optimized out>, type_id=0x7ffff50e1f00)
at
/tmp/buildd/ros-electric-orocos-toolchain-0.5.0.7/debian/ros-electric-orocos-toolchain/opt/ros/electric/stacks/orocos_toolchain/rtt/rtt/types/TypeInfoRepository.cpp:105
#2 0x00007ffff7aee529 in getTypeInfo<bool> ()
at
/tmp/buildd/ros-electric-orocos-toolchain-0.5.0.7/debian/ros-electric-orocos-toolchain/opt/ros/electric/stacks/orocos_toolchain/rtt/rtt/internal/../types/TypeInfoRepository.hpp:128
#3 RTT::internal::DataSourceTypeInfo<bool>::getTypeInfo ()
at
/tmp/buildd/ros-electric-orocos-toolchain-0.5.0.7/debian/ros-electric-orocos-toolchain/opt/ros/electric/stacks/orocos_toolchain/rtt/rtt/internal/DataSourceTypeInfo.inl:28
#4 0x00007ffff7b4adad in RTT::base::DataSourceBase::getMemberNames (
this=0x7ffff50e1f00)
at
/tmp/buildd/ros-electric-orocos-toolchain-0.5.0.7/debian/ros-electric-orocos-toolchain/opt/ros/electric/stacks/orocos_toolchain/rtt/rtt/internal/DataSource.cpp:135
---Type <return> to continue, or q <return> to quit---
#5 0x00007ffff758bf43 in OCL::TaskBrowser::doPrint (
this=0x7fffffffd3a0, ds=<value optimized out>, recurse=true)
at
/tmp/buildd/ros-electric-orocos-toolchain-0.5.0.7/debian/ros-electric-orocos-toolchain/opt/ros/electric/stacks/orocos_toolchain/ocl/taskbrowser/TaskBrowser.cpp:1543
#6 0x00007ffff758ca8a in OCL::TaskBrowser::printResult (
this=0x7fffffffd3a0, ds=0x68cf50, recurse=<value optimized out>)
at
/tmp/buildd/ros-electric-orocos-toolchain-0.5.0.7/debian/ros-electric-orocos-toolchain/opt/ros/electric/stacks/orocos_toolchain/ocl/taskbrowser/TaskBrowser.cpp:1500
#7 0x00007ffff7592703 in OCL::TaskBrowser::evalCommand (
this=0x7fffffffd3a0, comm=...)
at
/tmp/buildd/ros-electric-orocos-toolchain-0.5.0.7/debian/ros-electric-orocos-toolchain/opt/ros/electric/stacks/orocos_toolchain/ocl/taskbrowser/TaskBrowser.cpp:1460
#8 0x00007ffff759b387 in OCL::TaskBrowser::loop (
this=<value optimized out>)
at
/tmp/buildd/ros-electric-orocos-toolchain-0.5.0.7/debian/ros-electric-orocos-toolchain/opt/ros/electric/stacks/orocos_toolchain/ocl/taskb---Type
<return> to continue, or q <return> to quit---
rowser/TaskBrowser.cpp:858
#9 0x000000000040ccdb in main (argc=<value optimized out>,
argv=<value optimized out>)
at
/tmp/buildd/ros-electric-orocos-toolchain-0.5.0.7/debian/ros-electric-orocos-toolchain/opt/ros/electric/stacks/orocos_toolchain/ocl/bin/deployer.cpp:168

On doing some searching I found two possible suggestions in earlier posts:

a) export RTT_COMPONENT_PATH=`rospack find rtt`/install/lib/orocos
b) recompile RTT packages

option (b) somehow worked for me but I had to redo the "pkgcreate" command

I do not know the cause or the reason for the solution.

It could however save time for other people getting similar errors and
possibly help me getting to know what what went wrong.

Best Wishes
Shashank