Skip to content

[NetBSD] 'read' hangs on EOF without final linefeed when reading from FIFO #961

@McDutchie

Description

@McDutchie

There's only one regression test failure left on NetBSD (all versions and architectures), and it's one that can actually affect real-world scripts. It would be really nice if we could fix that before the next release.

test io begins at 2026-04-02+00:08:10
        io.sh[653]: FAIL: 'read' hangs on EOF without final linefeed when reading from FIFO
test io failed at 2026-04-02+00:08:16 with exit code 1 [ 175 tests 1 error ]

It's this test from 9ba2c2e:

# On unpatched ksh on macOS, 'read' used to block when reading from a FIFO and there was no final newline.
if mkfifo "$tmp/fifo_no_lf"
then trap 'sleep_pid=0; kill "$ksh_pid"; err_exit "'\''read'\'' hangs on EOF without final linefeed when reading from FIFO"' TERM
(sleep 1; kill "$$") &
sleep_pid=$!
"$SHELL" -c 'print -n foo >$0 & while read f; do :; done <$0' "$tmp/fifo_no_lf" &
ksh_pid=$!
wait "$ksh_pid"
trap - TERM
((sleep_pid)) && kill "$sleep_pid"
else err_exit "mkfifo failed; cannot test reading from FIFO"
fi

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions