ksh93/ksh

Occasional "write error" when writing to pipe

ko1nksm opened this issue · 0 comments

It does not occur every time, and seems to occur only on Linux.

Ubuntu 22.04

$ ksh -c 'echo $KSH_VERSION; for i in {1..1000}; do seq 1000000 | head > /dev/null; done'
Version AJM 93u+m/1.1.0-alpha+8f84f4b2 2024-04-05
seq: write error: Connection reset by peer
seq: write error: Connection reset by peer
seq: write error: Broken pipe
seq: write error: Connection reset by peer
seq: write error: Broken pipe

$ ksh -c 'echo $KSH_VERSION; for i in {1..1000}; do yes | head > /dev/null; done'
Version AJM 93u+m/1.1.0-alpha+8f84f4b2 2024-04-05
yes: standard output: Connection reset by peer
yes: standard output: Connection reset by peer
yes: standard output: Connection reset by peer
yes: standard output: Broken pipe
yes: standard output: Connection reset by peer
yes: standard output: Broken pipe
yes: standard output: Connection reset by peer
yes: standard output: Connection reset by peer

This issue is reproduced in ksh93u+.

Ubuntu 18.04

$ ksh -c 'echo $KSH_VERSION; for i in {1..1000}; do seq 1000000 | head > /dev/null; done'
Version AJM 93u+ 2012-08-01
seq: write error: Connection reset by peer
seq: write error: Broken pipe
seq: write error: Connection reset by peer
seq: write error: Connection reset by peer
seq: write error: Broken pipe
seq: write error: Connection reset by peer
seq: write error: Connection reset by peer