5.10. Memory Leaks/Growth

5.10.1. [Minor] Memory leak when running out of memory while validating permissions of local or remote DomainParticipants

If either of the internal functions RTI_Security_AccessControl_validate_local_permissions() or RTI_Security_AccessControl_validate_remote_permissions() ran out of memory, then validation of the permissions would fail with a memory leak. Here is one example set of error messages, along with a valgrind result:

ERROR [CREATE DP|LC:DISC,SEC]RTI_Security_AccessControl_validate_local_permissions:{"DDS:Security:LogTopicV2":{"f":"10","s":"1","t":{"s":"1701168980","n":"715641999"},"h":"RTISP-10036","i":"0.0.0.0","a":"RTI Secure DDS Application","p":"22166","k":"security","x":[{"DDS":[{"domain_id":"<unknown>"},{"guid":"<unknown>"},{"plugin_class":"Access Control"},{"plugin_method":"RTI_Security_AccessControl_validate_local_permissions"}]}],"m":"failed to validate local permissions. XML file:"}}
[...]
ERROR [CREATE DP|LC:DISC,SEC]DDS_DomainParticipantTrustPlugins_getLocalParticipantSecurityState:VALIDATION FAILURE | Local permissions.
ERROR [CREATE DP|LC:DISC,SEC]DDS_DomainParticipantTrustPlugins_getLocalParticipantSecurityState:RETURN FAILURE | Reverting local DP security state due to the errors.
ERROR [CREATE DP|LC:DISC,SEC]DDS_DomainParticipant_createI:INVALID CONFIGURATION | New DP's security state is incorrect.
ERROR LC:DISC| DDS_DomainParticipantFactory_create_participant_disabledI:!create participant
[...]

==22166== 144 bytes in 1 blocks are definitely lost in loss record 1 of 1
==22166==    at 0x484DA83: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==22166==    by 0x498454F: RTIOsapiHeap_reallocateMemoryInternal (heap.c:830)
==22166==    by 0x1631CBC: RTI_Security_Heap_allocate (InfrastructurePSM.c:366)
==22166==    by 0x15740E9: RTI_Security_AccessControl_validatePermissions (AccessControl.c:525)
==22166==    by 0x1576226: RTI_Security_AccessControl_validate_local_permissions (AccessControl.c:1102)
==22166==    by 0x932607: DDS_DomainParticipantTrustPlugins_getLocalParticipantSecurityState (DomainParticipantTrustPlugins.c:2466)
==22166==    by 0x97062E: DDS_DomainParticipant_createI (DomainParticipant.c:11719)
==22166==    by 0x90B6F2: DDS_DomainParticipantFactory_create_participant_disabledI (DomainParticipantFactory.c:2816)
==22166==    by 0x907E8E: DDS_DomainParticipantFactory_create_participant (DomainParticipantFactory.c:1542)

The leak only happened if memory was already exhausted, so this problem did not lead to unbounded memory growth.

Now, those two functions will fail, without a memory leak.

[RTI Issue ID SEC-2331]

5.10.2. [Trivial] Memory leak when running Security Plugins SDK tester *

Running a Security Plugins tester (AccessControlTester, CryptographyTester, or LightweightTester) caused a memory leak, because the testers didn’t finalize the DomainParticipantFactory. Here is an extract from the valgrind result:

==23517== HEAP SUMMARY:
==23517==     in use at exit: 1,802,975 bytes in 11,641 blocks
==23517==   total heap usage: 67,021 allocs, 55,380 frees, 44,232,249 bytes allocated
==23517==
==23517== 5 bytes in 1 blocks are possibly lost in loss record 11 of 1,645
==23517==    at 0x484DA83: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==23517==    by 0x653E49E: RTIOsapiHeap_reallocateMemoryInternal (heap.c:821)
==23517==    by 0x6688605: RTIXMLDtdAttribute_new (DtdParser.c:181)
==23517==    by 0x66896F0: RTIXMLDtdParser_onAttlistDecl (DtdParser.c:481)
==23517==    by 0x66758CB: RTI_doProlog (xmlparse.c:5013)
==23517==    by 0x6674539: RTI_externalParEntProcessor (xmlparse.c:4589)
==23517==    by 0x667416C: RTI_externalParEntInitProcessor (xmlparse.c:4460)
==23517==    by 0x666E2BC: RTI_XML_Parse (xmlparse.c:1938)
==23517==    by 0x668A301: RTIXMLDtdParser_parse (DtdParser.c:703)
==23517==    by 0x6682D84: RTIXMLParser_onExternalEntityRef (Parser.c:819)
==23517==    by 0x66752B2: RTI_doProlog (xmlparse.c:4913)
==23517==    by 0x66746E7: RTI_prologProcessor (xmlparse.c:4637)
==23517==
==23517== 6 bytes in 1 blocks are possibly lost in loss record 21 of 1,645
==23517==    at 0x484DA83: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==23517==    by 0x653E49E: RTIOsapiHeap_reallocateMemoryInternal (heap.c:821)
==23517==    by 0x6635829: REDAString_duplicate (String.c:1597)
==23517==    by 0x668AA9E: RTIXMLExtensionClass_initialize (ExtensionClass.c:143)
==23517==    by 0x668AE08: RTIXMLExtensionClass_new (ExtensionClass.c:208)
==23517==    by 0x5DCA557: DDS_XMLParser_register_builtin_extensions (Parser.c:542)
==23517==    by 0x5DCC616: DDS_XMLParser_initialize_w_params (Parser.c:1046)
==23517==    by 0x5DCC7A7: DDS_XMLParser_new_w_params (Parser.c:1077)
==23517==    by 0x59E0B3E: DDS_QosProvider_initialize (QosProvider.c:2620)
==23517==    by 0x59E0E3E: DDS_QosProvider_new (QosProvider.c:2672)
==23517==    by 0x59EAD57: DDS_DomainParticipantFactory_initializeI (DomainParticipantFactory.c:3750)
==23517==    by 0x59E2F22: DDS_DomainParticipantFactory_newI (DomainParticipantFactory.c:891)
[...]

To correct this, the testers now call DDS_DomainParticipantFactory_finalize_instance() upon finalization.

[RTI Issue ID SEC-2279]



* This bug does not affect you if you are upgrading from 6.1.x or earlier.