[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] GNU Libc2.27 and stdio streams
From: |
arnold |
Subject: |
Re: [bug-gawk] GNU Libc2.27 and stdio streams |
Date: |
Sat, 10 Feb 2018 10:53:48 -0700 |
User-agent: |
Heirloom mailx 12.4 7/29/08 |
Hi Nelson.
The discussion here was about adding an "abort" statement to gawk that
would be like "exit", but would not run the END rules.
HOWEVER, your information about 2.27 is helpful; I have added
fflush(NULL) in front of each actual abort() call in the code and
will push the change out soon.
Thanks!
Arnold
"Nelson H. F. Beebe" <address@hidden> wrote:
> A posting on the address@hidden list a few minutes ago reported:
>
> >> ...
> >> As Gnu libc 2.27 comes online, keep aware that [it] no longer attempts
> >> to flush stdio streams on abort. I wonder if this `might' affect
> >> Guile error messages that occur at abort.
> >> ...
>
> There have been several recent discussions on the bug-gawk list about
> the abort() call, so that heads-up might require a small defensive
> coding response.
>
> I suppose that some might view an abort() call mean to "get me out of
> here, NOW! and I don't care how you do, just DO IT".
>
> On the other hand, output buffer flushing is likely usually harmless,
> and reduces user surprise. Perhaps the glibc developer list should be
> consulted to understand why they made that change.
>
> I checked my copy of POSIX (the IEEE Std 1003.1-2001 version), and
> found little mention of abort(), and nothing on its desired behavior.
>
> Here is what a 2007 draft of the ISO C Standard (ISO/IEC 9899:TC3)
> says:
>
> >> ...
> >> 7.20.4.1 The abort function
> >> Synopsis
> >> 1 #include <stdlib.h>
> >> void abort(void);
> >> Description
> >> 2 The abort function causes abnormal program termination to occur,
> >> unless the signal
> >> SIGABRT is being caught and the signal handler does not return.
> >> Whether open streams
> >> with unwritten buffered data are flushed, open streams are closed, or
> >> temporary files are
> >> removed is implementation-defined. An implementation-defined form of
> >> the status
> >> unsuccessful termination is returned to the host environment by means
> >> of the function
> >> call raise(SIGABRT).
> >> Returns
> >> 3 The abort function does not return to its caller.
> >> ...
>
> Thus, the glibc changes are standard conforming in this area.
>
> -------------------------------------------------------------------------------
> - Nelson H. F. Beebe Tel: +1 801 581 5254
> -
> - University of Utah FAX: +1 801 581 4148
> -
> - Department of Mathematics, 110 LCB Internet e-mail: address@hidden -
> - 155 S 1400 E RM 233 address@hidden address@hidden -
> - Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beebe/
> -
> -------------------------------------------------------------------------------