Process crashes without any error

asked 2021-04-11 00:29:48 -0600

hanks gravatar image

updated 2022-05-23 09:15:13 -0600

lucasw gravatar image

I have written a hybrid a* package for ROS and I'm testing the implementation through a Monte-Carlo simulation script. However, the process crashes without giving out any error after a few tests (~30). Following is the message -

[hybrid_astar-3] process has died [pid 22813, exit code -11, cmd /home/tanujthakkar/ROS/catkin_ws/devel/lib/hybrid_astar/hybrid_astar __name:=hybrid_astar __log:=/home/tanujthakkar/.ros/log/3831b7cc-9a3a-11eb-a15d-9cb6d0ec33b3/hybrid_astar-3.log].
log file: /home/tanujthakkar/.ros/log/3831b7cc-9a3a-11eb-a15d-9cb6d0ec33b3/hybrid_astar-3*.log

The log files mentioned here don't exist.

Here is the git repository for reference - https://github.com/tanujthakkar/hybri...

The hybrid_astar_plan() function in src/hybrid_astar.cpp is the main function and scripts/monte_carlo_simulation.py is the Monte-Carlo Simulation script.

The process crashes only with the hospital_04 map and not with the dual_hoyuko_full_map (not included in git repo). I can't seem to figure out why this happens. Please help to solve the issue.

edit retag flag offensive close merge delete

Comments

1

-11 is a SEGFAULT, which is typically caused by trying to dereference uninitialised pointers, already free()d memory, dangling pointers, out-of-bounds array access etc.

This is likely not ROS specific, but a general programming problem.

However, the process crashes without giving out any error

SEGFAULTs are a) fatal errors, which your program can't respond to itself, and b) detected and managed by the OS. If a SEGFAULT is detected, your program is terminated, no part of it can run, and there is no way for you to register an "error handler" which could print anything.

But again, this is very likely not something to do with ROS.

I'd suggest building the debug version of your program, running it in a debugger (either gdb or a visual one if you prefer), waiting for it to crash and then use the debugger to figure out where things go wrong ...(more)

gvdhoorn gravatar image gvdhoorn  ( 2021-04-11 01:39:44 -0600 )edit

@gvdhoorn I think I have actually solved the problem, there was something wrong with the 2D map pgm file itself as I mentioned this issue occurred on one map and not the other. I replaced it with a new PGM file and it seems to work for now. Additionally, I really want to optimize my code itself using multi-threading or something, currently, it only utilizes ~15% of CPU and the execution times are higher than what I would like. Please refer to this question here - https://stackoverflow.com/questions/6...

Please let me know if there's something I can do to optimize the code. Thanks!

hanks gravatar image hanks  ( 2021-04-11 01:59:39 -0600 )edit