This repository was archived by the owner on Jun 21, 2023. It is now read-only.
Ensure compliant matched pub/sub count API.#451
Merged
Conversation
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
clalancette
reviewed
Aug 20, 2020
Comment on lines
-347
to
-354
| if (!info) { | ||
| RMW_SET_ERROR_MSG("publisher internal data is invalid"); | ||
| return RMW_RET_ERROR; | ||
| } | ||
| if (!info->listener_) { | ||
| RMW_SET_ERROR_MSG("publisher internal listener is invalid"); | ||
| return RMW_RET_ERROR; | ||
| } |
Contributor
There was a problem hiding this comment.
Why are we removing these checks?
(sorry if this is redundant with what we have talked about before)
Author
There was a problem hiding this comment.
See ros2/rmw_fastrtps#408 (comment). I can't find the discussion about not duplicating checks across rmw_fastrtps_shared_cpp and the actual Fast-RTPS based RMW implementation.
But long story short:
- There's no point in checking arguments for nullity twice -- once in
rmw_fastrtps(_dynamic)_cpp, once inrmw_fastrtps_shared_cpp. - There's no point in guarding ourselves against those particular UB cases. If an
rmw_fastrtps(_dynamic)_cpppublisher (or subscription) hasnullptrinternals (or FWIW, any non-valid pointers), then (a) the user is using the structure in an unintended way (and the program is logically incorrect), (b) the implementation is logically incorrect, or (c) memory corruption ensued.
Contributor
There was a problem hiding this comment.
Ah right, thanks for that discussion. Sorry, long day yesterday :).
clalancette
approved these changes
Aug 21, 2020
Comment on lines
-347
to
-354
| if (!info) { | ||
| RMW_SET_ERROR_MSG("publisher internal data is invalid"); | ||
| return RMW_RET_ERROR; | ||
| } | ||
| if (!info->listener_) { | ||
| RMW_SET_ERROR_MSG("publisher internal listener is invalid"); | ||
| return RMW_RET_ERROR; | ||
| } |
Contributor
There was a problem hiding this comment.
Ah right, thanks for that discussion. Sorry, long day yesterday :).
ivanpauno
approved these changes
Aug 21, 2020
Author
ahcorde
pushed a commit
that referenced
this pull request
Oct 8, 2020
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
ahcorde
pushed a commit
that referenced
this pull request
Oct 15, 2020
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Connected to ros2/rmw#262.