Crash at Domain::removeParticipant()
Is there an already existing issue for this?
- [X] I have searched the existing issues
Expected behavior
It shouldn't crash the program.
Current behavior
While destroyed, the program crashes at Domain::removeParticipant
Steps to reproduce
Store the eprosima::fastrtps::Participant* in an unique_ptr While the program closes, it crashes at Domain::removeParticipant
Fast DDS version/commit
2.6
Platform/Architecture
Ubuntu Focal 20.04 amd64
Transport layer
UDPv4
Additional context
[ 0] 0x00007f1d3db6ade0 eprosima::fastrtps::rtps::TopicPayloadPool::shrink(unsigned int) at ??:? (in
XML configuration file
No response
Relevant log output
No response
Network traffic capture
No response
Hi @sribasadhikary,
I'm afraid we're going to need more information on this issue:
- Which version of 2.6 are you using?
- Could you provide the relevant code on your
io::Channel::close()method?
As a side note, the Fast RTPS PubSub API you're using is deprecated in Fast DDS v2.6, you may consider switching to the DDS API.
- I am using FastDDS 2.6.1.
- I have a program that communicates using DDS and it is all successful. The Participant has both Publishers and Subscribers created from it.
- The crash is sporadic. I think it crashes when I close the program and still, some data is available to publish or receive.
- The function eprosima::fastrtps::rtps::TopicPayloadPool::shrink should have some protective measures to not crash the program while termination.
- The outline of the program and the APIs I use are mentioned below class Participant { public: Participant() participant_(nullptr){} init(args...){ participant_ = Domain::createParticipant(PParam, (ParticipantListener*)&participantListener_); participant_->createPublisher<ABCDPubSubType, ABCD>(args); participant_->createSubscriber<XYZPubSubType, XYZ> (args); ... ...} ~Participant(){ Domain::removeParticipant(participant_); } private: eprosima::fastrtps::Participant* participant_; }
int main(){ std::unique_ptr<Participant> participant_; participant_.reset(new Participant()); participant_->init(args....)
/* more code to publish, and receive */
}
Hi @sribasadhikary ,
Please, could you check if the issue persist using Fast DDS v2.6.9 ? As @EduPonz was pointing, it may also be important moving to the new DDS API instead of the deprecated one.
According to our CONTRIBUTING.md guidelines, I am closing this issue due to inactivity. If after applying suggestions the issue persists, please feel free to reopen it if necessary providing a more detailed reproducer.