Robotics StackExchange | Archived questions

GDB Debugging Symbols for Rviz

I have a core dump file that was saved after a segmentation fault in a rviz QT plugin. This plugin has been created in an independent package. However, when I try opening the file in gdb and view the stack trace, the required debugging symbols are not This loaded so the functions listed just appear as ??. I've tried using the file command to load the debugging symbols from where rviz is installed but it couldn't find any symbols. Does anyone know how to load these debugging symbols ?

Thank you!

Asked by mjs on 2019-09-25 17:41:13 UTC

Comments

Answers

The binary ROS packages that you can install through apt are not built with debugging symbols, and the default build mode for catkin does not include debugging symbols either.

You will probably need to check out the source for the exact version of rviz that you're using, and built it and your plugin from source in debug mode in order to debug this.

Asked by ahendrix on 2019-09-25 23:53:07 UTC

Comments

This is the answer, but I would add that you'd probably want to checkout the exact version of RViz that generated the core file.

Asked by gvdhoorn on 2019-09-26 03:38:16 UTC

Thank you!

Asked by mjs on 2019-09-26 13:13:39 UTC

In melodic, the debugging symbols are in an extra package:

sudo apt install ros-melodic-rviz-dbgsym

However, it seems that kinetic builds do not generate these.

Or, if you're not on Ubuntu, there could be a similar package available for your platform. Of course, these are the symbols resulting from RelWithDebInfo build type, so it isn't 100% precise, but it should be enough to give you a gist about where the code is failing.

However, if the bug is in your plugin, then you obviously also have to build your plugin with debugging symbols to get the full stack trace.

Note below: if you won't find the symbols for kinetic, you can always (pretty easily) build rviz locally with all symbols, even in debug mode, and then run the program again in the locally built rviz.

Asked by peci1 on 2019-09-26 04:21:56 UTC

Comments

Note that the OP tagged the question with kinetic, and afaik, dbgsym pkgs are not available for Kinetic and older.

Asked by gvdhoorn on 2019-09-26 04:23:44 UTC

Yeah, I've noticed that the second I sent the answer :) I've edited the answer to be more verbose about ROS versions.

Asked by peci1 on 2019-09-26 04:28:23 UTC