When connect() failed on an address, InetSocket::connect closed the socket
but kept its number in mSd. The next address then tried connect() on the
closed descriptor, and close() (also run by ~Socket) closed that number
again, by then often another descriptor: the log file the failed connect's
Error() had just opened, for one. On macOS the test suite was killed with
EXC_GUARD when the Logger later closed its file and the number had been
reused by a guarded system descriptor.
Reset mSd after closing it, as bind() already does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both "newSockAddr from resolved addr" sections called
zm::SockAddr::newSockAddr and dropped the pointer. It hands ownership to the
caller -- Socket deletes the ones it holds in its destructor -- so each run
leaked one: 48 bytes for the AF_INET case and 240 for the AF_UNIX one, the
288 bytes in 2 allocations AddressSanitizer has been reporting on every run
of the suite.
Held in a unique_ptr rather than deleted at the end of the section, because a
failing REQUIRE throws and would walk straight past a delete there.
With this the whole suite is clean under AddressSanitizer for the first time:
12171 assertions in 133 cases with no report of any kind, and the [notCI]
socket cases pass under it too, 66 assertions in 5 cases. Normal build
unchanged at 12171 assertions.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015Y6FieTwEXuLhhR4e2yiax
Those tests timeout on Cirrus. Disable them for now.
This introduces a new tag [notCI] with which tests can be marked which shouldn't be run during CI.