Skip to content
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

[16038] Fix SegFault in delete_contained_entities() when compiled with statistics #3048

Merged
merged 7 commits into from
Nov 3, 2022

Conversation

Mario-DL
Copy link
Member

Description

If compiled with statistics, when a participant calls delete_contained_entities() followed by a call to Factory::delete_participant(), a SegFault was produced.

Proposed solution changes:
Making ParticipantImpl delete_contained_entities() virtual so that the statistics participant can set the builtin_publishers to nullptr.

@Mergifyio backport 2.7.x 2.6.x 2.3.x

Contributor Checklist

  • Commit messages follow the project guidelines.
  • The code follows the style guidelines of this project.
  • Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added.
  • Any new/modified methods have been properly documented using Doxygen.
  • Fast DDS test suite has been run locally. amd64
  • Changes are ABI compatible.
  • Changes are API compatible.
  • N/A Documentation builds and tests pass locally.
  • N/A New feature has been added to the versions.md file (if applicable).
  • N/A New feature has been documented/Current behavior is correctly described in the documentation.

Reviewer Checklist

  • Check contributor checklist is correct.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
…simplified

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Copy link
Contributor

@jparisu jparisu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: Notice that this feature is not tested in actual tests due to not compile with STATISTICS.
CI must be updated in order to check it, or add a test where in CMakeLists it is manually specified the option FASTDDS_STATISTICS=ON.

NOTE: Can statistics entities be deleted as normal entities? There is a specific method to delete them eprosima::fastdds::statistics::dds::DomainParticipantImpl::delete_statistics_builtin_entities() and eprosima::fastdds::statistics::dds::DomainParticipantImpl::disable_statistics_datawriter(const std::string &topic_name), maybe is not so trivial to remove them as any other entity.

ADDITION: Check in core/src/fastdds/src/cpp/fastdds/domain/DomainParticipantFactory.cpp (135) eprosima::fastdds::dds::DomainParticipantFactory::delete_participant(eprosima::fastdds::dds::DomainParticipant *part) that statistical entities are being deleted before checking if deletion could be done.

@jparisu
Copy link
Contributor

jparisu commented Oct 27, 2022

  • Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added.

This is not totally correct 🙄

…e to statistics tests

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
@rsanchez15
Copy link
Contributor

@richiprosima please test this

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
Copy link
Contributor

@jparisu jparisu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rsanchez15
Copy link
Contributor

@richiprosima please test this

Copy link
Contributor

@JLBuenoLopez JLBuenoLopez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MiguelCompany MiguelCompany merged commit b0d0e9a into master Nov 3, 2022
@MiguelCompany MiguelCompany deleted the hotfix/14723 branch November 3, 2022 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants