$ the-wire · showcase
Compiler fixes land for escaping slices and arm64 constants, golang/net hardens ipv4 and ipv6 parsing
By RepoJournal · Filed · About Go · Composed from the cited sources · methodology
A six-commit sweep through golang/net closes a string of slice bounds and control message panics, while the Go compiler stops copying non-escaping append backing stores to the heap.
cmd/compile: don't move a non-escaping slice to the heap golang/go
The slice pass inserted a move2heap whenever a slice variable's exclusive ownership ended, without consulting escape analysis, so an append that did not escape still had its stack backing store copied to the heap. It now skips the optimization for non-escaping appends, removing that copy.
ipv4: fix TTL control message parsing on big-endian Linux and Solaris golang/net
IP_TTL ancillary data on Linux is a 4-byte native-endian int, not a 1-byte value, so reading only the first byte misparsed the TTL as 0 on big-endian architectures; Solaris IP_RECVTTL is a 1-byte uint8_t rather than 4 bytes. Both cases now parse correctly, which matters if you call ControlMessage on a big-endian Linux or Solaris target.
cmd/compile: preload multi-instruction constants before loops on arm64 golang/go
On arm64 a 64-bit constant costing MOVD plus up to three MOVKs was rebuilt on every loop iteration because the register allocator never preloaded rematerializeable values before a loop. The allocator now preloads those constants when a register is free, in the Neoverse N1 case cited in the issue; single-instruction constants are unchanged.
syscall: fix PtracePeek and PtracePoke slicing on AIX golang/go
ptracePeek and ptracePoke advanced the buffer by the cumulative byte count instead of the chunk size, so any AIX transfer larger than 1024 bytes panicked with a slice bounds error on the second chunk. The offsets are now chunk-relative.
ipv6: avoid out-of-bounds panic in ICMPFilter golang/net
ICMPFilter.Accept, Block, and WillBlock indexed an 8-element array with an unchecked ICMPType. They now verify the type falls in [0, 255] first, which closes the out-of-bounds panic reachable from caller-supplied values. The same review pass covered empty control messages on non-Unix platforms like Windows and empty batches or BPF filters on non-Linux, where ReadBatch and WriteBatch now return ...
Revert "internal/postgres: module counts prefer popular packages" golang/pkgsite
The module-counts change that preferred popular packages was reverted from pkgsite's postgres layer: the job ran fast and green, but Jonathan Amsterdam wrote that it "results in huge amounts of replication logs, which pushes the replica CPUs over the alert threshold." The remainder is routine: build now mounts the OpenBSD amd64 environment as async so writes are faster, a reference the OpenBSD ...