Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Problems when creating/destructing participant in others static objects [8987] #937

Closed
ivanpauno opened this issue Jan 2, 2020 · 1 comment

Comments

@ivanpauno
Copy link

In ros2, we're migrating from creating one Participant per Node to one per Context (see ros2/rmw_fastrtps#312).
The default context has for example static storage.
The destructor of that object, ends up calling: https://github.com/eProsima/Fast-RTPS/blob/a181a67b94e88839755e83a52ec72af4c9145ac6/include/fastrtps/Domain.h#L145
As the Domain object is a singleton, and destruction order of static objects in different transitional units can't be ensured, it sometimes crash (because it's used an already destructed Domain).

I didn't try, but the same bug can happen with https://github.com/eProsima/Fast-RTPS/blob/master/include/fastdds/dds/domain/DomainParticipantFactory.hpp.
And AFAIK, the same problem is common in other DDS vendors.

Expected Behavior

Have a way to construct/destroy Participants in objects with static storage.

Current Behavior

It's not possible.

Steps to Reproduce

I don't have a simple repro ....
I can share detailed steps if needed.

System information

  • Fast-RTPS version: 1.9.x
  • OS: Ubuntu 18.04
  • Network interfaces:
  • ROS2: Eloquent

Additional context

The only solution that I have in mind, is to provide a way to the user to create a Domain (or DomainParticipantFactory). In that way, the object can be stored in another transitional unit and destruction order can be ensured. The solution to the commented ROS 2 problem is still complicated, but possible if that's available.
We're also considering to stop having a default context, but I just want to rise awareness to the issue.

@MiguelCompany MiguelCompany changed the title Problems when creating/destructing participant in others static objects Problems when creating/destructing participant in others static objects [8987] Jul 30, 2020
@JLBuenoLopez
Copy link
Contributor

I am going to move this issue to the Ideas discussion forum. According to the CONTRIBUTING guidelines feature requests and improvements are discussed in that forum.

@eProsima eProsima locked and limited conversation to collaborators Mar 1, 2022
@JLBuenoLopez JLBuenoLopez converted this issue into discussion #2537 Mar 1, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants