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

Crash at Domain::removeParticipant() #4984

Closed
1 task done
sribasadhikary opened this issue Jun 24, 2024 · 4 comments
Closed
1 task done

Crash at Domain::removeParticipant() #4984

sribasadhikary opened this issue Jun 24, 2024 · 4 comments
Labels
need more info Issue that requires more info from contributor

Comments

@sribasadhikary
Copy link

Is there an already existing issue for this?

  • 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 sribasadhikary added the triage Issue pending classification label Jun 24, 2024
@EduPonz EduPonz added need more info Issue that requires more info from contributor and removed triage Issue pending classification labels Jun 24, 2024
@EduPonz
Copy link

EduPonz commented Jun 24, 2024

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.

@sribasadhikary
Copy link
Author

  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_.reset(new Participant());
    participant_->init(args....)

/* more code to publish, and receive */

}

@Mario-DL
Copy link
Member

Mario-DL commented Sep 5, 2024

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
Copy link
Member

Mario-DL commented Oct 3, 2024

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 Mario-DL closed this as completed Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more info Issue that requires more info from contributor
Projects
None yet
Development

No branches or pull requests

3 participants