Fix rmw_fastrtps SHM crash on Windows with secured large messages (Issue #561) - #605
Fix rmw_fastrtps SHM crash on Windows with secured large messages (Issue #561)#605Aaravanand00 wants to merge 1 commit into
Conversation
|
Tick the box to add this pull request to the merge queue (same as
|
|
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.... |
|
@fujitatomoya ptal |
fujitatomoya
left a comment
There was a problem hiding this comment.
@Aaravanand00 thanks for creating PR.
a couple of comments and did you actually reproduce the issue on windows and check if this PR addresses the issue?
CC: @MiguelCompany
|
I'd like to note that issue #561 is another instance of Windows process killed with If we make every run of a test involving a Fast DDS rmw call |
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 setting FASTDDS_BUILTIN_TRANSPORTS=UDPv4 in the test environment for rmw_fastrtps_cpp and rmw_fastrtps_dynamic_cpp to force UDPv4 transport. Fixes ros2#561 Signed-off-by: Aaravanand <aaravanand@gmail.com>
a06e6de to
ea444d3
Compare
|
Updated the pr to remove the xml profile file completely and simplify the fix by directly setting BTW I recently introduced myself in the ROS community and was recommended by VMB to join the ROS Issue Triage ("Waffle") meeting to help with triaging. |
| # On Windows, FastDDS SHM transport causes an Access Violation (0xC0000005) when | ||
| # sending large messages (e.g. UnboundedSequences) with security enabled. | ||
| # Force UDPv4 transport to prevent the crash. (Issue #561) |
There was a problem hiding this comment.
The reason for the crash is not due to the large messages, but due to accumulating corrupted files because processes are being killed with SIGTERM. It just happens on those messages because they are the last ones being tested.
| # On Windows, FastDDS SHM transport causes an Access Violation (0xC0000005) when | |
| # sending large messages (e.g. UnboundedSequences) with security enabled. | |
| # Force UDPv4 transport to prevent the crash. (Issue #561) | |
| # On Windows, FastDDS SHM transport may cause an Access Violation (0xC0000005) when | |
| # previous tests kill a process using SIGTERM. (Issue #561) | |
| # Force UDPv4 transport to prevent the crash till we write an isolation plugin that cleans | |
| # those files before a test is run. |
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 :-
test_security_files/fastdds_no_shm.xml: FastDDS profile that disables built-in SHM and uses only UDPv4 transport.test_secure_publisher_subscriber.py.in: InjectsFASTRTPS_DEFAULT_PROFILES_FILEenv var forrmw_fastrtps_cpp/rmw_fastrtps_dynamic_cppprocesses.CMakeLists.txt: Computes the native path to the XML profile onWIN32; 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
WIN32is defined at CMake configure time, so Linux and macOS CI is completely unaffected.