Skip to content

WrenchVisual::WrenchVisual Constructor Causes Segmentation Fault When Passing nullptr Without Exception Handling #1404

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

Closed
zhihaoshang opened this issue Apr 12, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@zhihaoshang
Copy link

Operating System:

Linux shangzh-VMware-Virtual-Platform 6.11.0-21-generic #21~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Feb 24 16:52:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

ROS version or commit hash:

ros2 jazzy

RMW implementation (if applicable):

No response

RMW Configuration (if applicable):

No response

Client library (if applicable):

rviz

'ros2 doctor --report' output

ros2 doc --report
   NETWORK CONFIGURATION
inet         : 127.0.0.1
inet4        : ['127.0.0.1']
inet6        : ['::1']
netmask      : 255.0.0.0
device       : lo
flags        : 73<LOOPBACK,UP,RUNNING>
mtu          : 65536
inet         : 192.168.148.137
inet4        : ['192.168.148.137']
ether        : 00:0c:29:be:c8:19
inet6        : ['fe80::20c:29ff:febe:c819%ens33']
netmask      : 255.255.255.0
device       : ens33
flags        : 4163<UP,BROADCAST,MULTICAST,RUNNING>
mtu          : 1500
broadcast    : 192.168.148.255

   PACKAGE VERSIONS
