0
$\begingroup$

Rosanswers logo

I have quite a large ros repo and everything was working fine for a very long time. For some reason running it after Christmas I started seeing the following:

terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc [kinematic_simulation-5] process has died [pid 42457, exit code -6, cmd /home/jj/ws/phd_ws/ws/devel/lib/perceptive_mpc/as_mpc_simulation_node /joint_states:=/as_control/joint_states __name:=kinematic_simulation __log:=/home/jj/.ros/log/59272bc6-6995-11ec-9acb-dc8b2894491d/kinematic_simulation-5.log]. log file: /home/jj/.ros/log/59272bc6-6995-11ec-9acb-dc8b2894491d/kinematic_simulation-5*.log

I have isolated the error to the following line:

std::string packagePath = ros::package::getPath("perceptive_mpc");

I'm using melodic, docker. the perceptive_mpc package is built and sourced. The line itself is inside the package so its definitely seen. roslib is inside dependencies. I just have no clue at all. Only seen one issue similar online : https://answers.ros.org/question/296304/rospackagegetpath-seg-faults-in-kinetic/

Oh and most interesting of all: if I put an absolute path myself instead of using ros:package:getPath -> everything runs fine.

Absolutely any help or advice appreciated!


Originally posted by JuliusS on ROS Answers with karma: 21 on 2021-12-30

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

If anyone encounters this -> Its likely todo with docker setup. In my case it was related to mounting /usr/share. Once I stopped mounting this issue is resolved.


Originally posted by JuliusS with karma: 21 on 2022-01-02

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by osilva on 2022-01-03:
Thank you for sharing the answer

$\endgroup$

Your Answer

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