Ask Your Question
0

Two versions of libboost?

asked 2014-08-21 17:09:28 -0500

nckswt gravatar image

updated 2014-08-26 10:31:47 -0500

I've seen that running two versions of libboost will cause problems, but I can't figure out how to upgrade my libboost so that I can use an external library.

I'm using the vicon_bridge package, which uses a Vicon SDK that seems to need libboost1.53. My BOOST_LIB_VERSION macro prints out as Boost version: 1_46_1, and apt-cache policy libboost-dev returns:

libboost-dev:
  Installed: 1.48.0.2
  Candidate: 1.48.0.2
  Version table:
 *** 1.48.0.2 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise/main i386 Packages
        100 /var/lib/dpkg/status

I'm running a 32-bit VM of Ubuntu 12.04 with ROS Hydro. If I run sudo apt-get install libboost1.54-dev, apt-get will uninstall all my ros binaries (presumably because they need a 1.4* version of boost).

How can I meet both 1.53 and 1.48 boost version dependencies simultaneously?

EDIT: I'd assumed that it's a boost library issue, but might not be. Here's the backtrace from the segfault:

#0  0xb7aa5108 in ?? () from /lib/i386-linux-gnu/libc.so.6
#1  0xb7aa6674 in ?? () from /lib/i386-linux-gnu/libc.so.6
#2  0xb7aa8e4c in malloc () from /lib/i386-linux-gnu/libc.so.6
#3  0xb7ccf627 in operator new(unsigned int) () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#4  0xb7e1117a in ros::PollManager::addPollThreadListener(boost::function<void ()> const&) () from /opt/ros/hydro/lib/libroscpp.so
#5  0xb7e558f7 in ros::start() () from /opt/ros/hydro/lib/libroscpp.so
#6  0xb7e2c317 in ros::NodeHandle::construct(std::string const&, bool) () from /opt/ros/hydro/lib/libroscpp.so
#7  0xb7e2d7a3 in ros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&) ()
   from /opt/ros/hydro/lib/libroscpp.so
#8  0xb7e6f434 in ros::AsyncSpinnerImpl::AsyncSpinnerImpl(unsigned int, ros::CallbackQueue*) () from /opt/ros/hydro/lib/libroscpp.so
#9  0xb7e71d94 in ros::AsyncSpinner::AsyncSpinner(unsigned int) () from /opt/ros/hydro/lib/libroscpp.so
#10 0x080a22f9 in main ()

EDIT 2: More info on the boost linking:

$ ldd vicon_bridge  | grep boost
libboost_signals.so.1.46.1 => /usr/lib/libboost_signals.so.1.46.1 (0xb70ba000)
libboost_system.so.1.46.1 => /usr/lib/libboost_system.so.1.46.1 (0xb7090000)
libboost_thread.so.1.46.1 => /usr/lib/libboost_thread.so.1.46.1 (0xb7079000)
libboost_filesystem.so.1.46.1 => /usr/lib/libboost_filesystem.so.1.46.1 (0xb7034000)
libboost_regex.so.1.46.1 => /usr/lib/libboost_regex.so.1.46.1 (0xb6d8e000)

I get the same output even after I run commands like:

$ catkin_make --force-cmake --pkg vicon_bridge -DBoost_DIR=/home/cohrint/catkin_ws/src/vicon_bridge/vicon_sdk/Vicon_SDK_1.3_Linux/32-bit/ -DBoost_NO_SYSTEM_PATHS=ON -DBoost_ADDITIONAL_VERSIONS="1.53;1.53.0"

and I get the same thing whenever I try to edit the CMakeLists.txt file as specified in this post.

EDIT3: I've now reinstalled everything on a 64-bit Ubuntu 12.04 install, and I still get issues with Boost. Here's the output of roslaunch vicon_bridge vicon.launch:

process[vicon-1]: started with pid [2993]
[ INFO] [1409066865.764183805]: Connecting to ...
(more)
edit retag flag offensive close merge delete

Comments

Are those dependencies on 1.53 header-only?

Murilo F. M. gravatar imageMurilo F. M. ( 2014-08-21 17:12:52 -0500 )edit

I actually don't know how to check that. I assumed the dependencies were on libboost1.53 because of these libraries in the package

nckswt gravatar imagenckswt ( 2014-08-21 17:25:01 -0500 )edit