rqt_bag_plugins                           : latest=1.5.4, local=1.5.4
rosbag2                                   : latest=0.26.6, local=0.26.6
rosbag2_storage_default_plugins           : latest=0.26.6, local=0.26.6
rosbag2_storage_mcap                      : latest=0.26.6, local=0.26.6
rosbag2_compression_zstd                  : latest=0.26.6, local=0.26.6
mcap_vendor                               : latest=0.26.6, local=0.26.6
zstd_vendor                               : latest=0.26.6, local=0.26.6
rviz_visual_testing_framework             : latest=14.1.8, local=14.1.7
rviz2                                     : latest=14.1.8, local=14.1.7
rviz_default_plugins                      : latest=14.1.8, local=14.1.7
rviz_common                               : latest=14.1.8, local=14.1.7
rqt_bag                                   : latest=1.5.4, local=1.5.4
rosbag2_examples_py                       : latest=0.26.6, local=0.26.6
launch_testing_examples                   : latest=0.19.5, local=0.19.4
ros2bag                                   : latest=0.26.6, local=0.26.6
rosbag2_py                                : latest=0.26.6, local=0.26.6
rosbag2_transport                         : latest=0.26.6, local=0.26.6
rosbag2_storage_sqlite3                   : latest=0.26.6, local=0.26.6
rosbag2_examples_cpp                      : latest=0.26.6, local=0.26.6
rosbag2_compression                       : latest=0.26.6, local=0.26.6
rosbag2_cpp                               : latest=0.26.6, local=0.26.6
rosbag2_storage                           : latest=0.26.6, local=0.26.6
image_common                              : latest=5.1.6, local=5.1.5
camera_info_manager                       : latest=5.1.6, local=5.1.5
camera_calibration_parsers                : latest=5.1.6, local=5.1.5
yaml_cpp_vendor                           : latest=9.0.1, local=9.0.1
interactive_markers                       : latest=2.5.4, local=2.5.4
common_interfaces                         : latest=5.3.6, local=5.3.5
visualization_msgs                        : latest=5.3.6, local=5.3.5
dummy_robot_bringup                       : latest=0.33.5, local=0.33.5
robot_state_publisher                     : latest=3.3.3, local=3.3.3
kdl_parser                                : latest=2.11.0, local=2.11.0
urdf                                      : latest=2.10.0, local=2.10.0
urdf_parser_plugin                        : latest=2.10.0, local=2.10.0
turtlesim                                 : latest=1.8.3, local=1.8.3
trajectory_msgs                           : latest=5.3.6, local=5.3.5
tracetools_test                           : latest=8.2.3, local=8.2.3
tracetools_launch                         : latest=8.2.3, local=8.2.3
topic_statistics_demo                     : latest=0.33.5, local=0.33.5
topic_monitor                             : latest=0.33.5, local=0.33.5
pendulum_control                          : latest=0.33.5, local=0.33.5
tlsf_cpp                                  : latest=0.17.1, local=0.17.0
geometry2                                 : latest=0.36.9, local=0.36.8
tf2_tools                                 : latest=0.36.9, local=0.36.8
tf2_sensor_msgs                           : latest=0.36.9, local=0.36.8
test_tf2                                  : latest=N/A, local=0.36.8
tf2_kdl                                   : latest=0.36.9, local=0.36.8
tf2_geometry_msgs                         : latest=0.36.9, local=0.36.8
examples_tf2_py                           : latest=0.36.9, local=0.36.8
tf2_ros_py                                : latest=0.36.9, local=0.36.8
tf2_eigen                                 : latest=0.36.9, local=0.36.8
tf2_bullet                                : latest=0.36.9, local=0.36.8
tf2_ros                                   : latest=0.36.9, local=0.36.8
tf2_py                                    : latest=0.36.9, local=0.36.8
tf2_msgs                                  : latest=0.36.9, local=0.36.8
tf2_eigen_kdl                             : latest=0.36.9, local=0.36.8
laser_geometry                            : latest=2.7.0, local=2.7.0
tf2                                       : latest=0.36.9, local=0.36.8
test_tracetools                           : latest=N/A, local=8.2.3
rosbag2_test_common                       : latest=0.26.6, local=0.26.6
test_msgs                                 : latest=2.0.2, local=2.0.2
test_communication                        : latest=N/A, local=0.20.2
stereo_msgs                               : latest=5.3.6, local=5.3.5
std_srvs                                  : latest=5.3.6, local=5.3.5
shape_msgs                                : latest=5.3.6, local=5.3.5
examples_rclpy_pointcloud_publisher       : latest=0.19.5, local=0.19.4
sensor_msgs_py                            : latest=5.3.6, local=5.3.5
quality_of_service_demo_py                : latest=0.33.5, local=0.33.5
quality_of_service_demo_cpp               : latest=0.33.5, local=0.33.5
point_cloud_transport_py                  : latest=4.0.4, local=4.0.3
point_cloud_transport                     : latest=4.0.4, local=4.0.3
map_msgs                                  : latest=2.4.1, local=2.4.1
intra_process_demo                        : latest=0.33.5, local=0.33.5
image_transport                           : latest=5.1.6, local=5.1.5
image_tools                               : latest=0.33.5, local=0.33.5
dummy_sensors                             : latest=0.33.5, local=0.33.5
camera_info_manager_py                    : latest=5.1.6, local=5.1.5
sensor_msgs                               : latest=5.3.6, local=5.3.5
rqt_plot                                  : latest=1.4.2, local=1.4.2
ros2cli_common_extensions                 : latest=0.3.0, local=0.3.0
ros2doctor                                : latest=0.32.3, local=0.32.2
dummy_map_server                          : latest=0.33.5, local=0.33.5
nav_msgs                                  : latest=5.3.6, local=5.3.5
message_filters                           : latest=4.11.5, local=4.11.4
logging_demo                              : latest=0.33.5, local=0.33.5
lifecycle_py                              : latest=0.33.5, local=0.33.5
lifecycle                                 : latest=0.33.5, local=0.33.5
diagnostic_msgs                           : latest=5.3.6, local=5.3.5
geometry_msgs                             : latest=5.3.6, local=5.3.5
examples_rclpy_minimal_subscriber         : latest=0.19.5, local=0.19.4
examples_rclpy_minimal_service            : latest=0.19.5, local=0.19.4
examples_rclpy_minimal_publisher          : latest=0.19.5, local=0.19.4
examples_rclpy_minimal_client             : latest=0.19.5, local=0.19.4
examples_rclpy_executors                  : latest=0.19.5, local=0.19.4
examples_rclcpp_wait_set                  : latest=0.19.5, local=0.19.4
examples_rclcpp_multithreaded_executor    : latest=0.19.5, local=0.19.4
examples_rclcpp_minimal_subscriber        : latest=0.19.5, local=0.19.4
examples_rclcpp_minimal_publisher         : latest=0.19.5, local=0.19.4
examples_rclcpp_minimal_composition       : latest=0.19.5, local=0.19.4
examples_rclcpp_cbg_executor              : latest=0.19.5, local=0.19.4
demo_nodes_py                             : latest=0.33.5, local=0.33.5
demo_nodes_cpp_native                     : latest=0.33.5, local=0.33.5
demo_nodes_cpp                            : latest=0.33.5, local=0.33.5
composition                               : latest=0.33.5, local=0.33.5
actionlib_msgs                            : latest=5.3.6, local=5.3.5
std_msgs                                  : latest=5.3.6, local=5.3.5
rqt                                       : latest=1.6.0, local=1.6.0
rqt_gui_cpp                               : latest=1.6.0, local=1.6.0
ros2lifecycle_test_fixtures               : latest=0.32.3, local=0.32.2
ros2component                             : latest=0.32.3, local=0.32.2
rclcpp_lifecycle                          : latest=28.1.8, local=28.1.6
action_tutorials_cpp                      : latest=0.33.5, local=0.33.5
rclcpp_components                         : latest=28.1.8, local=28.1.6
examples_rclcpp_minimal_action_server     : latest=0.19.5, local=0.19.4
examples_rclcpp_minimal_action_client     : latest=0.19.5, local=0.19.4
rclcpp_action                             : latest=28.1.8, local=28.1.6
examples_rclcpp_minimal_timer             : latest=0.19.5, local=0.19.4
examples_rclcpp_minimal_service           : latest=0.19.5, local=0.19.4
examples_rclcpp_minimal_client            : latest=0.19.5, local=0.19.4
examples_rclcpp_async_client              : latest=0.19.5, local=0.19.4
rclcpp                                    : latest=28.1.8, local=28.1.6
libstatistics_collector                   : latest=1.7.4, local=1.7.4
statistics_msgs                           : latest=2.0.2, local=2.0.2
sros2_cmake                               : latest=0.13.3, local=0.13.2
sros2                                     : latest=0.13.3, local=0.13.2
rqt_topic                                 : latest=1.7.3, local=1.7.3
rqt_srv                                   : latest=1.2.2, local=1.2.2
rqt_shell                                 : latest=1.2.2, local=1.2.2
rqt_service_caller                        : latest=1.2.1, local=1.2.1
rqt_reconfigure                           : latest=1.6.2, local=1.6.2
rqt_py_console                            : latest=1.2.2, local=1.2.2
rqt_publisher                             : latest=1.7.2, local=1.7.2
rqt_action                                : latest=2.2.0, local=2.2.0
rqt_msg                                   : latest=1.5.1, local=1.5.1
rqt_console                               : latest=2.2.1, local=2.2.1
rqt_py_common                             : latest=1.6.0, local=1.6.0
rqt_graph                                 : latest=1.5.4, local=1.5.4
rqt_gui_py                                : latest=1.6.0, local=1.6.0
rqt_gui                                   : latest=1.6.0, local=1.6.0
ros_testing                               : latest=0.6.0, local=0.6.0
ros2trace                                 : latest=8.2.3, local=8.2.3
ros2topic                                 : latest=0.32.3, local=0.32.2
ros2test                                  : latest=0.6.0, local=0.6.0
ros2param                                 : latest=0.32.3, local=0.32.2
ros2lifecycle                             : latest=0.32.3, local=0.32.2
ros2service                               : latest=0.32.3, local=0.32.2
ros2run                                   : latest=0.32.3, local=0.32.2
ros2launch                                : latest=0.26.7, local=0.26.6
ros2pkg                                   : latest=0.32.3, local=0.32.2
ros2node                                  : latest=0.32.3, local=0.32.2
ros2multicast                             : latest=0.32.3, local=0.32.2
ros2interface                             : latest=0.32.3, local=0.32.2
ros2action                                : latest=0.32.3, local=0.32.2
ros2cli                                   : latest=0.32.3, local=0.32.2
launch_testing_ros                        : latest=0.26.7, local=0.26.6
launch_ros                                : latest=0.26.7, local=0.26.6
examples_rclpy_minimal_action_server      : latest=0.19.5, local=0.19.4
examples_rclpy_minimal_action_client      : latest=0.19.5, local=0.19.4
examples_rclpy_guard_conditions           : latest=0.19.5, local=0.19.4
action_tutorials_py                       : latest=0.33.5, local=0.33.5
rclpy                                     : latest=7.1.4, local=7.1.3
rosgraph_msgs                             : latest=2.0.2, local=2.0.2
rosbag2_interfaces                        : latest=0.26.6, local=0.26.6
ros2cli_test_interfaces                   : latest=0.32.3, local=0.32.2
rcl_lifecycle                             : latest=9.2.5, local=9.2.4
rcl_action                                : latest=9.2.5, local=9.2.4
rcl                                       : latest=9.2.5, local=9.2.4
rmw_implementation                        : latest=2.15.5, local=2.15.5
rmw_fastrtps_dynamic_cpp                  : latest=8.4.2, local=8.4.2
rmw_fastrtps_cpp                          : latest=8.4.2, local=8.4.2
rmw_fastrtps_shared_cpp                   : latest=8.4.2, local=8.4.2
rmw_cyclonedds_cpp                        : latest=2.2.3, local=2.2.3
rmw_connextddsmicro                       : latest=N/A, local=0.22.1
rmw_connextdds                            : latest=0.22.1, local=0.22.1
rmw_connextdds_common                     : latest=0.22.1, local=0.22.1
rmw_dds_common                            : latest=3.1.0, local=3.1.0
composition_interfaces                    : latest=2.0.2, local=2.0.2
rcl_interfaces                            : latest=2.0.2, local=2.0.2
pendulum_msgs                             : latest=0.33.5, local=0.33.5
lifecycle_msgs                            : latest=2.0.2, local=2.0.2
example_interfaces                        : latest=0.12.0, local=0.12.0
action_tutorials_interfaces               : latest=0.33.5, local=0.33.5
rosidl_default_runtime                    : latest=1.6.0, local=1.6.0
rosidl_default_generators                 : latest=1.6.0, local=1.6.0
action_msgs                               : latest=2.0.2, local=2.0.2
unique_identifier_msgs                    : latest=2.5.0, local=2.5.0
type_description_interfaces               : latest=2.0.2, local=2.0.2
service_msgs                              : latest=2.0.2, local=2.0.2
builtin_interfaces                        : latest=2.0.2, local=2.0.2
rosidl_core_runtime                       : latest=0.2.0, local=0.2.0
rosidl_core_generators                    : latest=0.2.0, local=0.2.0
rosidl_generator_py                       : latest=0.22.0, local=0.22.0
ament_lint_common                         : latest=0.17.2, local=0.17.1
ament_cmake_uncrustify                    : latest=0.17.2, local=0.17.1
ament_uncrustify                          : latest=0.17.2, local=0.17.1
uncrustify_vendor                         : latest=3.0.1, local=3.0.0
tracetools_trace                          : latest=8.2.3, local=8.2.3
tracetools_read                           : latest=8.2.3, local=8.2.3
tracetools                                : latest=8.2.3, local=8.2.3
tlsf                                      : latest=0.9.0, local=0.9.0
qt_gui_core                               : latest=2.7.5, local=2.7.5
qt_gui_cpp                                : latest=2.7.5, local=2.7.5
pluginlib                                 : latest=5.4.2, local=5.4.2
tinyxml2_vendor                           : latest=0.9.1, local=0.9.1
test_tracetools_launch                    : latest=N/A, local=8.2.3
test_security                             : latest=N/A, local=0.20.2
test_ros2trace                            : latest=N/A, local=8.2.3
test_rmw_implementation                   : latest=N/A, local=2.15.5
test_rclcpp                               : latest=N/A, local=0.20.2
test_quality_of_service                   : latest=N/A, local=0.20.2
test_launch_testing                       : latest=N/A, local=3.4.3
test_launch_ros                           : latest=N/A, local=0.26.6
test_interface_files                      : latest=0.11.0, local=0.11.0
test_cli_remapping                        : latest=N/A, local=0.20.2
test_cli                                  : latest=N/A, local=0.20.2
qt_gui_app                                : latest=2.7.5, local=2.7.5
qt_gui                                    : latest=2.7.5, local=2.7.5
tango_icons_vendor                        : latest=0.3.0, local=0.3.0
sqlite3_vendor                            : latest=0.26.6, local=0.26.6
rcl_logging_spdlog                        : latest=3.1.1, local=3.1.1
spdlog_vendor                             : latest=1.6.1, local=1.6.1
shared_queues_vendor                      : latest=0.26.6, local=0.26.6
rviz_rendering_tests                      : latest=14.1.8, local=14.1.7
rviz_rendering                            : latest=14.1.8, local=14.1.7
rviz_ogre_vendor                          : latest=14.1.8, local=14.1.7
rviz_assimp_vendor                        : latest=14.1.8, local=14.1.7
rttest                                    : latest=0.17.1, local=0.17.0
rti_connext_dds_cmake_module              : latest=0.22.1, local=0.22.1
lttngpy                                   : latest=8.2.3, local=8.2.3
rpyutils                                  : latest=0.4.1, local=0.4.1
rosidl_typesupport_tests                  : latest=N/A, local=3.2.2
rosidl_typesupport_introspection_tests    : latest=N/A, local=4.6.5
rosidl_typesupport_cpp                    : latest=3.2.2, local=3.2.2
rosidl_typesupport_introspection_cpp      : latest=4.6.5, local=4.6.5
rosidl_typesupport_c                      : latest=3.2.2, local=3.2.2
rosidl_typesupport_introspection_c        : latest=4.6.5, local=4.6.5
rosidl_typesupport_fastrtps_c             : latest=3.6.1, local=3.6.1
rosidl_typesupport_fastrtps_cpp           : latest=3.6.1, local=3.6.1
rosidl_generator_cpp                      : latest=4.6.5, local=4.6.5
rosidl_runtime_cpp                        : latest=4.6.5, local=4.6.5
rosidl_dynamic_typesupport_fastrtps       : latest=0.1.0, local=0.1.0
rcl_yaml_param_parser                     : latest=9.2.5, local=9.2.4
rmw                                       : latest=7.3.2, local=7.3.2
rosidl_dynamic_typesupport                : latest=0.1.2, local=0.1.2
rosidl_runtime_c                          : latest=4.6.5, local=4.6.5
rosidl_generator_c                        : latest=4.6.5, local=4.6.5
rosidl_typesupport_interface              : latest=4.6.5, local=4.6.5
rosidl_runtime_py                         : latest=0.13.1, local=0.13.1
rosidl_generator_dds_idl                  : latest=0.11.1, local=0.11.1
rosidl_cmake                              : latest=4.6.5, local=4.6.5
rosidl_pycommon                           : latest=4.6.5, local=4.6.5
rosidl_generator_type_description         : latest=4.6.5, local=4.6.5
rosidl_parser                             : latest=4.6.5, local=4.6.5
rosidl_generator_tests                    : latest=N/A, local=4.6.5
rosidl_adapter                            : latest=4.6.5, local=4.6.5
rosidl_cli                                : latest=4.6.5, local=4.6.5
rosbag2_tests                             : latest=0.26.6, local=0.26.6
rosbag2_test_msgdefs                      : latest=0.26.6, local=0.26.6
ros_environment                           : latest=4.2.1, local=4.2.1
rmw_implementation_cmake                  : latest=7.3.2, local=7.3.2
resource_retriever                        : latest=3.4.4, local=3.4.3
class_loader                              : latest=2.7.0, local=2.7.0
rcpputils                                 : latest=2.11.2, local=2.11.1
rcl_logging_noop                          : latest=3.1.1, local=3.1.1
rcl_logging_interface                     : latest=3.1.1, local=3.1.1
rcutils                                   : latest=6.7.2, local=6.7.2
qt_gui_py_common                          : latest=2.7.5, local=2.7.5
qt_dotgraph                               : latest=2.7.5, local=2.7.5
python_qt_binding                         : latest=2.2.1, local=2.2.1
python_orocos_kdl_vendor                  : latest=0.5.1, local=0.5.1
launch_testing_ament_cmake                : latest=3.4.4, local=3.4.3
python_cmake_module                       : latest=0.11.1, local=0.11.1
pybind11_vendor                           : latest=3.1.3, local=3.1.2
performance_test_fixture                  : latest=0.2.1, local=0.2.1
launch_pytest                             : latest=3.4.4, local=3.4.3
launch_testing                            : latest=3.4.4, local=3.4.3
launch_yaml                               : latest=3.4.4, local=3.4.3
launch_xml                                : latest=3.4.4, local=3.4.3
launch                                    : latest=3.4.4, local=3.4.3
osrf_pycommon                             : latest=2.1.6, local=2.1.5
orocos_kdl_vendor                         : latest=0.5.1, local=0.5.1
mimick_vendor                             : latest=0.6.2, local=0.6.2
libyaml_vendor                            : latest=1.6.3, local=1.6.3
liblz4_vendor                             : latest=0.26.6, local=0.26.6
libcurl_vendor                            : latest=3.4.4, local=3.4.3
keyboard_handler                          : latest=0.3.1, local=0.3.1
gz_math_vendor                            : latest=0.0.8, local=0.0.8
gz_utils_vendor                           : latest=0.0.5, local=0.0.5
gz_cmake_vendor                           : latest=0.0.9, local=0.0.9
ament_cmake_ros                           : latest=0.12.0, local=0.12.0
ament_cmake_auto                          : latest=2.5.3, local=2.5.3
ament_cmake_gmock                         : latest=2.5.3, local=2.5.3
ament_cmake_gtest                         : latest=2.5.3, local=2.5.3
ament_cmake_google_benchmark              : latest=2.5.3, local=2.5.3
fastrtps_cmake_module                     : latest=3.6.1, local=3.6.1
eigen3_cmake_module                       : latest=0.3.0, local=0.3.0
domain_coordinator                        : latest=0.12.0, local=0.12.0
console_bridge_vendor                     : latest=1.7.1, local=1.7.1
ament_cmake_xmllint                       : latest=0.17.2, local=0.17.1
ament_xmllint                             : latest=0.17.2, local=0.17.1
ament_cmake_pyflakes                      : latest=0.17.2, local=0.17.1
ament_pyflakes                            : latest=0.17.2, local=0.17.1
ament_cmake_pycodestyle                   : latest=0.17.2, local=0.17.1
ament_pycodestyle                         : latest=0.17.2, local=0.17.1
ament_cmake_pep257                        : latest=0.17.2, local=0.17.1
ament_pep257                              : latest=0.17.2, local=0.17.1
ament_cmake_pclint                        : latest=0.17.2, local=0.17.1
ament_pclint                              : latest=0.17.2, local=0.17.1
ament_lint_auto                           : latest=0.17.2, local=0.17.1
ament_cmake                               : latest=2.5.3, local=2.5.3
ament_cmake_version                       : latest=2.5.3, local=2.5.3
ament_cmake_vendor_package                : latest=2.5.3, local=2.5.3
ament_cmake_pytest                        : latest=2.5.3, local=2.5.3
ament_cmake_mypy                          : latest=0.17.2, local=0.17.1
ament_cmake_lint_cmake                    : latest=0.17.2, local=0.17.1
ament_cmake_flake8                        : latest=0.17.2, local=0.17.1
ament_cmake_cpplint                       : latest=0.17.2, local=0.17.1
ament_cmake_cppcheck                      : latest=0.17.2, local=0.17.1
ament_cmake_copyright                     : latest=0.17.2, local=0.17.1
ament_cmake_clang_tidy                    : latest=0.17.2, local=0.17.1
ament_cmake_clang_format                  : latest=0.17.2, local=0.17.1
ament_cmake_test                          : latest=2.5.3, local=2.5.3
ament_cmake_target_dependencies           : latest=2.5.3, local=2.5.3
ament_cmake_python                        : latest=2.5.3, local=2.5.3
ament_cmake_export_dependencies           : latest=2.5.3, local=2.5.3
ament_cmake_libraries                     : latest=2.5.3, local=2.5.3
ament_cmake_include_directories           : latest=2.5.3, local=2.5.3
ament_cmake_gen_version_h                 : latest=2.5.3, local=2.5.3
ament_cmake_export_targets                : latest=2.5.3, local=2.5.3
ament_cmake_export_link_flags             : latest=2.5.3, local=2.5.3
ament_cmake_export_interfaces             : latest=2.5.3, local=2.5.3
ament_cmake_export_libraries              : latest=2.5.3, local=2.5.3
ament_cmake_export_include_directories    : latest=2.5.3, local=2.5.3
ament_cmake_export_definitions            : latest=2.5.3, local=2.5.3
ament_cmake_core                          : latest=2.5.3, local=2.5.3
ament_package                             : latest=0.16.4, local=0.16.3
ament_mypy                                : latest=0.17.2, local=0.17.1
ament_lint_cmake                          : latest=0.17.2, local=0.17.1
ament_flake8                              : latest=0.17.2, local=0.17.1
ament_copyright                           : latest=0.17.2, local=0.17.1
ament_lint                                : latest=0.17.2, local=0.17.1
ament_index_python                        : latest=1.8.1, local=1.8.1
ament_index_cpp                           : latest=1.8.1, local=1.8.1
ament_cpplint                             : latest=0.17.2, local=0.17.1
ament_cppcheck                            : latest=0.17.2, local=0.17.1
ament_clang_tidy                          : latest=0.17.2, local=0.17.1
ament_clang_format                        : latest=0.17.2, local=0.17.1

   PLATFORM INFORMATION
system           : Linux
platform info    : Linux-6.11.0-21-generic-x86_64-with-glibc2.39
release          : 6.11.0-21-generic
processor        : x86_64

   QOS COMPATIBILITY LIST
compatibility status    : No publisher/subscriber pairs found

   RMW MIDDLEWARE
middleware name    : rmw_fastrtps_cpp

   ROS 2 INFORMATION
distribution name      : jazzy
distribution type      : ros2
distribution status    : active
release platforms      : {'debian': ['bookworm'], 'rhel': ['9'], 'ubuntu': ['noble']}

   TOPIC LIST
topic               : none
publisher count     : 0
subscriber count    : 0

Steps to reproduce issue

Environment

OS Version: Ubuntu 24.04
rviz version: ros2 jazzy
Compiler name and version number: Ubuntu clang version 18.1.3
Source or binary build?
source build
build options: --mixin asan-gcc

Description

During unit testing of the WrenchVisual::WrenchVisual constructor, it was found that when a nullptr is passed as an argument, the program encounters a Segmentation Fault. The issue occurs because the program fails to validate the validity of the passed argument and attempts to access a null pointer, resulting in illegal memory access.

Test Case

#include <gmock/gmock.h>
#include <memory>
#include <string>
#include <vector>
#include <OgreBillboardChain.h>
#include <OgreManualObject.h>
#include <OgreRoot.h>
#include <OgreSceneNode.h>
#include "../ogre_testing_environment.hpp"
#include "../scene_graph_introspection.hpp"
#include "rviz_rendering/objects/wrench_visual.hpp"
#include "rviz_rendering/objects/billboard_line.hpp"
#include "rviz_rendering/objects/arrow.hpp"
using namespace ::testing;  // NOLINT
MATCHER_P(Vector3Eq, expected, "") {
  return Ogre::Math::Abs(expected.x - arg.x) < 0.0001f &&
         Ogre::Math::Abs(expected.y - arg.y) < 0.0001f &&
         Ogre::Math::Abs(expected.z - arg.z) < 0.0001f;
}
class WrenchVisualTestFixture : public ::testing::Test
{
protected:
  void SetUp()
  {
    testing_environment_ = std::make_shared<rviz_rendering::OgreTestingEnvironment>();
    testing_environment_->setUpOgreTestEnvironment();
  }
  std::shared_ptr<rviz_rendering::OgreTestingEnvironment> testing_environment_;
};

