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

rclcpp QoS implementation #2

Merged
merged 30 commits into from
Mar 29, 2019
Merged

rclcpp QoS implementation #2

merged 30 commits into from
Mar 29, 2019

Conversation

emersonknapp
Copy link

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

ross-desmond and others added 21 commits March 15, 2019 10:47
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
…sses

Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
Signed-off-by: Miaofei <miaofei@amazon.com>
…os2#652)

There are getters for the other interfaces, but the logging interface
appears to have been overlooked.

Signed-off-by: Michael Jeronimo <michael.jeronimo@intel.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
* match renamed action types

* fix action type casting

* rename type/field to use correct term

* rename custom GoalID type to avoid naming collision, update types using unique_identifier_msgs

* remove obsolete comments

* change signature of set_succeeded / set_canceled

* change signature of     on_terminal_state_(uuid_, result_msg);set_succeeded / set_canceled

* change signature of set_aborted

* change signature of publish_feedback

* update another test

Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Miaofei <miaofei@amazon.com>
In LLVM's `libcxx`, `int64_t` doesn't match chrono literals. See example below. To compile, run  `clang++-6.0 -stdlib=libc++ -std=c++14 TEST.cpp`

```
using namespace std::chrono_literals;

template<typename RatioT = std::milli>
bool
wait_for_service(
   std::chrono::duration<int64_t, RatioT> timeout
)
{
   return timeout == std::chrono::nanoseconds(0);
}

int main() {
   wait_for_service(2s);
   return 0;
}

```

Result of compilation
```
TEST.cpp:6:1: note: candidate template ignored: could not match 'long' against 'long long'
wait_for_service(
```

Signed-off-by: Emerson Knapp <eknapp@amazon.com>
Signed-off-by: Steven! Ragnarök <steven@nuclearsandwich.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
* Fix flakey test

Signed-off-by: Pete Baughman <pete.baughman@apex.ai>

* Fix lint and uncrustify issues

Signed-off-by: Pete Baughman <pete.baughman@apex.ai>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
* when call wait for service in an while loop, the event will be make forever and never release
* fix it by: creating it when we need

Signed-off-by: reed-lau <geoliuwei@gmail.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
Signed-off-by: Miaofei <miaofei@amazon.com>
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
The two distinct operations of acquiring and subsequent checking of a
timer have to be protected by one lock_guard against races with other
threads. The releasing of a timer has to be protected by the same lock.

Given this requirement there is no use for a second mutex.

Signed-off-by: Marko Durkovic <marko@ternaris.com>
Copy link

@mm318 mm318 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In allocator_memory_strategy.hpp, you seem to have left out the event Waitables of publishers and subscriptions. This applies to remove_null_handles(), collect_entities(), add_handles_to_wait_set(), and possibly more.

EDIT: My mistake, it only applies to collect_entities().

@emersonknapp
Copy link
Author

emersonknapp commented Mar 25, 2019

@mm318

2:01:48 ➜  rclcpp git:(qos-min) ✗ git diff qos-min upstream/master rclcpp/include/rclcpp/strategies/allocator_memory_strategy.hpp
diff --git a/rclcpp/include/rclcpp/strategies/allocator_memory_strategy.hpp b/rclcpp/include/rclcpp/strategies/allocator_memory_strategy.hpp
index 6c76cad..ca1d2fb 100644
--- a/rclcpp/include/rclcpp/strategies/allocator_memory_strategy.hpp
+++ b/rclcpp/include/rclcpp/strategies/allocator_memory_strategy.hpp
@@ -430,16 +430,6 @@ public:
     return number_of_services;
   }

-  size_t number_of_ready_events() const
-  {
-    size_t number_of_events = 0;
-    for (auto waitable : waitable_handles_) {
-      number_of_events += waitable->get_number_of_ready_events();
-    }
-    return number_of_events;
-  }
-
-
   size_t number_of_ready_clients() const
   {
     size_t number_of_clients = client_handles_.size();

I put all the stuff back to the original, did I delete functionality in the process?

@emersonknapp
Copy link
Author

@mm318 if there's parts that are missing here for the bare minimum qos functionality, maybe this is a useful starting place for you to add just that part back in?

@mm318
Copy link

mm318 commented Mar 25, 2019

@emersonknapp Right, the original is missing functionality that's been added. Sure, I can add them back.

Signed-off-by: Emerson Knapp <eknapp@amazon.com>
Copy link

@nburek nburek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a lot of comments of me trying to figure things out during my first pass of all this. I'll make another pass after I read more of the rcl changes tomorrow and hopefully that should close out a number of my questions.

rclcpp/include/rclcpp/create_subscription.hpp Outdated Show resolved Hide resolved
rclcpp/include/rclcpp/publisher.hpp Outdated Show resolved Hide resolved
rclcpp/include/rclcpp/publisher.hpp Outdated Show resolved Hide resolved
rclcpp/include/rclcpp/publisher.hpp Outdated Show resolved Hide resolved
rclcpp/include/rclcpp/publisher.hpp Show resolved Hide resolved
rclcpp/include/rclcpp/subscription.hpp Outdated Show resolved Hide resolved
rclcpp/include/rclcpp/subscription.hpp Outdated Show resolved Hide resolved
@@ -64,11 +64,19 @@ NodeTopics::create_publisher(

void
NodeTopics::add_publisher(
rclcpp::PublisherBase::SharedPtr publisher)
rclcpp::PublisherBase::SharedPtr publisher,
rclcpp::callback_group::CallbackGroup::SharedPtr callback_group)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, I wonder if it would be better to specify the callback_group for event callbacks as part of the optional class where the callback functions are set instead. What do you think of that idea?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @ross-desmond said CallbackGroup is used often, which is why I didn't fold it into the options class. I'm open to changing it.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm not as concerned about exposing it to the user. I was more thinking that the callback group for publishers really only applies to the event callbacks and that for subscribers you may want to separate your event handlers and your message handler into different callback groups. Maybe I'm over thinking it though so I'm fine leaving this as is to not add more work for now if we don't think it's absolutely the right thing to do.

rclcpp/src/rclcpp/qos_event.cpp Show resolved Hide resolved
size_t
Waitable::get_number_of_ready_events()
{
return 0u;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it needs a //TODO marker

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this implementation, waitables will not have any events, since it was stripped.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave QOSEventHandlerBase/QOSEventHandler as a Waitable, since they are new classes. The Waitable interface will then continue to need a get_number_of_ready_events() member function.

class QOSEvent : public QOSEventBase
{
public:
template<typename InitFuncT, typename HandleT, typename OptionsT, typename EventTypeEnum>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this has reached the complexity of needing to template initialization functions and types that relate to the specific callback then it seems like we should be using polymorphism to extend the base class instead of templating further.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think defining n number of derived classes with a bunch of member functions here can scale with the n number of simple QoS status struct types defined in rmw/types.h

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it needs a bunch of member functions. Each derived class would probably only need a constructor or to implement a virtual initialize function that the constructor calls with the event_handle_, which you already need to create for every status type. I think it's fine to still keep the base class templated so that the destructor and execute functions can be reused, but templating an initialize functions is where it starts to feel like a hack around inheritance to me. Yes it's a couple extra lines of code for every status, but in my opinion it's easier to understand code.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though I generally prefer polymorphism I don't know if it's the best path forward because there's no real commonality between the base events defined in rmw (e.g. a base class doesn't make sense). We're lucky that 3/4 have the same fields, but that won't be the case if we look to QoS types beyond DDS.

Copy link

@nburek nburek Mar 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commonality is that these are all interfaces for handling events. All events come out of the same take function in RMW when an event is ready and they all pass that along to some user provided callback function. The divergence is in the type for the event. If the code is exactly the same and the only difference is in the type then templates are definitely the right way to go. But in this case it's actually using another template parameter to change out the code that's being executed by providing different initialization functions based on the type. To me that seems like a much better case for polymorphism.

From the offline conversation, I still feel like the combination of polymorphism and templating is the cleaner approach, but I'm willing to consider it a stylistic difference because I don't know that there is a strong technical argument for going one way or the other.

---EDIT---
I take that back, the technical reason for using the polymorphism is to set ourselves up for the situation in the future where there is an initialize function that takes a different number of parameters and we can't just rely on a templated function call because it happens to have the same number of parameters. If we don't think that will ever happen then it's a stylistic difference.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling initialization functions that have different number of parameters can still be handled by variadic templates, so I think this is still a stylistic difference.


RCLCPP_PUBLIC
PublisherOptions &
lifespan_callback(const QOSLifespanEventCallbackType & callback)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++ function style comments

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ross-desmond What did you mean by this?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

@ross-desmond ross-desmond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a few comments here. Will get back to it :)

template<
typename MessageT, typename Alloc = std::allocator<void>,
typename MessageT,
typename Alloc = std::allocator<void>,
typename PublisherT = ::rclcpp::Publisher<MessageT, Alloc>>
std::shared_ptr<PublisherT>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reminder: restore pre-existing create_publisher and create_subscriber APIs, and mark as deprecated

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emersonknapp Will you be carving out the PublisherOptions/SubscriptionOptions PR? Can you restore the to-be-deprecated APIs as part of that? I want to leave them out here so that uses of the to-be-deprecated APIs will error out instead of just producing some warnings.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I am working on that today - once that's ready we can rebase this review onto that branch

@emersonknapp emersonknapp changed the base branch from master to qos_reviewed March 26, 2019 20:17
Signed-off-by: vinnamkim <vinnam.kim@gmail.com>
@emersonknapp emersonknapp changed the title Qos min rclcpp QoS implementation Mar 27, 2019
mm318 and others added 3 commits March 27, 2019 13:08
address PR comments

Signed-off-by: Miaofei <miaofei@amazon.com>
* Add parameter-related templates to LifecycleNode

Signed-off-by: vinnamkim <vinnam.kim@gmail.com>

* Update rclcpp_lifecycle/include/rclcpp_lifecycle/lifecycle_node.hpp

Co-Authored-By: vinnamkim <vinnam.kim@gmail.com>

* Update rclcpp_lifecycle/include/rclcpp_lifecycle/lifecycle_node.hpp
@mm318 mm318 merged commit d10432e into qos_reviewed Mar 29, 2019
mm318 pushed a commit that referenced this pull request Apr 2, 2019
* New interfaces for incoming QoS features

Adds new PublisherOptions and SubscriptionOptions classes, with new Publisher and Subscriber constructors
to accept them. Adds the liveliness assertion callbacks that will be needed for the new Liveliness QoS policy

Signed-off-by: Emerson Knapp <eknapp@amazon.com>

* Fix options usage in implementation, and add test to catch that code path.

Signed-off-by: Emerson Knapp <eknapp@amazon.com>

* rclcpp QoS implementation (#2)

* Add interfaces for events in memory_strategy

Signed-off-by: Miaofei <miaofei@amazon.com>

* refactor waitables

Signed-off-by: Miaofei <miaofei@amazon.com>

* Attempt to fix cppcheck (ros2#646)

Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

* add event callbacks to publisher, subscriber, client, service

Signed-off-by: Miaofei <miaofei@amazon.com>

* fix some ros2 build issues

Signed-off-by: Miaofei <miaofei@amazon.com>

* Add a method to the LifecycleNode class to get the logging interface (ros2#652)

There are getters for the other interfaces, but the logging interface
appears to have been overlooked.

Signed-off-by: Michael Jeronimo <michael.jeronimo@intel.com>

* Add Doxyfile for rclcpp_action

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* Add documentation to rclcpp_action

Signed-off-by: Jacob Perron <jacob@openrobotics.org>

* update to use separated action types (ros2#601)

* match renamed action types

* fix action type casting

* rename type/field to use correct term

* rename custom GoalID type to avoid naming collision, update types using unique_identifier_msgs

* remove obsolete comments

* change signature of set_succeeded / set_canceled

* change signature of     on_terminal_state_(uuid_, result_msg);set_succeeded / set_canceled

* change signature of set_aborted

* change signature of publish_feedback

* update another test

Signed-off-by: Miaofei <miaofei@amazon.com>

* update client-facing API

Signed-off-by: Miaofei <miaofei@amazon.com>

* Don't hardcode int64_t for duration type representations (ros2#648)

In LLVM's `libcxx`, `int64_t` doesn't match chrono literals. See example below. To compile, run  `clang++-6.0 -stdlib=libc++ -std=c++14 TEST.cpp`

```
using namespace std::chrono_literals;

template<typename RatioT = std::milli>
bool
wait_for_service(
   std::chrono::duration<int64_t, RatioT> timeout
)
{
   return timeout == std::chrono::nanoseconds(0);
}

int main() {
   wait_for_service(2s);
   return 0;
}

```

Result of compilation
```
TEST.cpp:6:1: note: candidate template ignored: could not match 'long' against 'long long'
wait_for_service(
```

Signed-off-by: Emerson Knapp <eknapp@amazon.com>
Signed-off-by: Steven! Ragnarök <steven@nuclearsandwich.com>

* improve usability of the SubscriptionOptions and PublisherOptions classes

Signed-off-by: Miaofei <miaofei@amazon.com>

* Fix test_time_source test (ros2#639)

* Fix flakey test

Signed-off-by: Pete Baughman <pete.baughman@apex.ai>

* Fix lint and uncrustify issues

Signed-off-by: Pete Baughman <pete.baughman@apex.ai>

* fix lint errors

Signed-off-by: Miaofei <miaofei@amazon.com>

* apply uncrustify

Signed-off-by: Miaofei <miaofei@amazon.com>

* add section about DCO to CONTRIBUTING.md

* update for rcl API changes

Signed-off-by: Miaofei <miaofei@amazon.com>

* Fix lint and build warnings and API inconsistency

Signed-off-by: Emerson Knapp <eknapp@amazon.com>

* Avoid race that triggers timer too often (ros2#621)

The two distinct operations of acquiring and subsequent checking of a
timer have to be protected by one lock_guard against races with other
threads. The releasing of a timer has to be protected by the same lock.

Given this requirement there is no use for a second mutex.

Signed-off-by: Marko Durkovic <marko@ternaris.com>

* Back out Waitable and GraphEvent-related changes

Signed-off-by: Emerson Knapp <eknapp@amazon.com>

* add publisher and subscription events to AllocatorMemoryStrategy

* Add stub API for assert_liveliness

* Fix use_sim_time issue on LifeCycleNode (ros2#651)

Signed-off-by: vinnamkim <vinnam.kim@gmail.com>

* revert changes to client and services
address PR comments

Signed-off-by: Miaofei <miaofei@amazon.com>

* Add parameter-related templates to LifecycleNode (ros2#645)

* Add parameter-related templates to LifecycleNode

Signed-off-by: vinnamkim <vinnam.kim@gmail.com>

* Update rclcpp_lifecycle/include/rclcpp_lifecycle/lifecycle_node.hpp

Co-Authored-By: vinnamkim <vinnam.kim@gmail.com>

* Update rclcpp_lifecycle/include/rclcpp_lifecycle/lifecycle_node.hpp

* update API calls into rcl

* fix linter errors in rclcpp_lifecycle (ros2#672)

Signed-off-by: Karsten Knese <karsten@openrobotics.org>

* Update to use the new interface definitions

Signed-off-by: Emerson Knapp <eknapp@amazon.com>

* Remove duplicate event_handlers_
thomas-moulard pushed a commit that referenced this pull request May 15, 2019
When undeclaring a parameter, the current implementation
acccesses already freed memory. This commit contains the
minimal change to solve this isue.

Before this fix:

Running main() from ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest_main.cc
Note: Google Test filter = TestNode.set_parameter_undeclared_parameters_not_allowed
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from TestNode
[ RUN      ] TestNode.set_parameter_undeclared_parameters_not_allowed
=================================================================
==14634==ERROR: AddressSanitizer: heap-use-after-free on address 0x614000008070 at pc 0x7f90d5eb2733 bp 0x7ffc79e38d00 sp 0x7ffc79e384a8
READ of size 12 at 0x614000008070 thread T0
    #0 0x7f90d5eb2732  (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x79732)
    #1 0x555823664ce8 in void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag) (/home/ANT.AMAZON.COM/tmoulard/ros2_ws/build-asan/rclcpp/test_node+0xface8)
    #2 0x7f90d57c70d3 in rclcpp::Parameter::Parameter(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rclcpp::ParameterValue const&) ../../src/ros2/rclcpp/rclcpp/src/rclcpp/parameter.cpp:49
    #3 0x7f90d577fbe6 in rclcpp::node_interfaces::NodeParameters::set_parameters_atomically(std::vector<rclcpp::Parameter, std::allocator<rclcpp::Parameter> > const&) ../../src/ros2/rclcpp/rclcpp/src/rclcpp/node_interfaces/node_parameters.cpp:499
    #4 0x7f90d573d8b9 in rclcpp::Node::set_parameters_atomically(std::vector<rclcpp::Parameter, std::allocator<rclcpp::Parameter> > const&) ../../src/ros2/rclcpp/rclcpp/src/rclcpp/node.cpp:271
    #5 0x7f90d573d4ac in rclcpp::Node::set_parameter(rclcpp::Parameter const&) ../../src/ros2/rclcpp/rclcpp/src/rclcpp/node.cpp:259
    #6 0x5558235e1c0d in TestNode_set_parameter_undeclared_parameters_not_allowed_Test::TestBody() ../../src/ros2/rclcpp/rclcpp/test/test_node.cpp:694
    #7 0x5558236fc2cf in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2447
    #8 0x5558236eed3b in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2483
    ros2#9 0x55582369c94b in testing::Test::Run() ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2522
    ros2#10 0x55582369dd76 in testing::TestInfo::Run() ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2703
    ros2#11 0x55582369e91a in testing::TestCase::Run() ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2825
    ros2#12 0x5558236b9a2b in testing::internal::UnitTestImpl::RunAllTests() ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:5216
    ros2#13 0x5558236fed74 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2447
    ros2#14 0x5558236f1004 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2483
    ros2#15 0x5558236b67bf in testing::UnitTest::Run() ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:4824
    ros2#16 0x555823689d0e in RUN_ALL_TESTS() ../../../install-asan/gtest_vendor/src/gtest_vendor/include/gtest/gtest.h:2370
    ros2#17 0x555823689c54 in main ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest_main.cc:36
    ros2#18 0x7f90d4768b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    ros2#19 0x5558235b07d9 in _start (/home/ANT.AMAZON.COM/tmoulard/ros2_ws/build-asan/rclcpp/test_node+0x467d9)

0x614000008070 is located 48 bytes inside of 416-byte region [0x614000008040,0x6140000081e0)
freed by thread T0 here:
    #0 0x7f90d5f1a2d0 in operator delete(void*) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe12d0)
    #1 0x7f90d57abd0f in __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> > >::deallocate(std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> >*, unsigned long) /usr/include/c++/7/ext/new_allocator.h:125
    #2 0x7f90d57a8908 in std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> > > >::deallocate(std::allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> > >&, std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> >*, unsigned long) /usr/include/c++/7/bits/alloc_traits.h:462
    #3 0x7f90d57a133c in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> > >::_M_put_node(std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> >*) /usr/include/c++/7/bits/stl_tree.h:592
    #4 0x7f90d5796abd in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> > >::_M_drop_node(std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> >*) /usr/include/c++/7/bits/stl_tree.h:659
    #5 0x7f90d579d3d4 in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> > >::_M_erase_aux(std::_Rb_tree_const_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> >) /usr/include/c++/7/bits/stl_tree.h:2477
    #6 0x7f90d5792213 in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> > >::erase[abi:cxx11](std::_Rb_tree_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> >) /usr/include/c++/7/bits/stl_tree.h:1125
    #7 0x7f90d5789f68 in std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, rclcpp::node_interfaces::ParameterInfo, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> > >::erase[abi:cxx11](std::_Rb_tree_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> >) (/home/ANT.AMAZON.COM/tmoulard/ros2_ws/install-asan/rclcpp/lib/librclcpp.so+0x491f68)
    #8 0x7f90d577fb2a in rclcpp::node_interfaces::NodeParameters::set_parameters_atomically(std::vector<rclcpp::Parameter, std::allocator<rclcpp::Parameter> > const&) ../../src/ros2/rclcpp/rclcpp/src/rclcpp/node_interfaces/node_parameters.cpp:497
    ros2#9 0x7f90d573d8b9 in rclcpp::Node::set_parameters_atomically(std::vector<rclcpp::Parameter, std::allocator<rclcpp::Parameter> > const&) ../../src/ros2/rclcpp/rclcpp/src/rclcpp/node.cpp:271
    ros2#10 0x7f90d573d4ac in rclcpp::Node::set_parameter(rclcpp::Parameter const&) ../../src/ros2/rclcpp/rclcpp/src/rclcpp/node.cpp:259
    ros2#11 0x5558235e1c0d in TestNode_set_parameter_undeclared_parameters_not_allowed_Test::TestBody() ../../src/ros2/rclcpp/rclcpp/test/test_node.cpp:694
    ros2#12 0x5558236fc2cf in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2447
    ros2#13 0x5558236eed3b in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2483
    ros2#14 0x55582369c94b in testing::Test::Run() ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2522
    ros2#15 0x55582369dd76 in testing::TestInfo::Run() ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2703
    ros2#16 0x55582369e91a in testing::TestCase::Run() ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2825
    ros2#17 0x5558236b9a2b in testing::internal::UnitTestImpl::RunAllTests() ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:5216
    ros2#18 0x5558236fed74 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2447
    ros2#19 0x5558236f1004 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2483
    ros2#20 0x5558236b67bf in testing::UnitTest::Run() ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:4824
    ros2#21 0x555823689d0e in RUN_ALL_TESTS() ../../../install-asan/gtest_vendor/src/gtest_vendor/include/gtest/gtest.h:2370
    ros2#22 0x555823689c54 in main ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest_main.cc:36
    ros2#23 0x7f90d4768b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

previously allocated by thread T0 here:
    #0 0x7f90d5f19458 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0458)
    #1 0x7f90d57aceba in __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> > >::allocate(unsigned long, void const*) /usr/include/c++/7/ext/new_allocator.h:111
    #2 0x7f90d57a9c4c in std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> > > >::allocate(std::allocator<std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> > >&, unsigned long) (/home/ANT.AMAZON.COM/tmoulard/ros2_ws/install-asan/rclcpp/lib/librclcpp.so+0x4b1c4c)
    #3 0x7f90d57a3f6e in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> > >::_M_get_node() (/home/ANT.AMAZON.COM/tmoulard/ros2_ws/install-asan/rclcpp/lib/librclcpp.so+0x4abf6e)
    #4 0x7f90d5799770 in std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> >* std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> > >::_M_create_node<std::piecewise_construct_t const&, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>, std::tuple<> >(std::piecewise_construct_t const&, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>&&, std::tuple<>&&) (/home/ANT.AMAZON.COM/tmoulard/ros2_ws/install-asan/rclcpp/lib/librclcpp.so+0x4a1770)
    #5 0x7f90d578f382 in std::_Rb_tree_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> > std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> > >::_M_emplace_hint_unique<std::piecewise_construct_t const&, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>, std::tuple<> >(std::_Rb_tree_const_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> >, std::piecewise_construct_t const&, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>&&, std::tuple<>&&) /usr/include/c++/7/bits/stl_tree.h:2398
    #6 0x7f90d5788eba in std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, rclcpp::node_interfaces::ParameterInfo, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> > >::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /usr/include/c++/7/bits/stl_map.h:493
    #7 0x7f90d577bc88 in __declare_parameter_common(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rclcpp::ParameterValue const&, rcl_interfaces::msg::ParameterDescriptor_<std::allocator<void> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, rclcpp::node_interfaces::ParameterInfo, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::node_interfaces::ParameterInfo> > >&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, rclcpp::ParameterValue, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, rclcpp::ParameterValue> > > const&, std::function<rcl_interfaces::msg::SetParametersResult_<std::allocator<void> > (std::vector<rclcpp::Parameter, std::allocator<rclcpp::Parameter> > const&)>, rcl_interfaces::msg::ParameterEvent_<std::allocator<void> >*) ../../src/ros2/rclcpp/rclcpp/src/rclcpp/node_interfaces/node_parameters.cpp:250
    #8 0x7f90d577c4f7 in rclcpp::node_interfaces::NodeParameters::declare_parameter(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rclcpp::ParameterValue const&, rcl_interfaces::msg::ParameterDescriptor_<std::allocator<void> > const&) ../../src/ros2/rclcpp/rclcpp/src/rclcpp/node_interfaces/node_parameters.cpp:287
    ros2#9 0x7f90d573d1ec in rclcpp::Node::declare_parameter(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rclcpp::ParameterValue const&, rcl_interfaces::msg::ParameterDescriptor_<std::allocator<void> > const&) ../../src/ros2/rclcpp/rclcpp/src/rclcpp/node.cpp:241
    ros2#10 0x555823645b6b in auto rclcpp::Node::declare_parameter<int>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int const&, rcl_interfaces::msg::ParameterDescriptor_<std::allocator<void> > const&) (/home/ANT.AMAZON.COM/tmoulard/ros2_ws/build-asan/rclcpp/test_node+0xdbb6b)
    ros2#11 0x5558235e14ee in TestNode_set_parameter_undeclared_parameters_not_allowed_Test::TestBody() ../../src/ros2/rclcpp/rclcpp/test/test_node.cpp:689
    ros2#12 0x5558236fc2cf in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2447
    ros2#13 0x5558236eed3b in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2483
    ros2#14 0x55582369c94b in testing::Test::Run() ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2522
    ros2#15 0x55582369dd76 in testing::TestInfo::Run() ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2703
    ros2#16 0x55582369e91a in testing::TestCase::Run() ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2825
    ros2#17 0x5558236b9a2b in testing::internal::UnitTestImpl::RunAllTests() ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:5216
    ros2#18 0x5558236fed74 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2447
    ros2#19 0x5558236f1004 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2483
    ros2#20 0x5558236b67bf in testing::UnitTest::Run() ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:4824
    ros2#21 0x555823689d0e in RUN_ALL_TESTS() ../../../install-asan/gtest_vendor/src/gtest_vendor/include/gtest/gtest.h:2370
    ros2#22 0x555823689c54 in main ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest_main.cc:36
    ros2#23 0x7f90d4768b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

SUMMARY: AddressSanitizer: heap-use-after-free (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x79732)
Shadow bytes around the buggy address:
  0x0c287fff8fb0: 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa
  0x0c287fff8fc0: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x0c287fff8fd0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c287fff8fe0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c287fff8ff0: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa
=>0x0c287fff9000: fa fa fa fa fa fa fa fa fd fd fd fd fd fd[fd]fd
  0x0c287fff9010: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c287fff9020: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c287fff9030: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa
  0x0c287fff9040: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c287fff9050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==14634==ABORTING

After this fix:

Running main() from ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest_main.cc
Note: Google Test filter = TestNode.set_parameter_undeclared_parameters_not_allowed
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from TestNode
[ RUN      ] TestNode.set_parameter_undeclared_parameters_not_allowed
[       OK ] TestNode.set_parameter_undeclared_parameters_not_allowed (51 ms)
[----------] 1 test from TestNode (51 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (51 ms total)
[  PASSED  ] 1 test.

=================================================================
==8511==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f49af480458 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xe0458)
    #1 0x7f49aecb6b21 in rclcpp::NodeOptions::get_rcl_node_options() const ../../src/ros2/rclcpp/rclcpp/src/rclcpp/node_options.cpp:84
    #2 0x7f49aeca1e63 in rclcpp::Node::Node(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rclcpp::NodeOptions const&) ../../src/ros2/rclcpp/rclcpp/src/rclcpp/node.cpp:115
    #3 0x7f49aeca1a34 in rclcpp::Node::Node(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rclcpp::NodeOptions const&) ../../src/ros2/rclcpp/rclcpp/src/rclcpp/node.cpp:103
    #4 0x55ee8e2e4473 in void __gnu_cxx::new_allocator<rclcpp::Node>::construct<rclcpp::Node, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, rclcpp::NodeOptions&>(rclcpp::Node*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, rclcpp::NodeOptions&) (/home/ANT.AMAZON.COM/tmoulard/ros2_ws/build-asan/rclcpp/test_no
de+0x10e473)
    #5 0x55ee8e2de58f in void std::allocator_traits<std::allocator<rclcpp::Node> >::construct<rclcpp::Node, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, rclcpp::NodeOptions&>(std::allocator<rclcpp::Node>&, rclcpp::Node*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, rclcpp::NodeOptions&) (/home/ANT.AMAZON.C
OM/tmoulard/ros2_ws/build-asan/rclcpp/test_node+0x10858f)
    #6 0x55ee8e2da516 in std::_Sp_counted_ptr_inplace<rclcpp::Node, std::allocator<rclcpp::Node>, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, rclcpp::NodeOptions&>(std::allocator<rclcpp::Node>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, rclcpp::NodeOp
tions&) (/home/ANT.AMAZON.COM/tmoulard/ros2_ws/build-asan/rclcpp/test_node+0x104516)
    #7 0x55ee8e2d25b2 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<rclcpp::Node, std::allocator<rclcpp::Node>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, rclcpp::NodeOptions&>(std::_Sp_make_shared_tag, rclcpp::Node*, std::allocator<rclcpp::Node> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::alloc
ator<char> >&&, rclcpp::NodeOptions&) (/home/ANT.AMAZON.COM/tmoulard/ros2_ws/build-asan/rclcpp/test_node+0xfc5b2)
    #8 0x55ee8e2c84da in std::__shared_ptr<rclcpp::Node, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<rclcpp::Node>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, rclcpp::NodeOptions&>(std::_Sp_make_shared_tag, std::allocator<rclcpp::Node> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, rcl
cpp::NodeOptions&) (/home/ANT.AMAZON.COM/tmoulard/ros2_ws/build-asan/rclcpp/test_node+0xf24da)
    ros2#9 0x55ee8e2bfd60 in std::shared_ptr<rclcpp::Node>::shared_ptr<std::allocator<rclcpp::Node>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, rclcpp::NodeOptions&>(std::_Sp_make_shared_tag, std::allocator<rclcpp::Node> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, rclcpp::NodeOptions&) (/home/ANT.AM
AZON.COM/tmoulard/ros2_ws/build-asan/rclcpp/test_node+0xe9d60)
    ros2#10 0x55ee8e2b6b18 in std::shared_ptr<rclcpp::Node> std::allocate_shared<rclcpp::Node, std::allocator<rclcpp::Node>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, rclcpp::NodeOptions&>(std::allocator<rclcpp::Node> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, rclcpp::NodeOptions&) (/home/ANT.AMAZ
ON.COM/tmoulard/ros2_ws/build-asan/rclcpp/test_node+0xe0b18)
    ros2#11 0x55ee8e2ad89e in std::shared_ptr<rclcpp::Node> std::make_shared<rclcpp::Node, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, rclcpp::NodeOptions&>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&, rclcpp::NodeOptions&) (/home/ANT.AMAZON.COM/tmoulard/ros2_ws/build-asan/rclcpp/test_node+0xd789e)
    ros2#12 0x55ee8e245438 in TestNode_set_parameter_undeclared_parameters_not_allowed_Test::TestBody() ../../src/ros2/rclcpp/rclcpp/test/test_node.cpp:607
    ros2#13 0x55ee8e35d111 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2447
    ros2#14 0x55ee8e34fb7d in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2483
    ros2#15 0x55ee8e2fd78d in testing::Test::Run() ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2522
    ros2#16 0x55ee8e2febb8 in testing::TestInfo::Run() ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2703
    ros2#17 0x55ee8e2ff75c in testing::TestCase::Run() ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2825
    ros2#18 0x55ee8e31a86d in testing::internal::UnitTestImpl::RunAllTests() ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:5216
    ros2#19 0x55ee8e35fbb6 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2447
    ros2#20 0x55ee8e351e46 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:2483
    ros2#21 0x55ee8e317601 in testing::UnitTest::Run() ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest.cc:4824
    ros2#22 0x55ee8e2eab50 in RUN_ALL_TESTS() ../../../install-asan/gtest_vendor/src/gtest_vendor/include/gtest/gtest.h:2370
    ros2#23 0x55ee8e2eaa96 in main ../../../install-asan/gtest_vendor/src/gtest_vendor/src/gtest_main.cc:36
    ros2#24 0x7f49adccfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

SUMMARY: AddressSanitizer: 64 byte(s) leaked in 1 allocation(s).

Note: after this fix, get_rcl_node_options() still leak. This is a
problem independent from this issue and will be solved independently.

Signed-off-by: Thomas Moulard <tmoulard@amazon.com>
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

Successfully merging this pull request may close these issues.