When I run my NIO based app test suite on a Mac, everything is OK. However, when the same test suite is run on Ubuntu, I get a memory leak error. How am I to debug this? I don't have much experience with memory leaks, and I cannot figure out where the leak takes place. Here is the snippet from my GitHub Action log:
Test Suite 'All tests' passed at 2023-07-31 14:47:54.970
Executed 2 tests, with 0 failures (0 unexpected) in 0.003 (0.003) seconds
=================================================================
==4162==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 32 byte(s) in 1 object(s) allocated from:
#0 0x55753bc461e7 (/home/runner/work/SipOne/SipOne/.build/x86_64-unknown-linux-gnu/release/SipOnePackageTests.xctest+0x17d1e7)
#1 0x7f7bf9029dc2 (/opt/hostedtoolcache/swift-Ubuntu/5.8/x64/usr/bin/../lib/swift/linux/libswiftCore.so+0x3ebdc2)
#2 0x7f7bf9505c88 (/opt/hostedtoolcache/swift-Ubuntu/5.8/x64/usr/bin/../lib/swift/linux/libXCTest.so+0x3ec88) (BuildId: bebcb3079551228b8529ae2ddccce28a3d8babbd)
SUMMARY: AddressSanitizer: 32 byte(s) leaked in 1 allocation(s).
Error: Process completed with exit code 1.
Here is the command that triggers the test (taken from Swift.org - Testing):
swift test --sanitize=address -c release -Xswiftc -enable-testing
Using addr2line -e {filename} -a {address} -ipf | swift demangle, I am getting the following lines but I struggle to make sense of them. I picked few at random out of 22 shown.
addr2line: DWARF error: invalid or unhandled FORM value: 0x23
0x000000000017cef8: posix_memalign at ??:?