Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No stacktrace is printed on Segfault #21

Closed
firesurfer opened this issue Aug 26, 2024 · 8 comments
Closed

No stacktrace is printed on Segfault #21

firesurfer opened this issue Aug 26, 2024 · 8 comments

Comments

@firesurfer
Copy link

Hi, I am look for some help how to integrate this package.

System

Ubuntu 22.04
Ros2 Iron
backward_ros: 1.0.5

Setup

I added <depend>backward_ros</depend> to my package.xml.
And find_package(backward_ros REQUIRED)

Additionally I set target_compile_options(my_node PRIVATE "-g") just to make sure that it compiles with debug information.

Unfortunately this doesn't work. I tried the advice from #13 to include find_package(Backward) but that still doesn't work.

This is the output of cmake:

-- BACKWARD_HAS_UNWIND=1
-- BACKWARD_HAS_BACKTRACE=0
-- BACKWARD_HAS_BACKTRACE_SYMBOL=0
-- BACKWARD_HAS_DW=1
-- BACKWARD_HAS_BFD=0
-- Found Backward: /opt/ros/iron/share/backward_ros/cmake  

@christophfroehlich I realized a while ago that also the controller_manager does not print stacktraces anymore. So it might that a dependency has changed, or my system is broken ?

@christophfroehlich
Copy link
Contributor

I see stacktraces all around ;) Have you made a clean build after adding backward?

@firesurfer
Copy link
Author

Yes I did. I just tried again in a clean container environment and still: no backtraces.

For testing purposes I added some lines that produce a segfault.

@christophfroehlich
Copy link
Contributor

I have RelWithDebInfo in my colcon defaults. Maybe you can try that instead of the compile options flag.

@firesurfer
Copy link
Author

I also tried that but it didn't work. I have the feeling it something about the backward_ros package in iron.

What I did now is follow the guide the backward_cpp package: https://github.com/bombela/backward-cpp and directly include it via FetchContent.

@ottojo
Copy link

ottojo commented Oct 11, 2024

Hi! I also don't seem to have stacktraces anymore when using this package, maybe some system dependency broke in the past months?

I pushed a ros node here which is just the default from ros2 pkg create... and an invalid pointer dereference in the main function.

Some version information:

ros-iron-backward-ros is already the newest version (1.0.5-1jammy.20240711.224901).
Ubuntu 22.04.5 LTS
Linux ade 5.15.0-122-generic #132~20.04.1-Ubuntu SMP Fri Aug 30 15:50:07 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
c++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

from compile_commands.json:

/usr/bin/c++  -I/home/jonasotto/workspace/ros2_ws/src/segfault_node/include -I/opt/ros/iron/include -Werror=uninitialized -Werror=maybe-uninitialized -Werror=return-type -Wreorder -B/usr/libexec/mold -g -Wall -Wextra -Wpedantic -o CMakeFiles/segfault_node.dir/src/segfault_node.cpp.o -c /home/jonasotto/workspace/ros2_ws/src/segfault_node/src/segfault_node.cpp

from cmake link.txt:

/usr/bin/c++ -Werror=uninitialized -Werror=maybe-uninitialized -Werror=return-type -Wreorder -g CMakeFiles/segfault_node.dir/src/segfault_node.cpp.o -o segfault_node  -Wl,-rpath,/opt/ros/iron/lib /opt/ros/iron/lib/libbackward.so 

Edit: While this is the case in iron, the backtrace is produced as expected in jazzy...

@firesurfer
Copy link
Author

Hi @ottojo if you need the stacktrace in iron. This is how I managed to get one:
bombela/backward-cpp#341

@saikishor
Copy link
Member

saikishor commented Nov 7, 2024

Hi! I also don't seem to have stacktraces anymore when using this package, maybe some system dependency broke in the past months?

I pushed a ros node here which is just the default from ros2 pkg create... and an invalid pointer dereference in the main function.

Edit: While this is the case in iron, the backtrace is produced as expected in jazzy...

Hello @ottojo!

We have found a small issue and we are on the way to fix it. Probably, today you should have it. I'll make releases to have it in Iron before it's EOL

@saikishor
Copy link
Member

Hello All!

The issue is fixed and released to all ROS 2 Distros. Sorry for not getting back to it earlier. I'll go ahead and close this issue for now. If the issue persists feel free to open a new issue or reopen this one.
ros/rosdistro#43375 ros/rosdistro#43376 ros/rosdistro#43377 ros/rosdistro#43378

Thank you,

Best Regards,
PAL Robotics Team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants