break with free memory

2 posts / 0 new
Last post
Offline
Last seen: 1 month 3 weeks ago
Joined: 02/23/2021
Posts: 1
break with free memory

Hello, I am new to RTI connext. My program is based on ROS2 and run well with  fastrtps and  eclipse cyclone_dds . I want to test the performance of RTI Connext DDS but abort Immediately when Program start. 

Fllowing is the gdb back trace begin from the program start to get abort.

Question: Why it abort  and how to deal ? Thanks !

 

[New Thread 0x7fffa3525700 (LWP 2580)]
RTI Connext DDS EVAL License issued to none [email protected] For non-production use only.
Expires on 23-Mar-2021 See www.rti.com for more information.
[New Thread 0x7fffa2b2c700 (LWP 2583)]
[New Thread 0x7fffa232b700 (LWP 2584)]
[New Thread 0x7fffa1890700 (LWP 2585)]
[New Thread 0x7fffa108f700 (LWP 2586)]
[New Thread 0x7fffa088e700 (LWP 2587)]
[New Thread 0x7fff87eee700 (LWP 2588)]
[New Thread 0x7fff876ed700 (LWP 2589)]
[New Thread 0x7fff86ddb700 (LWP 2590)]
[New Thread 0x7fff85943700 (LWP 2591)]
[New Thread 0x7fff85121700 (LWP 2592)]
[New Thread 0x7fff848ff700 (LWP 2593)]
[New Thread 0x7fff63fff700 (LWP 2594)]
[New Thread 0x7fff637fe700 (LWP 2595)]
[New Thread 0x7fff62ffd700 (LWP 2596)]
[New Thread 0x7fff627fc700 (LWP 2597)]
[New Thread 0x7fff61fda700 (LWP 2598)]
[New Thread 0x7fff61041700 (LWP 2599)]
free(): invalid pointer
Thread 1 "mwrobot_interac" received signal SIGABRT, Aborted.
__GI_raise ([email protected]=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise ([email protected]=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007ffff5c8d535 in __GI_abort () at abort.c:79
#2 0x00007ffff5ce4508 in __libc_message ([email protected]=do_abort, [email protected]=0x7ffff5def28d "%s\n")
at ../sysdeps/posix/libc_fatal.c:181
#3 0x00007ffff5ceac1a in malloc_printerr ([email protected]=0x7ffff5ded43b "free(): invalid pointer") at malloc.c:5341
#4 0x00007ffff5cec42c in _int_free (av=<optimized out>, p=<optimized out>, have_lock=<optimized out>) at malloc.c:4165
#5 0x00007ffff1af6529 in RTIOsapiHeap_freeMemoryInternal (voidPtr=0x7fffb555d658, forceUseOfHeapHeader=0,
FUNCTION_NAME=0x7ffff2477611 "RTIOsapiHeap_freeString", signature=RTI_OSAPI_STRING_ALLOC) at heap.c:999
#6 0x00007ffff1fa1b16 in DDS_String_free (string=0x7fffb555d658 "DDS_DEFAULT_FLOW_CONTROLLER_NAME") at String.c:51
#7 0x00007ffff205930d in DDS_PublishModeQosPolicy_free_name (self=0x7ffffffed860) at PublishModeQosPolicy.c:99
#8 0x00007ffff2059cee in DDS_PublishModeQosPolicy_from_presentation_qos_policy (self=0x7ffffffed860, src=0x7ffffffecc20,
participant=0x555556c3dcf0) at PublishModeQosPolicy.c:414
#9 0x00007ffff21cac0b in DDS_DataWriterQos_from_presentation_qos (self=0x7ffffffed4f0, src=0x7ffffffecc20, participant=0x555556c3dcf0)
at DataWriterQos.c:1184
#10 0x00007ffff21b1d80 in DDS_DataWriter_get_qos (self=0x555556de8ec0, qos=0x7ffffffed4f0) at DataWriter.c:1456
#11 0x00007ffff11340bd in DDSDataWriter_impl::get_qos (this=0x555556de9170, qos=...) at DataWriter.cxx:709
#12 0x00007fffb5babd82 in DDSDataWriter::get_qos(DDS_DataWriterQos&) ()
from /opt/ros2_foxy/install/mwrobot_msgs/lib/libmwrobot_msgs__rosidl_typesupport_connext_cpp.so
#13 0x00007fffb5dad919 in mwrobot_msgs::srv::dds_::MapNearestPoints_Request_DataWriter::get_qos(DDS_DataWriterQos&) ()
from /opt/ros2_foxy/install/mwrobot_msgs/lib/libmwrobot_msgs__rosidl_typesupport_connext_cpp.so
#14 0x00007fffb4324f7f in connext::details::RequesterUntypedImpl::RequesterTopicBuilder::create_reader_topic(connext::details::EntityParams const&, char const*) () from /home/mw/rti_connext_dds-6.0.1/lib/x64Linux4gcc7.3.0/librticonnextmsgcpp.so
#15 0x00007fffb432853d in connext::details::EntityUntypedImpl::initialize(connext::details::EntityParams const&, char const* (*)(DDSTypeSupport*, DDSDomainParticipant*), char const* (*)(DDSTypeSupport*, DDSDomainParticipant*), int, connext::details::EntityUntypedImpl::TopicBuilder&, DDSDataReaderListener*, bool, char const*) () from /home/mw/rti_connext_dds-6.0.1/lib/x64Linux4gcc7.3.0/librticonnextmsgcpp.so
#16 0x00007fffb43243a1 in connext::details::RequesterUntypedImpl::RequesterUntypedImpl(connext::RequesterParams const&, char const* (*)(DDSTypeSupport*, DDSDomainParticipant*), char const* (*)(DDSTypeSupport*, DDSDomainParticipant*), int, bool) ()
from /home/mw/rti_connext_dds-6.0.1/lib/x64Linux4gcc7.3.0/librticonnextmsgcpp.so
#17 0x00007fffb5b99249 in connext::details::RequesterImpl<mwrobot_msgs::srv::dds_::MapNearestPoints_Request_, mwrobot_msgs::srv::dds_::MapNearestPoints_Response_>::RequesterImpl(connext::RequesterParams const&) ()
from /opt/ros2_foxy/install/mwrobot_msgs/lib/libmwrobot_msgs__rosidl_typesupport_connext_cpp.so
#18 0x00007fffb5b9826f in connext::Requester<mwrobot_msgs::srv::dds_::MapNearestPoints_Request_, mwrobot_msgs::srv::dds_::MapNearestPoints_Response_>::Requester(connext::RequesterParams const&) ()
from /opt/ros2_foxy/install/mwrobot_msgs/lib/libmwrobot_msgs__rosidl_typesupport_connext_cpp.so
#19 0x00007fffb5b9701e in mwrobot_msgs::srv::typesupport_connext_cpp::create_requester__MapNearestPoints(void*, char const*, char const*, void const*, void const*, void**, void**, void* (*)(unsigned long)) ()
--Type <RET> for more, q to quit, c to continue without paging--
from /opt/ros2_foxy/install/mwrobot_msgs/lib/libmwrobot_msgs__rosidl_typesupport_connext_cpp.so
#20 0x00007ffff28a9f7c in rmw_create_client (node=0x555557254df0,
type_supports=0x7ffff76bc950 <mwrobot_msgs::srv::rosidl_typesupport_cpp::MapNearestPoints_service_type_support_handle>,
service_name=0x5555575f72e0 "/map_nearest_points", qos_profile=0x7fffffff3530)
at /opt/ros2_foxy/src/ros2/rmw_connext/rmw_connext_cpp/src/rmw_client.cpp:139
#21 0x00007ffff64b2e65 in rmw_create_client (v4=0x555557254df0,
v3=0x7ffff76bc950 <mwrobot_msgs::srv::rosidl_typesupport_cpp::MapNearestPoints_service_type_support_handle>,
v2=0x5555575f72e0 "/map_nearest_points", v1=0x7fffffff3530)
at /opt/ros2_foxy/src/ros2/rmw_implementation/rmw_implementation/src/functions.cpp:391

#22 0x00007ffff64ce48e in rcl_client_init (client=0x5555575ee050, node=0x555556b747c0,
type_support=0x7ffff76bc950 <mwrobot_msgs::srv::rosidl_typesupport_cpp::MapNearestPoints_service_type_support_handle>,
service_name=0x5555575d0120 "map_nearest_points", options=0x7fffffff3530) at /opt/ros2_foxy/src/ros2/rcl/rcl/src/rcl/client.c:169
#23 0x000055555574c6da in rclcpp::Client<mwrobot_msgs::srv::MapNearestPoints>::Client (this=0x555557584f90, node_base=0x555556baed30,
node_graph=std::shared_ptr<class rclcpp::node_interfaces::NodeGraphInterface> (use count 6, weak count 1) = {...},
service_name="map_nearest_points", client_options=...) at /opt/ros2_foxy/install/rclcpp/include/rclcpp/client.hpp:219
#24 0x0000555555743ee2 in __gnu_cxx::new_allocator<rclcpp::Client<mwrobot_msgs::srv::MapNearestPoints> >::construct<rclcpp::Client<mwrobot_msgs::srv::MapNearestPoints>, rclcpp::node_interfaces::NodeBaseInterface*, std::shared_ptr<rclcpp::node_interfaces::NodeGraphInterface>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rcl_client_options_t&> (this=0x7fffffff329f,
__p=0x555557584f90, __args#[email protected]: 0x555556baed30,
__args#1=std::shared_ptr<class rclcpp::node_interfaces::NodeGraphInterface> (use count 6, weak count 1) = {...},
__args#2="map_nearest_points", __args#3=...) at /usr/include/c++/8/ext/new_allocator.h:136
#25 0x000055555573637c in std::allocator_traits<std::allocator<rclcpp::Client<mwrobot_msgs::srv::MapNearestPoints> > >::construct<rclcpp::Client<mwrobot_msgs::srv::MapNearestPoints>, rclcpp::node_interfaces::NodeBaseInterface*, std::shared_ptr<rclcpp::node_interfaces::NodeGraphInterface>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rcl_client_options_t&> (__a=...,
__p=0x555557584f90, __args#[email protected]: 0x555556baed30,
__args#1=std::shared_ptr<class rclcpp::node_interfaces::NodeGraphInterface> (use count 6, weak count 1) = {...},
__args#2="map_nearest_points", __args#3=...) at /usr/include/c++/8/bits/alloc_traits.h:475
#26 0x000055555572bc36 in std::_Sp_counted_ptr_inplace<rclcpp::Client<mwrobot_msgs::srv::MapNearestPoints>, std::allocator<rclcpp::Client<mwrobot_msgs::srv::MapNearestPoints> >, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<rclcpp::node_interfaces::NodeBaseInterface*, std::shared_ptr<rclcpp::node_interfaces::NodeGraphInterface>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rcl_client_options_t&> (this=0x555557584f80, __a=...) at /usr/include/c++/8/bits/shared_ptr_base.h:545
#27 0x0000555555721b26 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<rclcpp::Client<mwrobot_msgs::srv::MapNearestPoints>, std::allocator<rclcpp::Client<mwrobot_msgs::srv::MapNearestPoints> >, rclcpp::node_interfaces::NodeBaseInterface*, std::shared_ptr<rclcpp::node_interfaces::NodeGraphInterface>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rcl_client_options_t&> (this=0x7fffffff3788, [email protected]: 0x0, __a=...) at /usr/include/c++/8/bits/shared_ptr_base.h:677
#28 0x0000555555717535 in std::__shared_ptr<rclcpp::Client<mwrobot_msgs::srv::MapNearestPoints>, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<s--Type <RET> for more, q to quit, c to continue without paging--
td::allocator<rclcpp::Client<mwrobot_msgs::srv::MapNearestPoints> >, rclcpp::node_interfaces::NodeBaseInterface*, std::shared_ptr<rclcpp::node_interfaces::NodeGraphInterface>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rcl_client_options_t&> (this=0x7fffffff3780, __tag=...) at /usr/include/c++/8/bits/shared_ptr_base.h:1342
#29 0x000055555570ca23 in std::shared_ptr<rclcpp::Client<mwrobot_msgs::srv::MapNearestPoints> >::shared_ptr<std::allocator<rclcpp::Client<mwrobot_msgs::srv::MapNearestPoints> >, rclcpp::node_interfaces::NodeBaseInterface*, std::shared_ptr<rclcpp::node_interfaces::NodeGraphInterface>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rcl_client_options_t&> (this=0x7fffffff3780,
__tag=...) at /usr/include/c++/8/bits/shared_ptr.h:359
#30 0x0000555555701a6f in std::allocate_shared<rclcpp::Client<mwrobot_msgs::srv::MapNearestPoints>, std::allocator<rclcpp::Client<mwrobot_msgs::srv::MapNearestPoints> >, rclcpp::node_interfaces::NodeBaseInterface*, std::shared_ptr<rclcpp::node_interfaces::NodeGraphInterface>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rcl_client_options_t&> (__a=...,
__args#[email protected]: 0x555556baed30,
__args#1=std::shared_ptr<class rclcpp::node_interfaces::NodeGraphInterface> (use count 6, weak count 1) = {...},
__args#2="map_nearest_points", __args#3=...) at /usr/include/c++/8/bits/shared_ptr.h:706
#31 0x00005555556f28db in std::make_shared<rclcpp::Client<mwrobot_msgs::srv::MapNearestPoints>, rclcpp::node_interfaces::NodeBaseInterface*, std::shared_ptr<rclcpp::node_interfaces::NodeGraphInterface>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rcl_client_options_t&> (__args#[email protected]: 0x555556baed30,
__args#1=std::shared_ptr<class rclcpp::node_interfaces::NodeGraphInterface> (use count 6, weak count 1) = {...},
__args#2="map_nearest_points", __args#3=...) at /usr/include/c++/8/bits/shared_ptr.h:722
#32 0x00005555556dcb09 in rclcpp::Client<mwrobot_msgs::srv::MapNearestPoints>::make_shared<rclcpp::node_interfaces::NodeBaseInterface*, std::shared_ptr<rclcpp::node_interfaces::NodeGraphInterface>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rcl_client_options_t&> (args#[email protected]: 0x555556baed30,
args#1=std::shared_ptr<class rclcpp::node_interfaces::NodeGraphInterface> (use count 6, weak count 1) = {...},
args#2="map_nearest_points", args#3=...) at /opt/ros2_foxy/install/rclcpp/include/rclcpp/client.hpp:196
#33 0x00005555556cb356 in rclcpp::create_client<mwrobot_msgs::srv::MapNearestPoints> (
node_base=std::shared_ptr<class rclcpp::node_interfaces::NodeBaseInterface> (use count 5, weak count 0) = {...},
node_graph=std::shared_ptr<class rclcpp::node_interfaces::NodeGraphInterface> (use count 6, weak count 1) = {...},
node_services=std::shared_ptr<class rclcpp::node_interfaces::NodeServicesInterface> (use count 5, weak count 0) = {...},
service_name="map_nearest_points", qos_profile=..., group=std::shared_ptr<class rclcpp::CallbackGroup> (empty) = {...})
at /opt/ros2_foxy/install/rclcpp/include/rclcpp/create_client.hpp:43
#34 0x00005555556c3529 in rclcpp::Node::create_client<mwrobot_msgs::srv::MapNearestPoints> (this=0x555556a56a30,
service_name="map_nearest_points", qos_profile=..., group=std::shared_ptr<class rclcpp::CallbackGroup> (empty) = {...})
at /opt/ros2_foxy/install/rclcpp/include/rclcpp/node_impl.hpp:135
#35 0x00005555556bc3c2 in mwrobot::RunTimeReciever::InitRunTimeReciever (
this=0x555555a2ff20 <mwrobot::RunTimeReciever::Instance()::run_time_obj_>)
at /opt/ros2_ws/src/mwrobot_interactor_peripheral/src/run_time_reciever.cc:50
#36 0x0000555555872c4d in main (argc=1, argv=0x7fffffff4378)
--Type <RET> for more, q to quit, c to continue without paging--
at /opt/ros2_ws/src/mwrobot_interactor_peripheral/nodes/mwrobot_peripheral.cc:74
(gdb)

asorbini's picture
Offline
Last seen: 4 days 9 hours ago
Joined: 02/06/2013
Posts: 4

It looks like you are using the "old" RMW implementation for RTI Connext DDS, rmw_connext_cpp. This implementation was not developed by RTI, and it is being maintained by OpenRobotics. I would suggest to report the issue on that project's GitHub page.

In the meantime, I would like to encourage you to try out a new RMW implementation that RTI developed and recently published on our GitHub page, rmw_connextdds. This implementation has not yet made its way into a ROS2 release, so you will need to build it from source. The README includes a Quick Start which should help you get up and running.

You should definitely use this new implementation if you plan on doing any kind of performance evaluation, since it resolves some big performance issues that exist in the old implementation (caused by unnecessary memory allocations and data copies on the critical path).

Full disclosure: I am the main developer of rmw_connextdds, and I would be happy to answer any questions you might have about it.