diff --git a/test_security/CMakeLists.txt b/test_security/CMakeLists.txt index b0a08b7e..2b076f10 100644 --- a/test_security/CMakeLists.txt +++ b/test_security/CMakeLists.txt @@ -91,6 +91,17 @@ if(BUILD_TESTING) set(TEST_PUBLISHER_EXECUTABLE "$") set(TEST_SUBSCRIBER_EXECUTABLE "$") + # On Windows, FastDDS SHM transport causes an Access Violation (exit code 0xC0000005) + # when sending large secured messages (e.g. UnboundedSequences). Inject a FastDDS XML + # profile that forces UDPv4 transport to prevent the crash. Empty on non-Windows + # platforms so no behaviour change occurs there. (Issue #561) + set(FASTDDS_PROFILES_FILE "") + if(WIN32) + file(TO_NATIVE_PATH + "${CMAKE_CURRENT_SOURCE_DIR}/test/test_security_files/fastdds_no_shm.xml" + FASTDDS_PROFILES_FILE) + endif() + # Test suite for communication without security set(non_secure_comm_PUBLISHER_ROS_SECURITY_ENABLE_LIST "false;false;false;true;false") set(non_secure_comm_SUBSCRIBER_ROS_SECURITY_ENABLE_LIST "false;false;false;false;true") diff --git a/test_security/test/test_secure_publisher_subscriber.py.in b/test_security/test/test_secure_publisher_subscriber.py.in index 53cef7f0..025f5cba 100644 --- a/test_security/test/test_secure_publisher_subscriber.py.in +++ b/test_security/test/test_secure_publisher_subscriber.py.in @@ -47,6 +47,13 @@ def generate_test_description(): publisher_env['ROS_SECURITY_KEYSTORE'] = '@PUBLISHER_ROS_SECURITY_KEYSTORE@' if '@PUBLISHER_RMW@' == 'rmw_connextdds': publisher_env['RTI_MONITORING2_ENABLE'] = 'false' + # On Windows, FastDDS SHM transport causes an Access Violation (0xC0000005) when + # sending large messages (e.g. UnboundedSequences) with security enabled. + # Force UDPv4 transport via a FastDDS XML profile to prevent the crash. (Issue #561) + if '@PUBLISHER_RMW@' in ('rmw_fastrtps_cpp', 'rmw_fastrtps_dynamic_cpp'): + if '@FASTDDS_PROFILES_FILE@': + publisher_env['FASTRTPS_DEFAULT_PROFILES_FILE'] = '@FASTDDS_PROFILES_FILE@' + publisher_env['RMW_FASTRTPS_USE_QOS_FROM_XML'] = '1' launch_description.add_action(ExecuteProcess( cmd=publisher_cmd, @@ -61,6 +68,11 @@ def generate_test_description(): subscriber_env['ROS_SECURITY_KEYSTORE'] = '@SUBSCRIBER_ROS_SECURITY_KEYSTORE@' if '@SUBSCRIBER_RMW@' == 'rmw_connextdds': subscriber_env['RTI_MONITORING2_ENABLE'] = 'false' + # See publisher comment above. (Issue #561) + if '@SUBSCRIBER_RMW@' in ('rmw_fastrtps_cpp', 'rmw_fastrtps_dynamic_cpp'): + if '@FASTDDS_PROFILES_FILE@': + subscriber_env['FASTRTPS_DEFAULT_PROFILES_FILE'] = '@FASTDDS_PROFILES_FILE@' + subscriber_env['RMW_FASTRTPS_USE_QOS_FROM_XML'] = '1' subscriber_process = ExecuteProcess( cmd=subscriber_cmd, diff --git a/test_security/test/test_security_files/fastdds_no_shm.xml b/test_security/test/test_security_files/fastdds_no_shm.xml new file mode 100644 index 00000000..15ff9ff2 --- /dev/null +++ b/test_security/test/test_security_files/fastdds_no_shm.xml @@ -0,0 +1,33 @@ + + + + + + udpv4_security + UDPv4 + 1048576 + 1048576 + + + + + + + udpv4_security + + false + + +