2 minor findings · 1 suggestion
Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.
Findings
[minor] · Unbounded receive-cap growth can abort the sanitizer run
A sustained receive backlog can overflow the reproducer's debug cap and terminate a node under the ASan job's integer sanitizer, producing a failure unrelated to chunking robustness.
Location: src/util/sock.cpp:94 (head).
Details and suggested fix
Every non-PEEK Recv with FIONREAD > 100 grows m_dbg_recv_cap, even when len or the availability-based limit already determines the read size. Only a call seeing at most 100 queued bytes resets it. Roughly 150 consecutive qualifying calls overflow a 64-bit size_t. The ASan job enables integer sanitization, and functional tests default to UBSAN_OPTIONS=...halt_on_error=1 without a matching suppression, so this defined unsigned wrap terminates the node. The nearly 32 MiB request in interface_http.py, received through a 64 KiB buffer, is a plausible trigger, but whether its backlog stays above 100 bytes long enough is unconfirmed. Without the sanitizer, wrapping merely makes the cap small again. Bound the stored cap to a fixed ceiling, such as 1 MiB, from initialization onward; this prevents overflow while preserving the small-chunk ramp.
[minor] · Forced chunking truncates datagrams and can hang mapport shutdown
Applying the stream receive cap to datagram sockets makes port-mapping replies unusable and can leave the blocking netlink gateway query waiting indefinitely during manual runs.
Location: src/util/sock.cpp:96 (head).
Details and suggested fix
Sock::Recv now caps every socket type, with a one-byte first receive and one-byte reads whenever FIONREAD reports at most 100 bytes or fails. PCP and NAT-PMP use UDP sockets: on POSIX, short receives discard the remaining datagram, so ordinary small replies fail validation on every retry, including the unsupported-version reply needed for NAT-PMP fallback. On Linux and FreeBSD, the netlink gateway query also uses SOCK_DGRAM, and its socket remains blocking. If truncation leaves no parseable gateway or completion message, its next receive waits indefinitely without a timeout or interrupt check. Shutdown then waits in StopMapPort for that thread. This hang depends on the kernel response sequence and has not been observed. Port mapping defaults to enabled, subject to soft-disabling by -proxy or -listen=0; the standard unit and functional setups disable it, and PCP unit tests override Recv, so this affects manual runs rather than those CI paths. Restrict the cap to SOCK_STREAM and preserve the caller's len otherwise. Datagram truncation is not TCP chunking and would produce failures caused by the reproducer itself.
Optional improvements
[suggestion] · Mock-socket unit tests bypass the forced receive chunking
This branch adds no forced chunking to StaticContentsSock- or DynSock-based unit tests, so their results do not establish robustness under this reproducer's receive schedule.
Location: src/util/sock.cpp:65 (head).
Details and suggested fix
The instrumentation changes only Sock::Recv, but StaticContentsSock::Recv and DynSock::Recv override it and return buffered data up to the requested length. The I2P unit fixtures install StaticContentsSock, and the HTTP socket fixture preloads requests into DynSock pipes, so these reads bypass the new schedule. Document this exclusion in the run results rather than treating those unit tests as exercised by the reproducer. Functional tests using real sockets remain covered, and FuzzedSock already supplies variable-length reads. If extending the schedule to stream mocks instead, preserve consistency between peeks and their consuming reads, as required by RecvUntilTerminator, and leave UDP packet mocks unfragmented.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: The standalone socket-test fix is bundled with the reproducer (earlier report)