Skip to content

Fix rmw_fastrtps SHM crash on Windows with secured large messages (Issue #561) - #605

Open
Aaravanand00 wants to merge 1 commit into
ros2:rollingfrom
Aaravanand00:fix-issue-561-fastdds-shm-windows
Open

Fix rmw_fastrtps SHM crash on Windows with secured large messages (Issue #561)#605
Aaravanand00 wants to merge 1 commit into
ros2:rollingfrom
Aaravanand00:fix-issue-561-fastdds-shm-windows

Conversation

@Aaravanand00

Copy link
Copy Markdown
Contributor

Description

On Windows, FastDDS uses Shared Memory (SHM) transport by default for intra-host communication. When DDS-Security is enabled, the security overhead causes the SHM segment to overflow when sending large messages (e.g. UnboundedSequences), resulting in an Access Violation crash (0xC0000005) in the publisher process. Since the publisher crashes, the subscriber waits indefinitely and the test times out.

This PR fixes the crash by supplying a FastDDS XML profile (fastdds_no_shm.xml) that disables SHM and forces UDPv4 transport with enlarged send/receive buffers (1 MB) to accommodate the security-layer overhead on large messages.

Key changes :-

  • Added test_security_files/fastdds_no_shm.xml: FastDDS profile that disables built-in SHM and uses only UDPv4 transport.
  • Updated test_secure_publisher_subscriber.py.in: Injects FASTRTPS_DEFAULT_PROFILES_FILE env var for rmw_fastrtps_cpp / rmw_fastrtps_dynamic_cpp processes.
  • Updated CMakeLists.txt: Computes the native path to the XML profile on WIN32; set to empty string on Linux/macOS so there is zero behavioural change on non-Windows platforms.

Fixes #561

Is this user-facing behavior change?

No. This is a test infrastructure fix. The actual security tests remain unchanged no tests are skipped or removed.

Did you use Generative AI?

Yes, Ai Agent was used to assist in root cause analysis and implementation.

Additional Information

The fix applies only when WIN32 is defined at CMake configure time, so Linux and macOS CI is completely unaffected.

On Windows, FastDDS uses Shared Memory (SHM) transport by default for
intra-host communication. When DDS-Security is enabled, the security
overhead can cause the SHM segment to overflow when sending large
messages (e.g. UnboundedSequences), resulting in an Access Violation
crash (exit code 0xC0000005) in the publisher process.

Fix by supplying a FastDDS XML profile (fastdds_no_shm.xml) that
disables SHM and forces UDPv4 with enlarged send/receive buffers.
The profile is injected via FASTRTPS_DEFAULT_PROFILES_FILE only on
WIN32 and only for rmw_fastrtps_cpp / rmw_fastrtps_dynamic_cpp, so
there is zero behavioural change on Linux or macOS.

Fixes ros2#561

Signed-off-by: Aaravanand <aaravanand@gmail.com>
@mergify

mergify Bot commented Aug 5, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@Aaravanand00

Copy link
Copy Markdown
Contributor Author

Hi @fujitatomoya looking into issue #561 the publisher was crashing on Windows (exit code 0xC0000005) because FastDDS's default Shared Memory transport overflows when handling large encrypted messages. Fixed it by injecting a FastDDS XML profile that switches to UDP transport only applies on Windows, no tests skipped, Linux/macOS completely unaffected. Please let me know if any changes was needed....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🧑‍🌾 test_secure_publisher_subscriber fastrtps secure_comm timing out in windows

1 participant