Jon Turney <[email protected]> wrote:
>> The patch introduces general error handling in gentls_offsets. Explicit
>> validation for the presence of gawk is no longer required. gawk has been
>> utilizing 'exit', which might lead to broken pipes in the current
>> implementation. When 'exit' is triggered, gawk finishes the process,
>> however the upstream command might still be active. This has been resolved
>> by avoiding the use of 'exit' in gawk.
>
> Hmmm... a little bit confused to what 'in the current implementation' is
> referring to here?
The current script utilizes a pattern when piping is used and gawk uses exit
to interrupt the gawk execution.
Here is a small repro case
(set -eo pipefail; (echo 1; sleep 1; echo 2) | gawk "{print $@;
exit;}"; echo Test)
'(echo 1; sleep 1; echo 2)' emulates behaviour for the compiler call
that might take some time.
${CXXCOMPILE} -E -P "${input_file}" 2> /dev/null
'gawk "{print $@; exit;}"' exits after the first line parsing and
closing the pipe.
Because 'set -eo pipefail' has been used and the upstream will try to
send another line
to the pipe, it interrupts the execution and 'echo Test' will not be called.
The issue has been fixed by avoiding exit in gawk in such a pattern.
> You previously wrote 'there is an issue with broken pipes on aarch64'
>
> Is this a general consequence of turning on pipefail?
>
> Or is there some aarch64-specific bug this is working around (in which
> case, I'm not sure this is suitable for applying, since... we'll need
> some reminder to fix it eventually :) )
It was an expectation that the issue related only to aarch64, however
it looks like that after enabling "set -eo pipefail" all architectures
should be impacted.
Regards,
Evgeny