Open Chaochao0215 opened 8 months ago
Hello @Chaochao0215, maybe we could build a debug type of this source code and use gdb
to backtrace when it crashed
I tried your code, but I cannot find segment fault.
My test environment is based on ros2 Debian package (ros-humble-rclcpp 16.0.8-1jammy.20240217.065743).
Hello @Chaochao0215, maybe we could build a debug type of this source code and use
gdb
to backtrace when it crashed Glad to receive your reply, this issue reoccuered and i pasted the backtrace information
I tried your code and I can't reproduce the segment fault. However, in gdb backtrace it seems like a multi-thread problem, rebuild your program with
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -g")
and check if there's data race in ThreadSanitizer
report.
I tried your code and I can't reproduce the segment fault. However, in gdb backtrace it seems like a multi-thread problem, rebuild your program with
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread -g")
and check if there's data race in
ThreadSanitizer
report.
hi, I found a quick way to reproduce the problem
6. send the message subscribed in the new shell terminal, such as 'ros2 topic pub /test_callback_group std_msgs/msg/String "data: hello"
I missed this step.
- send the message subscribed in the new shell terminal, such as 'ros2 topic pub /test_callback_group std_msgs/msg/String "data: hello"
I missed this step.
I'm sorry i didn't specify the need to publish message at the beginning, hope you reproduce it successfully.
I tried your code, but I cannot find segment fault. My test environment is based on ros2 Debian package (ros-humble-rclcpp 16.0.8-1jammy.20240217.065743). Thank you for your attention, it occurs with low probability and I built ROS2 from source so that it can be controlled through gdb
@Chaochao0215 it would be helpful if you could provide self-contained reproducible test.
@Chaochao0215 Did you find the cause of this problem in the end? How did you solve it? I also encountered the same problem when using MultiThreadedExecutor, The program stack is as follows
Program terminated with signal SIGSEGV, Segmentation fault.
[Current thread is 1 (Thread 0x7f5f7ee8e0 (LWP 402))] (gdb) bt
from /opt/ros/humble/lib/librclcpp.so
@Chaochao0215 Did you find the cause of this problem in the end? How did you solve it? I also encountered the same problem when using MultiThreadedExecutor, The program stack is as follows
Program terminated with signal SIGSEGV, Segmentation fault.
could you give a minimum demo code to regenerate this error ? I tried codes above, but it didn't crash.
@Chaochao0215 Did you find the cause of this problem in the end? How did you solve it? I also encountered the same problem when using MultiThreadedExecutor, The program stack is as follows Program terminated with signal SIGSEGV, Segmentation fault.
could you give a minimum demo code to regenerate this error ? I tried codes above, but it didn't crash.
My code is mixed with a lot of logic, I don't know which call caused it, this crash is quite sporadic, The program only appears once every few days.
This issue looks similar to https://github.com/ros2/rmw_fastrtps/issues/777.
ROS2
Bug report
Required Info:
Steps to reproduce issue
Create a node and call the create_callback_group interface to create a callback group local variable, then add the node to the executor and spin the executor, segment fault occuered sometimes.