Fast-DDS icon indicating copy to clipboard operation
Fast-DDS copied to clipboard

Crash at Domain::removeParticipant()

Open sribasadhikary opened this issue 1 year ago • 2 comments

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 /lib/libfastrtps.so.2.6) [ 1] 0x00007f1d3db6aec0 eprosima::fastrtps::rtps::TopicPayloadPool::release_history(eprosima::fastrtps::rtps::PoolConfig const&, bool) at ??:? (in /lib/libfastrtps.so.2.6) [ 2] 0x00007f1d3ddaf565 eprosima::fastrtps::rtps::WLP::~WLP() at ??:? (in /lib/libfastrtps.so.2.6) [ 3] 0x00007f1d3ddaf709 eprosima::fastrtps::rtps::WLP::~WLP() at ??:? (in /lib/libfastrtps.so.2.6) [ 4] 0x00007f1d3dd773e0 eprosima::fastrtps::rtps::BuiltinProtocols::~BuiltinProtocols() at ??:? (in /lib/libfastrtps.so.2.6) [ 5] 0x00007f1d3dd77559 eprosima::fastrtps::rtps::BuiltinProtocols::~BuiltinProtocols() at ??:? (in /lib/libfastrtps.so.2.6) [ 6] 0x00007f1d3dbb1b71 eprosima::fastrtps::rtps::RTPSParticipantImpl::disable() at ??:? (in /lib/libfastrtps.so.2.6) [ 7] 0x00007f1d3dbc00b6 eprosima::fastrtps::rtps::RTPSDomain::removeRTPSParticipant(eprosima::fastrtps::rtps::RTPSParticipant*) at ??:? (in /lib/libfastrtps.so.2.6) [ 8] 0x00007f1d3dbd741c eprosima::fastrtps::ParticipantImpl::~ParticipantImpl() at ??:? (in /lib/libfastrtps.so.2.6) [ 9] 0x00007f1d3dbd7849 eprosima::fastrtps::ParticipantImpl::~ParticipantImpl() at ??:? (in /lib/libfastrtps.so.2.6) [ 10] 0x00007f1d3dbcb829 eprosima::fastrtps::Domain::removeParticipant(eprosima::fastrtps::Participant*) at ??:? (in /lib/libfastrtps.so.2.6) [ 11] 0x00007f1d50d3e8e9 ClientCode::rtps::Participant::~Participant() at ../rtps/Participant.cpp:99 (in ourlibtargetRTPSDevice.so) [ 12] 0x00007f1d50d125d8 std::default_deleteClientCode::rtps::Participant::operator()(ClientCode::rtps::Participant*) const at ../gcc-12.3.0/include/c++/12.3.0/bits/unique_ptr.h:95 (in ourlibtargetRTPSDevice.so) [ 13] 0x00007f1d56ef7f32 io::Channel::close() at Channel.cpp:195

XML configuration file

No response

Relevant log output

No response

Network traffic capture

No response

sribasadhikary avatar Jun 24 '24 09:06 sribasadhikary

Hi @sribasadhikary,

I'm afraid we're going to need more information on this issue:

  1. Which version of 2.6 are you using?
  2. 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.

EduPonz avatar Jun 24 '24 13:06 EduPonz

  1. I am using FastDDS 2.6.1.
  2. I have a program that communicates using DDS and it is all successful. The Participant has both Publishers and Subscribers created from it.
  3. The crash is sporadic. I think it crashes when I close the program and still, some data is available to publish or receive.
  4. The function eprosima::fastrtps::rtps::TopicPayloadPool::shrink should have some protective measures to not crash the program while termination.
  5. 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 */

}

sribasadhikary avatar Jun 25 '24 09:06 sribasadhikary

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.

Mario-DL avatar Sep 05 '24 08:09 Mario-DL

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.

Mario-DL avatar Oct 03 '24 05:10 Mario-DL