-
Notifications
You must be signed in to change notification settings - Fork 791
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
[20227] Prevent index overflow and correctly assert the end iterator in DataSharing #4321
Conversation
0be97cb
to
88c548e
Compare
@richiprosima please test linux |
@richiprosima please test mac |
@richiprosima please test discovery_server |
@richiprosima please test mac |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT not requiring CI
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
9c0139e
to
85a6457
Compare
@richiprosima please test this |
@richiprosima please test mac |
7 similar comments
@richiprosima please test mac |
@richiprosima please test mac |
@richiprosima please test mac |
@richiprosima please test mac |
@richiprosima please test mac |
@richiprosima please test mac |
@richiprosima please test mac |
CI issues unrelated to the PR. Ready to merge! |
@Mergifyio backport 2.12.x 2.10.x 2.6.x |
✅ Backports have been created
|
…haring (#4321) * Refs #20227: Add DDS communication test Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Prevent history index to overflow history size Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Correctly assert the current end Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Linter Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Initialize test timeout argument properly Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Rev suggestion Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> --------- Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> (cherry picked from commit 66de89e)
…haring (#4321) * Refs #20227: Add DDS communication test Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Prevent history index to overflow history size Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Correctly assert the current end Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Linter Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Initialize test timeout argument properly Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Rev suggestion Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> --------- Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> (cherry picked from commit 66de89e)
…haring (#4321) (#4403) * Refs #20227: Add DDS communication test Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Prevent history index to overflow history size Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Correctly assert the current end Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Linter Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Initialize test timeout argument properly Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Rev suggestion Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> --------- Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> (cherry picked from commit 66de89e) Co-authored-by: Mario Domínguez López <116071334+Mario-DL@users.noreply.github.com>
…haring (#4321) * Refs #20227: Add DDS communication test Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Prevent history index to overflow history size Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Correctly assert the current end Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Linter Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Initialize test timeout argument properly Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Rev suggestion Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> --------- Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
…haring (#4321) (#4404) * Refs #20227: Add DDS communication test * Refs #20227: Prevent history index to overflow history size * Refs #20227: Correctly assert the current end * Refs #20227: Linter * Refs #20227: Initialize test timeout argument properly * Refs #20227: Rev suggestion --------- Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> Co-authored-by: Mario Domínguez López <116071334+Mario-DL@users.noreply.github.com>
…haring (#4321) (#4402) * Refs #20227: Add DDS communication test Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Prevent history index to overflow history size Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Correctly assert the current end Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Linter Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Initialize test timeout argument properly Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> * Refs #20227: Rev suggestion Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> --------- Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> (cherry picked from commit 66de89e) Co-authored-by: Mario Domínguez López <116071334+Mario-DL@users.noreply.github.com>
Description
When a DataSharing compatible publisher and subscriber were launched at high frequency (publication interval set to
0
), it happened two different issues:notified_end
of the segment iterator was being updated before being actually checked, making anassert()
compare two different versions of this iterator.next_payload_
counter could occur.Apart from the included test, in order to reproduce the first issue it is enough to launch a
BasicConfigurationExample
with abounded
type and no sleep betweenwrites()
. Launching, killing and relaunching the subscriber should trigger theassertion
.For reproducing the second issue, launch the subscriber first and then the publisher, a
SIGSEV
will be triggered in20 seconds
or so.This PR includes two fixes that mitigate the problem.
The idea of the test is that if in 20 seconds we have not crashed by some of the above issues, we give the test as passed.
Important note It was noticed that enabling all the verbosity messages in the test, makes the test not work properly under
colcon
since thetimeout
notification of theSubscriberModule.cpp
condition variable is never fired. It seems that the test stresses the cpu and the timeout notification is lost. However, if thepython3
is directly invoked from a terminal (outside colcon), then there is no problem even if all the logs are enabled.@Mergifyio backport 2.12.x 2.11.x 2.10.x 2.6.x
Contributor Checklist
versions.md
file (if applicable).Reviewer Checklist