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

The node with pluginlib can not run in custom boost situation

asked 2017-11-13 00:39:48 -0600

Dragon gravatar image

The thing is like this:

I compile the boost of version 1.65 into my computer. And I build a package with pluginlib in it. I compile it over. But when I run the node, it will result in a segment fault. Like this:

gdb ./polygon_loader 
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 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".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./polygon_loader...(no debugging symbols found)...done.
(gdb) r
Starting program: /home/wangyawei/RosWorkspace/common_tutorials_ws/devel/lib/pluginlib_tutorials/polygon_loader 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
__GI___libc_free (mem=0x2) at malloc.c:2951
2951    malloc.c: No such file or directory.

So the problem is segment fault.

When I remove the path /usr/local/include/boost and /usr/local/lib/libboost* and recompile the package and the error is gone.

So I check the version of the two kind of boost: 1.58 for origin ros and 1.65 for my compile. Maybe there are different point between two kinds version.

But I want to know could anyone update the pluginlib for the latest version of boost?

edit retag flag offensive close merge delete

Comments

If someone face the segment fault when run the node which is build in pluginlib, you can check the version of boost in your computer. Maybe you meet the same problem like me ^_^

Dragon gravatar image Dragon  ( 2017-11-13 00:43:37 -0600 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2017-11-13 02:19:45 -0600

gvdhoorn gravatar image

So I check the version of the two kind of boost: 1.58 for origin ros and 1.65 for my compile. Maybe there are different point between two kinds version.

Linking multiple versions of Boost into the same binary (which pluginlib is doing) typically leads to these kind of problems (SEGFAULTs).

If you search on this site for versions boost you'll probably find more questions about this.

But I want to know could anyone update the pluginlib for the latest version of boost?

That is not going to help.

If you need/want to use a different (ie: newer or older) version of Boost than the one that the binary packages of ROS are compiled against, you'll have to build your entire ROS installation from source against that other version of Boost as well.

edit flag offensive delete link more

Comments

See #q223882, #q274016 and #q190902 for some older related questions.

gvdhoorn gravatar image gvdhoorn  ( 2017-11-13 02:21:33 -0600 )edit

Yes, you are right. And at last I use the origin version of boost in ros.

Dragon gravatar image Dragon  ( 2017-11-13 03:50:53 -0600 )edit
1

Please mark the question as answered by ticking the checkmark (✓) to the left of the answer if you feel it has been answered. Thanks.

gvdhoorn gravatar image gvdhoorn  ( 2017-11-13 03:54:47 -0600 )edit

Then what if you are having two libraries that are linked to two different version of boost, and you want to use them all? Is there a workaround for this type of scenarios? I believe it shall be a common scene.

TomHe gravatar image TomHe  ( 2017-11-13 14:41:55 -0600 )edit

It's difficult. If you have two different binaries (ie: two nodes) that need different vrsions then it could be made to work, but you cannot use any libraries linked to 'the other' version of boost.

Header-only 'libraries' could work, but it's hit-and-miss.

gvdhoorn gravatar image gvdhoorn  ( 2017-11-13 15:25:19 -0600 )edit

This is not a 'Boost thing' btw. It's a fundamental issue with trying to use different versions of shared libraries in a single binary.

gvdhoorn gravatar image gvdhoorn  ( 2017-11-13 15:25:51 -0600 )edit
TomHe gravatar image TomHe  ( 2017-11-13 15:27:46 -0600 )edit

If you can find out for which ABI the 'other boost' is compiled, you could see whether using the same compiler options work while mixing. The std::string ABI break comment on SO is a good one.

No guarantees though.

gvdhoorn gravatar image gvdhoorn  ( 2017-11-13 15:30:13 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-11-13 00:39:48 -0600

Seen: 2,060 times

Last updated: Nov 13 '17