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

rospack segmentation fault

asked 2016-11-29 03:39:45 -0600

martin1412 gravatar image

updated 2018-05-10 16:24:40 -0600

jayess gravatar image

Hi guys,

I am using ros::package::getPath to resolve the path to a config file I am loading within my program. When I am starting the node using

rosrun node_pkg node

everything works just fine, but when I directly launch the generated executable in the devel directory, I immediately get a segmentation fault

#0  0x00007ffff33056ad in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x00007ffff18511f3 in rospack::Stackage::~Stackage() () from /opt/ros/jade/lib/librospack.so
#2  0x00007ffff1847ecf in rospack::Rosstackage::addStackage(std::string const&) ()
   from /opt/ros/jade/lib/librospack.so
#3  0x00007ffff184bfad in rospack::Rosstackage::crawlDetail(std::string const&, bool, int, bool, std::vector<rospack::DirectoryCrawlRecord*, std::allocator<rospack::DirectoryCrawlRecord*> >&, boost::unordered::unordered_set<std::string, boost::hash<std::string>, std::equal_to<std::string>, std::allocator<std::string> >&) ()
   from /opt/ros/jade/lib/librospack.so
#4  0x00007ffff184bef3 in rospack::Rosstackage::crawlDetail(std::string const&, bool, int, bool, std::vector<rospack::DirectoryCrawlRecord*, std::allocator<rospack::DirectoryCrawlRecord*> >&, boost::unordered::unordered_set<std::string, boost::hash<std::string>, std::equal_to<std::string>, std::allocator<std::string> >&) ()
   from /opt/ros/jade/lib/librospack.so
#5  0x00007ffff184cbe5 in rospack::Rosstackage::crawl(std::vector<std::string, std::allocator<std::string> >, bool) () from /opt/ros/jade/lib/librospack.so
#6  0x00007ffff185b2d1 in rospack::rospack_run(int, char**, rospack::Rosstackage&, std::string&) ()
   from /opt/ros/jade/lib/librospack.so
#7  0x00007ffff1857e3c in rospack::ROSPack::run(int, char**) () from /opt/ros/jade/lib/librospack.so
#8  0x00007ffff1858169 in rospack::ROSPack::run(std::string const&) () from /opt/ros/jade/lib/librospack.so
#9  0x00007ffff597bf01 in ros::package::command(std::string const&) () from /opt/ros/jade/lib/libroslib.so
#10 0x00007ffff597c0cd in ros::package::getPath(std::string const&) () from /opt/ros/jade/lib/libroslib.so

can anybody explain this behavior?

#include <ros/package.h> 
std::string path = ros::package::getPath("x_common");

Thank you for your time!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2018-05-10 15:56:17 -0600

Ralff gravatar image

updated 2018-05-12 11:54:13 -0600

I know this is pretty old, but this occurs for me if I link Spinnaker to my node even if I don’t use any of the functionalities of Spinnaker. After looking into source for ros::getPath, it seems to break in _run in the _command function. Perhaps, it is linking different versions of boost once linking additional libraries to your node.

edit flag offensive delete link more

Comments

Can you please not post this as an answer? You're not actually answering the question, so either use a comment to provide additional context, or post a new question while referring to this one.

gvdhoorn gravatar image gvdhoorn  ( 2018-05-11 03:17:18 -0600 )edit

While I am not answering the question, I am trying to provide additional information that may help someone with a similar problem or the original poster. The comments do not allow enough characters.

Ralff gravatar image Ralff  ( 2018-05-11 15:08:04 -0600 )edit

I sympathise, but ROS Answers is a single question, multiple answer Q&A platform, not a regular forum. Unfortunately it doesn't lend itself to this sort of interaction.

Posting a new question is akin to opening a new diagnostic session, and if your issue gets resolved and it turns out that the ..

gvdhoorn gravatar image gvdhoorn  ( 2018-05-12 02:58:42 -0600 )edit

.. solution is generic enough and applies to others as well, we can just close this one with an answer pointing to your issue.

If it turns out they are two different problems, then the two separate questions/posts apparently made sense, so nothing lost by having them.

gvdhoorn gravatar image gvdhoorn  ( 2018-05-12 03:00:01 -0600 )edit

Sorry. I changed my answer to provide additional detail. I believe this partially answer the question now....

Ralff gravatar image Ralff  ( 2018-05-12 11:55:39 -0600 )edit

The Boost hint is a nice one. Are you linking a different Boost version?

gvdhoorn gravatar image gvdhoorn  ( 2018-05-12 13:37:01 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-11-29 03:39:45 -0600

Seen: 380 times

Last updated: May 12 '18