It looks like the 1.53 libs are wrapped inside the package, so it shouldn't conflict with your Boost libs system-wide.

Murilo F. M. gravatar imageMurilo F. M. ( 2014-08-21 17:37:14 -0500 )edit

So the segfault is unrelated to boost? Why would AsyncSpinner() cause a segfault?

nckswt gravatar imagenckswt ( 2014-08-21 18:50:01 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2014-08-25 04:57:22 -0500

Markus Achtelik gravatar image

I'm not sure if this is fixable the easy way. To me, it looks like the problem is boost thread, which appears to be not header only. I'm not too much into linking, so here is my naive interpretation of the problem: The boost thread header compiled in the vicon-lib is compatible to the thread symbol for 1.5x , while ros asks for 1.4x . Since both symbols have the same name, there is no chance for the linker to decide which lib is the correct one to link... Back then, I played quite a bit with linking, the result was always the same: either the vicon sdk segfaulted or our ros interface, depending on which boost lib the linker decided to link.

The only (but ugly) way out I see for now, is to install a matching boost version and compile ros from source. We did this on a few of our machines successfully, since we ran into other problems with the old boost version.

Even though the linking problem still exists, it didn't crash on our 64 bit machines so far.

edit flag offensive delete link more

Comments

Well, I'm running this all in a VM (Nootrix's ROS Hydro), so I can always make my own 64-bit VM, though I'll have to reconfigure a fair bit. Here's hoping it'll work!

nckswt gravatar imagenckswt ( 2014-08-25 12:15:41 -0500 )edit

See edit above. Tried it with a new 64-bit linux, but still Boost issues arise. Seems like it's mixing libboost and libboost-mt, somehow.

nckswt gravatar imagenckswt ( 2014-08-26 10:36:26 -0500 )edit

Do you mean edit 3? It looks like it doesn't even connect to the vicon computer. the segfault usually happened after it connected successfully. Can you ping the vicon computer with "ping vicon" ? you can change the hostname/address in vicon.launch

Markus Achtelik gravatar imageMarkus Achtelik ( 2014-08-26 11:16:18 -0500 )edit

You might have to click 'more' to be able to see the rest - my initial post is starting to get pretty long!

nckswt gravatar imagenckswt ( 2014-08-26 13:51:11 -0500 )edit

I checked it with the testclient binary, and everything looks fine - I'm getting a steady stream of data from the Vicon SDK. Here's a file containing the output of gdb.

nckswt gravatar imagenckswt ( 2014-08-26 13:51:22 -0500 )edit

So, it looks like the segfaults don't always happen. My tactic now is to simply run the roslaunch over and over until it works, and then just stick with that. Not an elegant solution in the slightest (and I'll post more if I can figure it out!) but it's technically working! Thanks for all the help!

nckswt gravatar imagenckswt ( 2014-08-27 23:02:31 -0500 )edit

sorry for missing the "more" button ;) . This is quite weird, I was sure we had it running on 64-bit 12.04 machines. There is one last thing you could try to do: remove the boost libs from the sdk directory, and try to link your system's boost_system the catkin way.

Markus Achtelik gravatar imageMarkus Achtelik ( 2014-08-28 02:56:53 -0500 )edit
0

answered 2014-08-21 19:20:13 -0500

ahendrix gravatar image

Most of what I've seen suggests that multiple versions of boost don't coexist well.

There's some discussion of boost compatibility in the catkinization pull request that might be useful: https://github.com/ethz-asl/vicon_bri...

edit flag offensive delete link more

Comments

That is why I asked about header-only deps. Having header-only libs wrapped into a ROS package does not cause problems (e.g., I use the header-only Boost Geometry 1.55), as long as the package is properly configured.

Murilo F. M. gravatar imageMurilo F. M. ( 2014-08-21 19:49:31 -0500 )edit

Also, the answer to this question might shed some light on the matter.

Murilo F. M. gravatar imageMurilo F. M. ( 2014-08-21 19:50:26 -0500 )edit

Well, it definitely looks like it's getting closer to the root problem. I edited my answer above to include further testing.

nckswt gravatar imagenckswt ( 2014-08-24 21:48:35 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-08-21 17:09:28 -0500

Seen: 4,249 times

Last updated: Aug 26 '14