Repository navigation
v0.5.8 "Meson"
Fixed
- A FIFO read to its end on macOS no longer waits for good (issue #58). kqueue never reports
that a named FIFO's writer closed once its reader drained it: XNU's FIFO read filter fires only
while bytes are there and never setsEV_EOF(Go keeps FIFOs out of kqueue on darwin for it,
golang/go#24164). A read whose last call drained the FIFO before the writer closed waited for
an edge that never came; it showed as a rare hang of
fs::tests::a_fifo_opened_as_a_file_is_watched_by_the_pollerand, with a writer that waits
before it closes, a hang every time. On Apple systems a read side of a named FIFO that waits
for its next edge now also looks again on a timer: 1 ms after it blocked, twice as long after
each look that finds nothing, up to 64 ms, and from 1 ms again once an edge brings bytes. Bytes
still come at the edge; the end is seen at most 64 ms after it came. This covers aFileon a
FIFO, a pipeReceiveropened from one, and a caller's own reads throughreadableand
try_read. An anonymous pipe, whose end kqueue does report, is left as it was; other systems
are unchanged. The waits' bounds are proved inproofs/lean/Nuclei/FifoLook.lean; the tests
close the writer 100 ms after its write, once the reader waits. - Requires kovan 0.2.5, which orders a reader's reads before the free of what it read. kovan
0.2.4's reclamation rested on memory orderings that Rust's memory model does not give: a retire's
scan could skip a thread's slot with nothing ordering that thread's reads of a value before the
value's free. Miri reports it as a data race between a read under a guard and the free, and
kovan's model of ARM's load buffering reads freed memory in two of the cases; on x86-64 the
hardware's own ordering kept 0.2.4 from it. kovan 0.2.5 fixes five such orderings (the leave's
tag, the protected load, the thread count a scan reads, the next pin's store after an escalated
load, and the fence of a pin answered by a helper), with no instruction added on x86-64's pin,
load and drop paths. Everything nuclei keeps in kovan (the channels, the maps, the queues, the
values behindwatch) is read through those paths. No public API of nuclei or of kovan changed.
Tests: kovan'stests/atom_reader_reclaim.rs, which Miri runs over 16 seeds.
Changes
Full diff: v0.5.7...v0.5.8