Skip to content

Set useBuiltinTransports to false cause Segmentation fault #6114

@jack0622

Description

@jack0622

Is there an already existing issue for this?

  • I have searched the existing issues

Expected behavior

when I run a process and quit it with Ctrl-C, it should quit normally.

Current behavior

when I run a process and quit it with Ctrl-C, it cause a Segmentation fault

Steps to reproduce

This is my xml file segment:
`<transport_descriptors>
<transport_descriptor>
<transport_id>SHM_SAMPLE_DESCRIPTOR</transport_id>
SHM
2168576
<segment_size>104857600</segment_size>
</transport_descriptor>
</transport_descriptors>

    <participant profile_name="AA_participant_profile">
        <domainId>200</domainId>
        <rtps>
            <name>Lidar_Pub_Demo</name>
            <useBuiltinTransports>false</useBuiltinTransports>
            <userTransports>
                    <transport_id>SHM_SAMPLE_DESCRIPTOR</transport_id>
            </userTransports>
        </rtps>
    </participant>

`

I set useBuiltinTransports to false and use SHM, run my progress and stop it with Ctrl-C, it will cause a Segmentation fault. If I set useBuiltinTransports to false and use UDP or set useBuiltinTransports to true, it works all right.

The function remove_port() in src/cpp/rtps/transport/shared_mem/SharedMemGlobal.hpp causes this bug. It seems
the port in watched_ports_ is freed previously.

Fast DDS version/commit

v3.2.0

Platform/Architecture

Ubuntu Focal 20.04 arm64

Transport layer

Shared Memory Transport (SHM)

Additional context

No response

XML configuration file

<transport_descriptors>
            <transport_descriptor>
                <transport_id>SHM_SAMPLE_DESCRIPTOR</transport_id>
                    <type>SHM</type> <!-- REQUIRED -->
                    <maxMessageSize>2168576</maxMessageSize>
                    <segment_size>104857600</segment_size>
            </transport_descriptor>
        </transport_descriptors>

        <participant profile_name="AA_participant_profile">
            <domainId>200</domainId>
            <rtps>
                <name>Lidar_Pub_Demo</name>
                <useBuiltinTransports>false</useBuiltinTransports>
                <userTransports>
                        <transport_id>SHM_SAMPLE_DESCRIPTOR</transport_id>
                </userTransports>
            </rtps>
        </participant>

Relevant log output

nvidia@tegra-ubuntu:~/luwei/LidarService$ ./run_pub.sh 
LidarSrvPublisher::start()...
^CCaught signal number 2 (Interrupt)
LidarDataPub report execution state: kTerminating
LidarDataPub application exited
LidarSrvPublisher::stop()...
./run_pub.sh: line 12: 1624023 Segmentation fault      ./Lidar_Pub
nvidia@tegra-ubuntu:~/luwei/LidarService$

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