Commit Graph
16 Commits
Author SHA1 Message Date
Jash Ambaliya 9a71b7efb8 fix: Socket accept keeps the listener on transient errors and unix resolve frees the old address refs #7755 (#7756) 2026-11-24 18:00:59 -05:00
Jash Ambaliya e41f62d4b5 fix: a unix socket path too long for sun_path is refused instead of silently truncated refs #7713 (#7714) 2026-11-23 08:47:07 -05:00
Isaac ConnorandClaude Opus 5.5 35e503d2e2 fix: forget a socket that InetSocket::connect closed after a failed connect
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>
2026-11-15 11:45:06 -05:00
Isaac ConnorandClaude Opus 5 a0626ed66f test: own the SockAddr that newSockAddr returns
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
2026-09-07 11:24:16 -04:00
Jash 691ab8ab66 test: handle IPv6 in getBoundPort, reserve the real socket path, drop the last hardcoded port 2026-08-18 06:22:31 +05:30
Jash ed0119b451 test: bind comms tests to ephemeral ports and unique socket paths 2026-08-16 15:25:37 +05:30
Peter Keresztes Schmidt 46155942c1 Misc: Rename namespace ZM to zm
We had a mixture of both spellings. Unify it according to our code-style.
2021-06-06 19:11:11 +02:00
Peter Keresztes Schmidt 298415fff3 Remove remaining usages of VLAs 2021-05-17 22:12:04 +02:00
Peter Keresztes Schmidt c2a7f7b593 tests/Box: Add unit tests 2021-05-16 16:42:58 +02:00
Peter Keresztes Schmidt 369fb68bb4 tests/comms: Disable tests which bind TCP sockets on CI runs
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.
2021-04-11 02:46:56 +02:00
Peter Keresztes Schmidt f84d23817e tests/comms: Add tests for TcpInetClient/Server 2021-04-11 01:28:23 +02:00
Peter Keresztes Schmidt 25e6b70381 tests/comms: Add tests for ZM::UdpUnixSocket 2021-04-11 01:28:23 +02:00
Peter Keresztes Schmidt 17485f3547 tests/comms: Add tests for ZM::UdpInetSocket 2021-04-11 01:28:23 +02:00
Peter Keresztes Schmidt 45986c8ee2 tests/comms: Add some tests for SockAddrInet/Unix 2021-04-11 01:28:23 +02:00
Peter Keresztes Schmidt 5aa508bc74 tests/comms: Add read/write tests for ZM::Pipe 2021-04-11 01:28:23 +02:00
Peter Keresztes Schmidt a06d374292 tests/comms: Add some basic tests for ZM::Pipe 2021-04-11 01:28:23 +02:00