bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH]


From: Eli Zaretskii
Subject: Re: [bug-gawk] Behavior of fflush with SIGPIPE on stdout [PATCH]
Date: Sun, 09 Apr 2017 15:07:49 +0300

> Date: Sun, 9 Apr 2017 13:35:10 +0200
> From: <address@hidden>
> CC: <address@hidden>, <address@hidden>
> 
> On 09/04/2017 13:04, Eli Zaretskii wrote:
> >> >  How many of them will stop and not use Google ? Seriously ...
> > Programs don't use Google.  They use values encoded in their source
> > code.
> 
> Aha, here is the mental process of the human writing that source code:

That source code has already been written.  It already runs in ported
programs, such as Guile.  It maps the exit code values returned by
Windows programs which terminated due to a fatal exception, to the
equivalent Posix signal, in order to present useful diagnostic to
their users.  For example, the diagnostic might say "Program gawk
was terminated by a SIGSEGV."

The mapping uses only the EXCEPTION_* exception codes which are
defined in winbase.h.  Those include EXCEPTION_INVALID_HANDLE, but do
not include STATUS_PIPE_BROKEN.

So if Gawk returns 0xC000014B, the programs in question will not be
able to interpret it in any useful way.

Once again, programs that die of fatal exceptions on Windows return as
their exit status a very limited subset of the NTSTATUS values.  Using
any value outside that subset will confuse programs which try to
interpret those exit codes.  I've chosen the value of
EXCEPTION_INVALID_HANDLE because it belongs to that subset.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]