This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Problems when creating/destructing participant in others static objects [8987] #937
Labels
You can continue the conversation there. Go to discussion →
In ros2, we're migrating from creating one
Participant
perNode
to one perContext
(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 destructedDomain
).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
Additional context
The only solution that I have in mind, is to provide a way to the user to create a
Domain
(orDomainParticipantFactory
). 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.
The text was updated successfully, but these errors were encountered: