0
$\begingroup$

I'm trying to debug a segmentation fault on a ROS nodelet. I've tried to use libSegFault by adding the following lines to CMakeLists.txt:

set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_STANDARD_LIBRARIES -lSegFault)

Further, if I enable verbose output with:

set(CMAKE_VERBOSE_MAKEFILE on)

I can see that the nodelet library is indeed being compiled with -g and linked against libSegFault.

However, no additional output is generated when the nodelet crashes.

What am I missing? Is the output maybe being suppressed by the ROS logger?

$\endgroup$

1 Answer 1

1
$\begingroup$

It turns out that (as shown here) I had to set the LD_PRELOAD environment variable prior to starting the nodelet, for example:

LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libSegFault.so roslaunch ...

A dump was then correctly printed after the nodelet crashed.

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.