Ogre::SceneNode * findForceArrow(Ogre::SceneNode * scene_node)
{
  auto arrows = rviz_rendering::findAllArrows(scene_node);
  auto billboard_line = rviz_rendering::findOneBillboardChain(scene_node);
  for (const auto & arrow : arrows) {
    if (billboard_line->getParentSceneNode()->getParent() != arrow->getParent()) {
      return arrow;
    }
  }
  return nullptr;
}
TEST_F(WrenchVisualTestFixture, constructor_handles_null_pointers_gracefully) {
  Ogre::SceneManager* scene_manager = nullptr;
  Ogre::SceneNode* root_node = nullptr;

  EXPECT_THROW({
    auto wrench_visual = std::make_shared<rviz_rendering::WrenchVisual>(scene_manager, root_node);
  }, std::invalid_argument);
}

Output

Running main() from gmock_main.cc
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from WrenchVisualTestFixture
[ RUN      ] WrenchVisualTestFixture.constructor_handles_null_pointers_gracefully
[rviz_rendering:debug] Available Renderers(1): OpenGL Rendering Subsystem, at /home/shangzh/ros2_jazzy/src/ros2/rviz/rviz_rendering/src/rviz_rendering/render_system.cpp:289
[rviz_rendering:info] Stereo is NOT SUPPORTED, at /home/shangzh/ros2_jazzy/src/ros2/rviz/rviz_rendering/src/rviz_rendering/render_system.cpp:531
[rviz_rendering:info] OpenGl version: 4.3 (GLSL 4.3), at /home/shangzh/ros2_jazzy/src/ros2/rviz/rviz_rendering/src/rviz_rendering/render_system.cpp:272
AddressSanitizer:DEADLYSIGNAL
=================================================================
==222634==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7cc7bd9c29b5 bp 0x7fff0d966eb0 sp 0x7fff0d966db0 T0)
==222634==The signal is caused by a READ memory access.
==222634==Hint: address points to the zero page.
    #0 0x7cc7bd9c29b5 in rviz_rendering::WrenchVisual::WrenchVisual(Ogre::SceneManager*, Ogre::SceneNode*) (/home/shangzh/ros2_jazzy/install/rviz_rendering/lib/librviz_rendering.so+0x3c29b5) (BuildId: cffd3d255d72a7634225ec0bbe57959441c23146)
    #1 0x626889fc0a68 in void std::_Construct<rviz_rendering::WrenchVisual, Ogre::SceneManager*&, Ogre::SceneNode*&>(rviz_rendering::WrenchVisual*, Ogre::SceneManager*&, Ogre::SceneNode*&) (/home/shangzh/ros2_jazzy/build/rviz_rendering/wrench_visual_test_target+0x2aa68) (BuildId: c19f8f7aaeceb19801278f9d1158d3a8f09a938b)
    #2 0x626889fc0255 in std::_Sp_counted_ptr_inplace<rviz_rendering::WrenchVisual, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<Ogre::SceneManager*&, Ogre::SceneNode*&>(std::allocator<void>, Ogre::SceneManager*&, Ogre::SceneNode*&) (/home/shangzh/ros2_jazzy/build/rviz_rendering/wrench_visual_test_target+0x2a255) (BuildId: c19f8f7aaeceb19801278f9d1158d3a8f09a938b)
    #3 0x626889fbfa6e in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<rviz_rendering::WrenchVisual, std::allocator<void>, Ogre::SceneManager*&, Ogre::SceneNode*&>(rviz_rendering::WrenchVisual*&, std::_Sp_alloc_shared_tag<std::allocator<void> >, Ogre::SceneManager*&, Ogre::SceneNode*&) (/home/shangzh/ros2_jazzy/build/rviz_rendering/wrench_visual_test_target+0x29a6e) (BuildId: c19f8f7aaeceb19801278f9d1158d3a8f09a938b)
    #4 0x626889fbf242 in std::__shared_ptr<rviz_rendering::WrenchVisual, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<void>, Ogre::SceneManager*&, Ogre::SceneNode*&>(std::_Sp_alloc_shared_tag<std::allocator<void> >, Ogre::SceneManager*&, Ogre::SceneNode*&) (/home/shangzh/ros2_jazzy/build/rviz_rendering/wrench_visual_test_target+0x29242) (BuildId: c19f8f7aaeceb19801278f9d1158d3a8f09a938b)
    #5 0x626889fbed41 in std::shared_ptr<rviz_rendering::WrenchVisual>::shared_ptr<std::allocator<void>, Ogre::SceneManager*&, Ogre::SceneNode*&>(std::_Sp_alloc_shared_tag<std::allocator<void> >, Ogre::SceneManager*&, Ogre::SceneNode*&) (/home/shangzh/ros2_jazzy/build/rviz_rendering/wrench_visual_test_target+0x28d41) (BuildId: c19f8f7aaeceb19801278f9d1158d3a8f09a938b)
    #6 0x626889fbe0be in std::shared_ptr<std::enable_if<!std::is_array<rviz_rendering::WrenchVisual>::value, rviz_rendering::WrenchVisual>::type> std::make_shared<rviz_rendering::WrenchVisual, Ogre::SceneManager*&, Ogre::SceneNode*&>(Ogre::SceneManager*&, Ogre::SceneNode*&) (/home/shangzh/ros2_jazzy/build/rviz_rendering/wrench_visual_test_target+0x280be) (BuildId: c19f8f7aaeceb19801278f9d1158d3a8f09a938b)
    #7 0x626889fbb978 in WrenchVisualTestFixture_constructor_handles_null_pointers_gracefully_Test::TestBody() (/home/shangzh/ros2_jazzy/build/rviz_rendering/wrench_visual_test_target+0x25978) (BuildId: c19f8f7aaeceb19801278f9d1158d3a8f09a938b)
    #8 0x62688a05ea59 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (/home/shangzh/ros2_jazzy/build/rviz_rendering/wrench_visual_test_target+0xc8a59) (BuildId: c19f8f7aaeceb19801278f9d1158d3a8f09a938b)
    #9 0x62688a04bb65 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (/home/shangzh/ros2_jazzy/build/rviz_rendering/wrench_visual_test_target+0xb5b65) (BuildId: c19f8f7aaeceb19801278f9d1158d3a8f09a938b)
    #10 0x626889ff128b in testing::Test::Run() (/home/shangzh/ros2_jazzy/build/rviz_rendering/wrench_visual_test_target+0x5b28b) (BuildId: c19f8f7aaeceb19801278f9d1158d3a8f09a938b)
    #11 0x626889ff2a67 in testing::TestInfo::Run() (/home/shangzh/ros2_jazzy/build/rviz_rendering/wrench_visual_test_target+0x5ca67) (BuildId: c19f8f7aaeceb19801278f9d1158d3a8f09a938b)
    #12 0x626889ff3dc0 in testing::TestSuite::Run() (/home/shangzh/ros2_jazzy/build/rviz_rendering/wrench_visual_test_target+0x5ddc0) (BuildId: c19f8f7aaeceb19801278f9d1158d3a8f09a938b)
    #13 0x62688a01aaeb in testing::internal::UnitTestImpl::RunAllTests() (/home/shangzh/ros2_jazzy/build/rviz_rendering/wrench_visual_test_target+0x84aeb) (BuildId: c19f8f7aaeceb19801278f9d1158d3a8f09a938b)
    #14 0x62688a061eb4 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) (/home/shangzh/ros2_jazzy/build/rviz_rendering/wrench_visual_test_target+0xcbeb4) (BuildId: c19f8f7aaeceb19801278f9d1158d3a8f09a938b)
    #15 0x62688a04ee02 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) (/home/shangzh/ros2_jazzy/build/rviz_rendering/wrench_visual_test_target+0xb8e02) (BuildId: c19f8f7aaeceb19801278f9d1158d3a8f09a938b)
    #16 0x62688a0170f5 in testing::UnitTest::Run() (/home/shangzh/ros2_jazzy/build/rviz_rendering/wrench_visual_test_target+0x810f5) (BuildId: c19f8f7aaeceb19801278f9d1158d3a8f09a938b)
    #17 0x626889fc1596 in RUN_ALL_TESTS() (/home/shangzh/ros2_jazzy/build/rviz_rendering/wrench_visual_test_target+0x2b596) (BuildId: c19f8f7aaeceb19801278f9d1158d3a8f09a938b)
    #18 0x626889fc14e2 in main (/home/shangzh/ros2_jazzy/build/rviz_rendering/wrench_visual_test_target+0x2b4e2) (BuildId: c19f8f7aaeceb19801278f9d1158d3a8f09a938b)
    #19 0x7cc7bb82a1c9 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #20 0x7cc7bb82a28a in __libc_start_main_impl ../csu/libc-start.c:360
    #21 0x626889fbb2b4 in _start (/home/shangzh/ros2_jazzy/build/rviz_rendering/wrench_visual_test_target+0x252b4) (BuildId: c19f8f7aaeceb19801278f9d1158d3a8f09a938b)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/home/shangzh/ros2_jazzy/install/rviz_rendering/lib/librviz_rendering.so+0x3c29b5) (BuildId: cffd3d255d72a7634225ec0bbe57959441c23146) in rviz_rendering::WrenchVisual::WrenchVisual(Ogre::SceneManager*, Ogre::SceneNode*)
==222634==ABORTING

Expected behavior

When the WrenchVisual::WrenchVisual constructor receives a nullptr as an argument, the following behavior is expected:

The function should check if the passed pointers are nullptr.

If any of the pointers are nullptr, an std::invalid_argument exception should be thrown, indicating that the input arguments are invalid.

The program should avoid encountering a segmentation fault when invalid parameters are passed.

Actual behavior

When a nullptr is passed as an argument, the WrenchVisual::WrenchVisual constructor does not properly validate the input, leading to direct access to the null pointer. This results in a Segmentation Fault and crashes the program.

Additional information

Suggested Fix

WrenchVisual::WrenchVisual(Ogre::SceneManager* scene_manager, Ogre::SceneNode* root_node) {
    if (!scene_manager || !root_node) {
        throw std::invalid_argument("Scene manager or root node is null");
    }
    // Other constructor implementation
}
@ahcorde
Copy link
Contributor

ahcorde commented Apr 14, 2025

PR #1411

@ahcorde ahcorde closed this as completed Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants