Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 830705 - sys-apps/gawk-5.10,5.11-r1: ignores SIGPIPE if wrapped by 'stdbuf -oL'
Summary: sys-apps/gawk-5.10,5.11-r1: ignores SIGPIPE if wrapped by 'stdbuf -oL'
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-06 19:16 UTC by Nikita Zlobin
Modified: 2022-11-22 18:28 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikita Zlobin 2022-01-06 19:16:08 UTC
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?
Comment 1 Nikita Zlobin 2022-01-06 19:44:49 UTC
I forgot about 2nd case with "stdbuf -oL" - when it's used, even fflush() can't fix problem.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-17 01:44:06 UTC
This will need to be reported upstream. Could you do that and share the link here? Thanks.
Comment 3 Nikita Zlobin 2022-07-28 20:36:02 UTC
Reported:
https://lists.gnu.org/archive/html/bug-gawk/2022-07/msg00000.html
Comment 4 Nikita Zlobin 2022-07-29 12:36:11 UTC
Already in upstream master:
http://git.savannah.gnu.org/cgit/gawk.git/commit/?id=b71848d4f6ada1caade4289cc599561392f8be20
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-30 09:04:38 UTC
Excellent! Thank you!
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-30 09:10:58 UTC
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.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-30 09:17:18 UTC
(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
Comment 8 Larry the Git Cow gentoo-dev 2022-11-22 18:28:41 UTC
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(-)