I got strange issue with gawk, which I confirm for both 5.10 and 5.11-r1. gawk, started as "stdbuf -oL", doesn't terminate after multiple attempts to print to closed pipe after it, although it does so with "stdbuf -o0" or with manual flushing by fflush(). This is important, because zero bufferization worsens performance comparing to line bufferization. Minimal working example: yes | stdbuf -oL gawk '{print}' | head -n1 # Prints but hangs yes | stdbuf -o0 gawk '{print}' | head -n1 # OK yes | gawk '{print; fflush()}' | head -n1 # OK head -n1 process usually disappears. stdbuf is from coreutils-8.32-r1. Does anyone else confirm?
I forgot about 2nd case with "stdbuf -oL" - when it's used, even fflush() can't fix problem.
This will need to be reported upstream. Could you do that and share the link here? Thanks.
Reported: https://lists.gnu.org/archive/html/bug-gawk/2022-07/msg00000.html
Already in upstream master: http://git.savannah.gnu.org/cgit/gawk.git/commit/?id=b71848d4f6ada1caade4289cc599561392f8be20
Excellent! Thank you!
The patch doesn't apply cleanly so I've requested a new release as it feels possibly overdue. If they don't plan one soon, I'll backport.
(In reply to Sam James from comment #6) > The patch doesn't apply cleanly so I've requested a new release as it feels > possibly overdue. > > If they don't plan one soon, I'll backport. https://lists.gnu.org/archive/html/bug-gawk/2022-07/msg00007.html
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad0c972c895767e1432cfcc3d0d1a8d380eafbea commit ad0c972c895767e1432cfcc3d0d1a8d380eafbea Author: Sam James <sam@gentoo.org> AuthorDate: 2022-11-22 18:27:59 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-11-22 18:28:11 +0000 sys-apps/gawk: add 5.2.1, drop 5.2.1_beta Closes: https://bugs.gentoo.org/830705 Closes: https://bugs.gentoo.org/868522 Closes: https://bugs.gentoo.org/868567 Signed-off-by: Sam James <sam@gentoo.org> sys-apps/gawk/Manifest | 3 ++- sys-apps/gawk/{gawk-5.2.1_beta.ebuild => gawk-5.2.1.ebuild} | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)