ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Boost 1.46.1 - Runtime Segfault

asked 2012-01-27 03:11:02 -0500

KM gravatar image

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.

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!

edit retag flag offensive close merge delete

Comments

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.
KM gravatar image KM  ( 2012-01-27 03:53:39 -0500 )edit
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
KM gravatar image KM  ( 2012-01-27 05:27:52 -0500 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2012-01-31 04:29:46 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

As your follow up question implies you cannot run two versions of boost in the same executable. http://answers.ros.org/question/3759/newer-boost-library-ubuntu-1004

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-01-27 03:11:02 -0500

Seen: 915 times

Last updated: Jan 31 '12