[#24620] Fixed segfault in 'RepeaterDataFilter.cpp' when forwarding dispose/unregister samples with a null check#186
Merged
Merged
Conversation
…ispose/unregister samples Signed-off-by: danipiza <dpizarrogallego@gmail.com>
Signed-off-by: danipiza <dpizarrogallego@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #186 +/- ##
==========================================
+ Coverage 36.20% 36.43% +0.23%
==========================================
Files 174 157 -17
Lines 12381 7533 -4848
Branches 5655 2992 -2663
==========================================
- Hits 4483 2745 -1738
+ Misses 5034 3334 -1700
+ Partials 2864 1454 -1410 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: danipiza <dpizarrogallego@gmail.com>
zesk1999
approved these changes
Jun 18, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
A repeater participant of the DDS (xml) kind crashes with a SIGSEGV when it forwards a NOT_ALIVE_DISPOSED /
NOT_ALIVE_UNREGISTERED sample on a topic that has matched readers.
dds::RepeaterDataFilter::evaluatereads the message origin from sample_info.user_write_data and dereferences itunconditionally:
auto write_data = std::static_pointer_cast(sample_info.user_write_data);
bool is_relevant = write_data->last_writer_guid_prefix != reader_guid.guidPrefix; // <-- null deref
Solution
Guard against a null write_data in dds::RepeaterDataFilter::evaluate. When the origin information is absent
(dispose/unregister), the sample's origin participant is unknown, so it cannot be filtered out by origin; it is
considered relevant and let through
Test
It can be tested with ShapesDemo in 3 terminals. Or the DDS-Router regression tests
ShapesDemo (3 terminals)
repro_repeater.yamlDDS-Router
colcon build --packages-select ddspipe_participants ddsrouter_core --cmake-args -DBUILD_TESTS=ON --allow-overriding ddspipe_participants ddsrouter_core colcon test --packages-select ddsrouter_core --ctest-args -R DDSTestRepeaterDisposeKey --event-handlers console_direct+Error