[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH]
From: |
alexandre.ferrieux |
Subject: |
Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH] |
Date: |
Fri, 10 Mar 2017 17:16:59 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111113 Thunderbird/8.0 |
On 10/03/2017 16:23, Andrew J. Schorr wrote:
Hi,
Thanks for these bug reports. I think the basic problem is that
we ignore SIGPIPE and rely upon detecting write errors.
[...]
I guess the fix is probably to add some logic to issue a fatal error
when fflush fails, unless the output file is registered as NONFATAL.
The only question is whether this might break existing code.
A possible patch to the master branch is attached. This will NOT apply
against 4.1.x. Sorry.
Hi Andy,
Thanks a lot, that's exactly what I hoped for :)
Regarding existing code, please bear in mind that those script that rely on this behavior (1) do it only since 2013 ;
(2) are incompatible with other awk implementations and (3) depend in a very sensitive manner in stdio buffer sizes,
since this for a given sequence
print ...
print ...
print ...
fflush(stdout)
... the precise line where the error bursts will vary depending on buffer
filling.
Currently (without your patch), the program will randomly exit (error on print)
or not (error on fflush).
With your patch, the program will reliably exit on any of those lines,
regardless of the tuning of stdio.
Thanks again and looking forward to downstream integration in my distro ;-)
-Alex
_________________________________________________________________________________________________________________________
Ce message et ses pieces jointes peuvent contenir des informations
confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce
message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages
electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou
falsifie. Merci.
This message and its attachments may contain confidential or privileged
information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete
this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been
modified, changed or falsified.
Thank you.
- [bug-gawk] Behavior of fflush with SIGPIPE on stdout, alexandre.ferrieux, 2017/03/07
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout, david kerns, 2017/03/07
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], Andrew J. Schorr, 2017/03/10
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH],
alexandre.ferrieux <=
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], Andrew J. Schorr, 2017/03/10
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], Arnold Robbins, 2017/03/17
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], Andrew J. Schorr, 2017/03/17
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], arnold, 2017/03/19
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], Andrew J. Schorr, 2017/03/19
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], arnold, 2017/03/20
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], Andrew J. Schorr, 2017/03/21
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], arnold, 2017/03/22
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], arnold, 2017/03/23
- Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH], Andrew J. Schorr, 2017/03/23