I have wrapped a 3rd party library following the conventions laid out in the tutorial on ros.org - wrapping libraries
I have hit an issues when linking against that wrapped library, and I have traced the issue back to boost versions. I am running Ubuntu 10.04 with ROS Electric - the default boost library being 1.40 and my wrapped library uses 1.46.1
I have exported ROS_BOOST_VERSION=1.46.1 and ROS_BOOST_ROOT=/usr/local/include/ to my environment and added the boost directories and linked in my CMakeLists of the test package.
rosbuild_add_boost_directories()
rosbuild_link_boost(test_driver thread)
To test the linked library I have created a simple publisher, publishing a [simple string](http://www.ros.org/wiki/ROS/Tutorials/WritingPublisherSubscriber(c%2B%2B).
Everything compiles fine and upon execution I am getting a segfault. Below is the syslog and backtrace.
syslog: (not very telling)
segfault at 18 ip 00007fb546efc288 sp 00007fff77298290 error 4 in
libboost_thread.so.1.46.1[7fb546eef000+17000]
backtrace:
#0 0x00007ffff700f288 in boost::thread::start_thread() () from
/usr/local/lib/libboost_thread.so.1.46.1
#1 0x00007ffff7b23f1a in thread<void (ros::PollManager::*)(), ros::PollManager*>
(this=0x7fffffffd450, f=0x7ffff7b21600 <ros::PollManager::threadFunc()>, a1=0x6362a0) at
/usr/include/boost/thread/detail/thread.hpp:229
#2 0x00007ffff7b21fb3 in ros::PollManager::start (this=0x6362a0) at /tmp/buildd/ros-
electric-ros-comm-1.6.6/debian/ros-electric-ros
-comm/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/src/libros/poll_manager.cpp:64
#3 0x00007ffff7b0b13b in ros::start () at /tmp/buildd/ros-electric-ros-comm-
1.6.6/debian/ros-electric-ros-
comm/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/src/libros/init.cpp:324
#4 0x00007ffff7b87a40 in ros::NodeHandle::construct (this=0x7fffffffde90, ns=...,
validate_name=true)
at /tmp/buildd/ros-electric-ros-comm-1.6.6/debian/ros-electric-ros
comm/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/src/libros/node_handle.cpp:172
#5 0x00007ffff7b8a3f5 in NodeHandle (this=0x7fffffffde90, ns=..., remappings=...) at
/tmp/buildd/ros-electric-ros-comm-1.6.6/debian/ros-electric-ros-
comm/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/src/libros/node_handle.cpp:82
#6 0x0000000000405351 in main (argc=1, argv=<value optimized out>) at
/home/robot/ros/testing/test_driver/src/test_driver.cpp:59
This line test_driver.cpp:59 is
ros::NodeHandle nh_;
Any suggestions?? I am pretty hung up on this..
Thanks!
Originally posted by KM on ROS Answers with karma: 66 on 2012-01-27
Post score: 0
Original comments
Comment by KM on 2012-01-27:
Here is another bit of information that I have tracked down. When making with VERBOSE = TRUE, I get the following. libboost_thread.so.1.40.0, needed by /home/robot/ros/testing/my_lib/src/my_lib.so, may conflict with libboost_thread.so.1.46.1
Comment by KM on 2012-01-27:
Another thing to add which may help: ~$ rosboost-cfg --root gives me /usr/local however, rosboost-cfg --lib_dirs and the rest of the options do not return anything.