0
$\begingroup$

Rosanswers logo

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?


Originally posted by Dragon on ROS Answers with karma: 68 on 2017-11-13

Post score: 1


Original comments

Comment by Dragon on 2017-11-13:
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 ^_^

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by gvdhoorn with karma: 86574 on 2017-11-13

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by gvdhoorn on 2017-11-13:
See #q223882, #q274016 and #q190902 for some older related questions.

Comment by Dragon on 2017-11-13:
Yes, you are right. And at last I use the origin version of boost in ros.

Comment by gvdhoorn on 2017-11-13:
Please mark the question as answered by ticking the checkmark (✓) to the left of the answer if you feel it has been answered. Thanks.

Comment by TomHe on 2017-11-13:
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.

Comment by gvdhoorn on 2017-11-13:
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.

Comment by gvdhoorn on 2017-11-13:
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.

Comment by TomHe on 2017-11-13:
https://stackoverflow.com/questions/44892499/boost-filesystem-segmentation-fault-in-c11-with-ros Also see this post.

Comment by gvdhoorn on 2017-11-13:
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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.