[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gawk: sigpipe1.awk:7: fatal: print to "yes | true" failed: Broken pi
From: |
arnold |
Subject: |
Re: gawk: sigpipe1.awk:7: fatal: print to "yes | true" failed: Broken pipe |
Date: |
Wed, 13 Dec 2023 05:28:48 -0700 |
User-agent: |
Heirloom mailx 12.5 7/5/10 |
> >> On Dez 12 2023, arnold@skeeve.com wrote:
> >>
> >> > It's inherently racy; the SIGPIPE handling is done around calls
> >> > to stdio's popen(), which does fork+exec. I just took a look at
> >> > the code and I don't see that there is anything else I can do.
> >>
> >> You could just use an empty signal handler, which is not inherited
> >> across exec.
> >
> > I don't understand what you mean. Can you show me some code?
>
> void ignore_sigpipe (int sig) { }
Hmmm.... Gawk runs with signal(SIGPIPE, SIG_IGN), resetting to
SIG_DFL right before popen() and then back to SIG_IGN afterwards,
relying on EPIPE instead to detect errors.
If I put the above into place before the popen() and then go
back to SIG_IGN afterwards, that hopefully cloes the window
where a SIGPIPE could arrive and do damage.
At least, I think that's how I understand what would be going on.
I will make a change like that and see if anything breaks, and
if not I'll post a patch for review.
Thanks,
Arnold
- Re: gawk: sigpipe1.awk:7: fatal: print to "yes | true" failed: Broken pipe, (continued)
- Re: gawk: sigpipe1.awk:7: fatal: print to "yes | true" failed: Broken pipe, arnold, 2023/12/11
- Re: gawk: sigpipe1.awk:7: fatal: print to "yes | true" failed: Broken pipe, arnold, 2023/12/11
- Re: gawk: sigpipe1.awk:7: fatal: print to "yes | true" failed: Broken pipe, Andreas Schwab, 2023/12/12
- Re: gawk: sigpipe1.awk:7: fatal: print to "yes | true" failed: Broken pipe, arnold, 2023/12/12
- Re: gawk: sigpipe1.awk:7: fatal: print to "yes | true" failed: Broken pipe, Andreas Schwab, 2023/12/12
- Re: gawk: sigpipe1.awk:7: fatal: print to "yes | true" failed: Broken pipe, arnold, 2023/12/12
- Re: gawk: sigpipe1.awk:7: fatal: print to "yes | true" failed: Broken pipe, Andreas Schwab, 2023/12/13
- Re: gawk: sigpipe1.awk:7: fatal: print to "yes | true" failed: Broken pipe, arnold, 2023/12/13
- Re: gawk: sigpipe1.awk:7: fatal: print to "yes | true" failed: Broken pipe, Andreas Schwab, 2023/12/13
- Re: gawk: sigpipe1.awk:7: fatal: print to "yes | true" failed: Broken pipe,
arnold <=
- Re: gawk: sigpipe1.awk:7: fatal: print to "yes | true" failed: Broken pipe, arnold, 2023/12/13