Repository navigation
go-serial v0.1.8
Date: 2026-10-29
Previous release: v0.1.7
Summary
Patch release: two POSIX I/O bugs found by a new chaos test suite are fixed,
the module is go vet/lint clean on every supported platform (NetBSD now
compiles), and library test coverage rises from 77% to 96%.
Changes
Fixes
Readon file descriptors ≥ 1024.Readwaited withselect(2)and a
fixed 1024-entryfd_set. In a busy process the port can land above that
limit;Readthen returned a spuriousio.EOFat once and the kernel
accessed memory past the set. Linux and the BSDs now wait with
poll/ppoll, which has no descriptor limit. macOS keepsselect(its
polldoes not support ttys) and rejects such descriptors with an error.Writeunder backpressure. The descriptor is non-blocking, so once
the tty output buffer filled,Writereturned a short count with a nil
error, orn == -1withEAGAIN— silent data loss.Writenow waits
until the driver accepts more data and returns only when every byte is
written or an error occurs.- Timeouts under signals. Interrupted waits (
EINTR) retry against one
deadline, so signals no longer shorten or extend aReadtimeout.
SpuriousEAGAINwakeups inReadare retried. - I/O after
Closefails withEBADFinstead of blocking. - NetBSD builds again (
FdSetfield and termios speed types). - Windows:
CloseHandleresult checked on failed open; a port name
containing NUL returns an error instead of panicking;SyscallNreplaces
the deprecatedSyscall.
Tests
- POSIX error-path tests: termios options, failed opens, close, read and
write errors. Coverage 77.1% → 96.1%. - Chaos suite (
TestChaos*), seeded and reproducible via
SERIAL_CHAOS_SEED, scalable viaSERIAL_CHAOS_ITERATIONS: fragmenting
full-duplex relay, random hangups, signal storms during reads, ports above
FD_SETSIZE, write backpressure, random configs, concurrent open/close
churn with an fd-leak check, termios restore. - Fuzz targets for parsers, text round-trips,
Validate, and agreement
betweenValidateand the termios layer. TestReadWritemoved to the POSIX-only test file so Windows test builds
compile.
Unchanged
- The API. POSIX
Writestill has no timeout; it now blocks until all data
is written, as documented.