* Reset RMWCount when DEALLOC rmw storage of wait set
It is safe to reset RMWCount when free rmw storage of wait set
Signed-off-by: jwang <jing.j.wang@intel.com>
* setting RMWCount to 0 only when RMWStorage is set to NULL
Signed-off-by: jwang <jing.j.wang@intel.com>
It is dangerous to keep type index float when do SET_RESIZE. It is
possible that index greater than new size. Thus, set index to 0.
Signed-off-by: jwang <jing.j.wang@intel.com>
* Invalid memory access for NULL dereference
rcl_lifecycle_get_state may return NULL
transition->goal is checked for NULL but no return
while it's true and this may result the follow-up
NULL dereference
Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
* Avoid crash while NULL returned from rcl_service_get_options()
Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
* tweak error string and null check for current_state
Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
* If RMW_IMPLEMENTATION is set, it must match
rmw_get_implementation_identifier
* Refactor so easier to read
* Add tests
* Use strdup from rcutils
* Don't assume retrieved rmw id is not null
* Add comment clarifying why a check is needed
* Fix long line in test
* Remove test that wouldn't work with multiple rmw impls
* warning -> error
* Check if test exists before setting properties
* Copyright year
* only build executable once
* hopefully fix tests for windows
* Check return code of rcl_init
* Remove another test that wasn't supposed to pass w/ multiple rmw impls
We aren't explicitly setting RMW_IMPLEMENTATION in the cmake for this test (unlike the others)
* Skip tests on windows because of https://github.com/ros2/launch/issues/66
* allocate memory for rmw types and not rcl types in waitset RMW storage
* zero initialize memory on resize and clear
* add missing void * cast to make windows happy
* set mem after checking successful alloc and use right type for rmw storage
* another instance of cast to (rmw_ ## Type ## _t *) instead of (void *)
* use ROS_PACKAGE_NAME in debug msgs
* rcl_lifecycle too
* Swap unnamed macros to named
* Remove semicolon
* Add debug logging
* Timer debug logging
* Wait debug
* A bit less wait debug...
* Clearer time output
* Remove the wait sublogger
* Use conditional logging instead of the else{}
* Add 'X finalized' msg
* Add send_response logging
* Remove extra semicolons
* Add publish/take messages
* [style nitpick] formatted variables on the next line
* * memory leak issues
address those memory leak issues with the API
rcutils_set_formatted_error which is defined
in rcutils
Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
* * Address those memory leak issues with new MACRO
add macro RCL_SET_ERROR_MSG_WITH_FORMAT_STRING which
is equals RCUTILS_SET_ERROR_MSG_WITH_FORMAT_STRING and
fix the memory leak issues with it
Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
* address uncrustify grumble
Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
* expand rcl_node_is_valid with allocator to standarize the node check across RCL
Current RCL use very different way for node check in different components. Actually,
node.c already provide a standard way - rcl_node_is_valid. However, it just use
internal allocator, but some context has external allocator. The commit expand
rcl_node_is_valid with one more parameter for allocator. It can be used in all cases.
Signed-off-by: jwang <jing.j.wang@intel.com>
* Add allocator check in rcl_node_is_valid
* Separate argument checks from the concept of what makes a node invalid
* clarify allocator only used for error messages; default if NULL
* shorten parameter description
* * out-of-scope memory use and memory leak issue
temp going out of scope leaks the storage it points to
resource leak from local_namespace_
Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
* exclude the memory free when the namespace given is null
Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
* started implementing the publisher test
* Working on tests for services
* Add basic subscription test
* Add check for nullptr as service impl.
* Add client test
* Undid accidental removal of null topic test
* Made subscription test consistent with the others
* Addressed comments from @mikaelarguedas, as well as made things more uniform.
* Replace EXPECT_EQ(-, false) with EXPECT_FALSE(-) (and analogous), as well as fixed typo in comment.
* Added check for init's return value.
* Added RCL_PUBLIC to export dll targets.
* nit: homogenize docs
* dont return timeout errcode if we didnt hit user specified timeout
* update axisting test accordingly
* add timer test
* Revert "dont return timeout errcode if we didnt hit user specified timeout"
This reverts commit f44a93b8528e87ce46594af0d1184c116ade0cb4.
* alternative fix to not return timeout when timer is ready
this also fixes a bug where the wait would always return when all the
timers were canceled
fixes rclcpp#319
* fixups
* more tests
* another one just for fun
* remove new tests
* clearer variable name
* update comment