Skip to content

Segmentation fault when create_participant is called the second time #3082

@burak-yildizoz

Description

@burak-yildizoz

Is there an already existing issue for this?

  • I have searched the existing issues

Expected behavior

eprosima::fastdds::dds::DomainParticipantFactory::create_participant should return an empty pointer in case of a failure instead of causing a segmentation fault.

Current behavior

fastrtps DLL throws an exception about read access violation.

See log output for stack trace.

Steps to reproduce

Run HelloWorldExample with subscriber argument.
Run HelloWorldExample with publisher argument. The second call to create_participant throws.

It does not matter whether HelloWorldExample or any other application is run.
A call to eprosima::fastrtps::Domain::createParticipant also throws.

It does not matter whether publisher or subscriber is run.
Any second call to create_participant throws.
It can be a different process or a different thread.

Note that the same executable does not throw exception if the application is run on a different computer.
There has to be some setting which is not reset after restarting the computer that causes the segmentation fault error.
So, the issue occurs only on a specific computer.

Fast DDS version/commit

Tested with v2.6 and v2.8.

Platform/Architecture

Other. Please specify in Additional context section.

Transport layer

Default configuration, UDPv4 & SHM, Shared Memory Transport (SHM)

Additional context

The platform is Windows 10 Visual Studio 2017.

XML configuration file

No response

Relevant log output

C:\FIW\src\fastrtps\thirdparty\boost\include\boost\intrusive\detail\rbtree_node.hpp (146): boost::intrusive::compact_rbtree_node_traits_impl<boost::interprocess::offset_ptr<void,unsigned int,unsigned __int64,0> >::get_left
C:\FIW\src\fastrtps\thirdparty\boost\include\boost\intrusive\detail\bstree_algorithms_base.hpp (100): boost::intrusive::bstree_algorithms_base<boost::intrusive::rbtree_node_traits<boost::interprocess::offset_ptr<void,unsigned int,unsigned __int64,0>,1> >::minimum
C:\FIW\src\fastrtps\thirdparty\boost\include\boost\intrusive\detail\bstree_algorithms_base.hpp (49): boost::intrusive::bstree_algorithms_base<boost::intrusive::rbtree_node_traits<boost::interprocess::offset_ptr<void,unsigned int,unsigned __int64,0>,1> >::next_node
C:\FIW\src\fastrtps\thirdparty\boost\include\boost\intrusive\detail\tree_iterator.hpp (98): boost::intrusive::tree_iterator<boost::intrusive::bhtraits<boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,boost::interprocess::offset_ptr<void,unsigned int,unsigned __int64,0>,0>::block_ctrl,boost::intrusive::rbtree_node_traits<boost::interprocess::offset_ptr<void,unsigned int,unsigned __int64,0>,1>,0,boost::intrusive::dft_tag,3>,0>::operator++
C:\FIW\src\fastrtps\thirdparty\boost\include\boost\interprocess\mem_algo\rbtree_best_fit.hpp (642): boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,boost::interprocess::offset_ptr<void,unsigned int,unsigned __int64,0>,0>::check_sanity
C:\FIW\src\fastrtps\thirdparty\boost\include\boost\interprocess\segment_manager.hpp (247): boost::interprocess::segment_manager_base<boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,boost::interprocess::offset_ptr<void,unsigned int,unsigned __int64,0>,0> >::check_sanity
C:\FIW\src\fastrtps\thirdparty\boost\include\boost\interprocess\detail\managed_memory_impl.hpp (249): boost::interprocess::ipcdetail::basic_managed_memory_impl<char,boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,boost::interprocess::offset_ptr<void,unsigned int,unsigned __int64,0>,0>,boost::interprocess::iset_index,8>::check_sanity
C:\FIW\src\fastrtps\src\cpp\utils\shared_memory\SharedMemSegment.hpp (382): eprosima::fastdds::rtps::SharedSegment<boost::interprocess::basic_managed_shared_memory<char,boost::interprocess::rbtree_best_fit<boost::interprocess::mutex_family,boost::interprocess::offset_ptr<void,unsigned int,unsigned __int64,0>,0>,boost::interprocess::iset_index>,boost::interprocess::shared_memory_object>::check_sanity
C:\FIW\src\fastrtps\src\cpp\rtps\transport\shared_mem\SharedMemGlobal.hpp (1024): eprosima::fastdds::rtps::SharedMemGlobal::open_port_internal
C:\FIW\src\fastrtps\src\cpp\rtps\transport\shared_mem\SharedMemGlobal.hpp (931): eprosima::fastdds::rtps::SharedMemGlobal::open_port
C:\FIW\src\fastrtps\src\cpp\rtps\transport\shared_mem\SharedMemManager.hpp (972): eprosima::fastdds::rtps::SharedMemManager::open_port
C:\FIW\src\fastrtps\src\cpp\rtps\transport\shared_mem\SharedMemTransport.cpp (314): eprosima::fastdds::rtps::SharedMemTransport::CreateInputChannelResource
C:\FIW\src\fastrtps\src\cpp\rtps\transport\shared_mem\SharedMemTransport.cpp (134): eprosima::fastdds::rtps::SharedMemTransport::OpenInputChannel
C:\FIW\src\fastrtps\src\cpp\rtps\network\ReceiverResource.cpp (41): eprosima::fastrtps::rtps::ReceiverResource::ReceiverResource
C:\FIW\src\fastrtps\src\cpp\rtps\network\NetworkFactory.cpp (73): eprosima::fastrtps::rtps::NetworkFactory::BuildReceiverResources
C:\FIW\src\fastrtps\src\cpp\rtps\participant\RTPSParticipantImpl.cpp (1590): eprosima::fastrtps::rtps::RTPSParticipantImpl::createReceiverResources
C:\FIW\src\fastrtps\src\cpp\rtps\participant\RTPSParticipantImpl.cpp (345): eprosima::fastrtps::rtps::RTPSParticipantImpl::RTPSParticipantImpl
C:\FIW\src\fastrtps\src\cpp\rtps\participant\RTPSParticipantImpl.cpp (434): eprosima::fastrtps::rtps::RTPSParticipantImpl::RTPSParticipantImpl
C:\FIW\src\fastrtps\src\cpp\rtps\RTPSDomain.cpp (182): eprosima::fastrtps::rtps::RTPSDomain::createParticipant
C:\FIW\src\fastrtps\src\cpp\fastdds\domain\DomainParticipantImpl.cpp (303): eprosima::fastdds::dds::DomainParticipantImpl::enable
C:\FIW\src\fastrtps\src\cpp\fastdds\domain\DomainParticipant.cpp (96): eprosima::fastdds::dds::DomainParticipant::enable
C:\FIW\src\fastrtps\src\cpp\fastdds\domain\DomainParticipantFactory.cpp (249): eprosima::fastdds::dds::DomainParticipantFactory::create_participant
c:\users\v4520\documents\github\ddshelloworld\src\helloworldpublisher.cpp (61): HelloWorldPublisher::init
c:\users\v4520\documents\github\ddshelloworld\src\hello_world_publisher_main.cpp (21): main

Network traffic capture

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageIssue pending classification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions