SC-5.2: Adjust endpoints and commands#4
Merged
raul-marquez-csa merged 3 commits intoOct 10, 2025
Merged
Conversation
raul-marquez-csa
approved these changes
Oct 10, 2025
68932d2
into
raul-marquez-csa:TC-SC-5.2-6.1
67 of 69 checks passed
raul-marquez-csa
pushed a commit
that referenced
this pull request
Oct 16, 2025
* Fix ActiveTCPConnectionState being leaked when CASE connections are closed (e.g. via ExpireAllSessionsOnLogicalFabric) * Support multiple connections to same peer by sharing a single TCP socket * Unit test with multiple connections, to simulate SessionManager * Use automatic ref-counting throughout; limit visibility of explicit ref/deref * Address review comments from https://github.com/project-chip/connectedhomeip/pull/40817/files * Address review comments from https://github.com/project-chip/connectedhomeip/pull/40817/files * Additional review comments & fixes * Check for invalid nullptr input * * Tighten/hide usage of ref-counting internals, using new method names to catch wrong usages of manual ref counting * Use a consistent Free() for all inet connections which does clean-up such as closing the connections before freeing memory back to pool * Apply clang tidy suggestions * Apply review suggestions * Undo simplification; this was likely intended to force memory allocation on the matter thread * Apply review suggestions * Go back to using && and std::move as previous impl did (EndPointHandle now has a move operator/ctor) * Make call to HandleAcceptError explicit, as that's all we're doing anyway, and set mAppState Remove unnecessary initialization as it's now done @ top of method Fixes CI failure: ==68889==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000030 (pc 0x000104884514 bp 0x00016b642490 sp 0x00016b642410 T0) ==68889==The signal is caused by a READ memory access. ==68889==Hint: address points to the zero page. #0 0x104884514 in chip::Transport::TCPBase::FindActiveConnection(chip::Inet::EndPointHandle<chip::Inet::TCPEndPoint> const&) TCP.cpp:205 #1 0x1048826a8 in chip::Transport::TCPBase::HandleAcceptError(chip::Inet::EndPointHandle<chip::Inet::TCPEndPoint> const&, chip::ChipError) TCP.cpp:664 #2 0x10488181c in chip::Transport::TCPBase::HandleIncomingConnection(chip::Inet::EndPointHandle<chip::Inet::TCPEndPoint> const&, chip::Inet::EndPointHandle<chip::Inet::TCPEndPoint> const&, chip::Inet::IPAddress const&, unsigned short) TCP.cpp:623 #3 0x1048b3328 in chip::Inet::TCPEndPointImplSockets::HandleIncomingConnection() TCPEndPointImplSockets.cpp:1066 #4 0x1048b13ac in chip::Inet::TCPEndPointImplSockets::HandlePendingIO(chip::BitFlags<chip::System::SocketEventFlags, unsigned char>) TCPEndPointImplSockets.cpp:797 project-chip#5 0x1048a96a8 in chip::Inet::TCPEndPointImplSockets::HandlePendingIO(chip::BitFlags<chip::System::SocketEventFlags, unsigned char>, long) TCPEndPointImplSockets.cpp:783 project-chip#6 0x10493f870 in chip::System::LayerImplDispatch::SocketWatch::HandleEvents(chip::System::LayerImplDispatch::SelectSets const&) const SystemLayerImplDispatchSockets.mm:245 project-chip#7 0x10493e800 in chip::System::LayerImplDispatch::SocketWatchPool::HandleEvents(chip::System::LayerImplDispatch::SelectSets const&) const SystemLayerImplDispatchSockets.mm:204 project-chip#8 0x10493df84 in chip::System::LayerImplDispatch::HandleSocketsAndTimerEvents(std::__1::chrono::duration<unsigned int, std::__1::ratio<1l, 1000l>>) SystemLayerImplDispatchSockets.mm:172 project-chip#9 0x104930e28 in chip::System::LayerImplDispatch::HandleDispatchQueueEvents(std::__1::chrono::duration<unsigned int, std::__1::ratio<1l, 1000l>>) SystemLayerImplDispatch.mm:298 * Fix errors merging to head * Apply code review suggestion
raul-marquez-csa
pushed a commit
that referenced
this pull request
Nov 11, 2025
* Batch #4 nodiscard errors: non-clusters app code * Fix clang
raul-marquez-csa
pushed a commit
that referenced
this pull request
May 22, 2026
CI reports a memory leak: ``` ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.521 - APP STDERR: Direct leak of 128 byte(s) in 1 object(s) allocated from: ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.522 - APP STDERR: #0 0x000103639354 in calloc+0x78 (libclang_rt.asan_osx_dynamic.dylib:arm64+0x55354) ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.523 - APP STDERR: #1 0x00018ca6c6ec in _malloc_type_calloc_outlined+0x64 (libsystem_malloc.dylib:arm64e+0x1e6ec) ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.523 - APP STDERR: #2 0x00018c7ff7d8 in class_createInstance+0x48 (libobjc.A.dylib:arm64e+0x77d8) ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.523 - APP STDERR: #3 0x00018caa184c in _os_object_alloc_realized+0x1c (libdispatch.dylib:arm64e+0x284c) ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.524 - APP STDERR: #4 0x00018cab588c in dispatch_source_create+0x38 (libdispatch.dylib:arm64e+0x1688c) ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.525 - APP STDERR: project-chip#5 0x00010278e354 in chip::DeviceLayer::PlatformManagerImpl::RegisterSignalHandler(int, void () block_pointer)+0x3ec (lit-icd-app:arm64+0x1005b2354) ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.525 - APP STDERR: project-chip#6 0x0001022a1cf8 in ChipLinuxAppMainLoop(chip::ServerInitParams&, AppMainLoopImplementation*)+0x1960 (lit-icd-app:arm64+0x1000c5cf8) ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.525 - APP STDERR: project-chip#7 0x0001021dde3c in main+0x9a0 (lit-icd-app:arm64+0x100001e3c) ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.526 - APP STDERR: project-chip#8 0x00018c89fda0 in start+0x1b4c (dyld:arm64e+0x1fda0) ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.526 - APP STDERR: ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.527 - APP STDERR: Indirect leak of 80 byte(s) in 1 object(s) allocated from: ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.527 - APP STDERR: #0 0x000103639354 in calloc+0x78 (libclang_rt.asan_osx_dynamic.dylib:arm64+0x55354) ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.527 - APP STDERR: #1 0x00018ca6c6ec in _malloc_type_calloc_outlined+0x64 (libsystem_malloc.dylib:arm64e+0x1e6ec) ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.527 - APP STDERR: #2 0x00018caa0918 in _dispatch_calloc_typed+0x20 (libdispatch.dylib:arm64e+0x1918) ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.529 - APP STDERR: #3 0x00018cac0838 in _dispatch_unote_create+0x8c (libdispatch.dylib:arm64e+0x21838) ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.529 - APP STDERR: #4 0x00018cab5874 in dispatch_source_create+0x20 (libdispatch.dylib:arm64e+0x16874) ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.530 - APP STDERR: project-chip#5 0x00010278e354 in chip::DeviceLayer::PlatformManagerImpl::RegisterSignalHandler(int, void () block_pointer)+0x3ec (lit-icd-app:arm64+0x1005b2354) ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.530 - APP STDERR: project-chip#6 0x0001022a1cf8 in ChipLinuxAppMainLoop(chip::ServerInitParams&, AppMainLoopImplementation*)+0x1960 (lit-icd-app:arm64+0x1000c5cf8) ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.530 - APP STDERR: project-chip#7 0x0001021dde3c in main+0x9a0 (lit-icd-app:arm64+0x100001e3c) ERROR [Worker] Test_TC_ICDM_4_1: 15:03:07.530 - APP STDERR: project-chip#8 0x00018c89fda0 in start+0x1b4c (dyld:arm64e+0x1fda0) ``` Normally if we only stop on signal handlers, the clear should have happened... however it seems it does not, so moving the logic to become unconditional, in case we have other ways to stop the app.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adjust endpoints and commands for GroupKeyManagement, ACL, and ViewGroup tests
Testing
Running against darwin-x64-all-cluster-app & darwin-x64-lighting-app.