-
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
Do not reuse cache change if sample does not fit. [7609] #1013
Do not reuse cache change if sample does not fit. [7609] #1013
Conversation
This seems to be a regression of #819. Reproducible case (not on every run but certainly a few times within 10 tries):
I added this output in
Valgrind shows memory problems:
I can confirm that the patch fixes the segfault / memory corruption for me. I suggest to simplify the patch to just this one line change (keeping the order of the
|
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
ebc0602
to
e18db02
Compare
Patch simplified as per @dirk-thomas suggestion. Thanks for all the additional evidence! |
@hidmic @dirk-thomas Thanks for the catch and the patch. The change is perfect! But, before merging, it would be better to have a regression test in place. We will do it first thing today |
Test added! |
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.
LGTM
This is a port of #1013 from 1.9.x
This is a port of #1013 from 1.9.x
Precisely what the title says. I have the impression this was the intent of the original author, but I may be wrong. Without this patch, I can reliably get
SerializedPayload_t
instances wherelength > max_size
, though in most cases by a small margin (which would explain why this could've been missed). However, larger messages would often result in segfaults.Note: I'm targeting
1.9.x
because that's the Fast-RTPS version ROS 2 uses. It could be easily ported forward.