bug-gawk
[Top][All Lists]
Advanced

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

Re: gawk 5.2.2 fatal crash when closing a two-way pipe for a process tha


From: Finn Magnusson
Subject: Re: gawk 5.2.2 fatal crash when closing a two-way pipe for a process that does not have a pid anymore
Date: Thu, 24 Aug 2023 13:31:24 +0000 (UTC)

 HiI wish I could manage to reproduce the issue with a simple recipe.But 
whichever way I try to close the process associated with the two-way pipe, it 
stays as a defunct process and then the issue does not occur.The only way I get 
the issue is in my program where I start a two-way pipe toward a ssh client 
which opens to a netconf session on a remote machine. On the remote machine, I 
issue a command to close the netconf session. This causes the ssh client to 
close down completely on my machine and no defunct process remains. Then when 
using the close() function in gawk to close the two-way pipe it crashes because 
the ssh client process does not exist anymore, not even as a defunct process.So 
that is not so easy to reproduce outside of my environment since the netconf 
server that I use is a proprietary system here at the company where I work. In 
case you make a fix I can always try it in my environment and let you know 
whether it solved the issue.If that is not satisfactory then feel free to 
discard this bug report until I found a way to reproduce it that could be done 
in any environment.Many thanks.BRFinn
    On Thursday, August 24, 2023 at 03:06:37 PM GMT+2, Andrew J. Schorr 
<aschorr@telemetry-investments.com> wrote:  
 
 Hi,

Thanks for the bug report. Can you please provide a simple recipe
for how to reproduce this problem?

Thanks,
Andy

On Thu, Aug 24, 2023 at 09:56:54AM +0000, Finn Magnusson via Bug reports only 
for gawk. wrote:
>  Dear gawk developers
> I noticed the below issue in gawk 5.2.2 which was not present in previous 
> gawk version I was using (5.1.1): when using the close() function to close a 
> two-way pipe to a process that does not have a PID anymore (e.g. due to the 
> process got closed by an external command), then I got the below fatal crash: 
> gawk.lin64: /app/moshell/23.2h/moshell/prog.awk:19919: fatal: flush to 
> "/app/moshell/23.2h/moshell/commonjars/ssh.lin64 -p 2022 -z 
> '/proj/wcdma-userarea/users/eanzmagn/moshell_logfiles/logs_moshell/tempfiles/20230824-114538_6552/sshz6592'
>  -l expert -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o 
> HostKeyAlgorithms="ssh-dss,ssh-rsa,rsa-sha2-512,rsa-sha2-256" -o 
> NumberOfPasswordPrompts=1 -o ConnectTimeout=10 -o ServerAliveInterval=300 -o 
> ConnectionAttempts=1 -o ServerAliveCountMax=0 -o TCPKeepAlive=no -o 
> PreferredAuthentications=publickey,password 10.136.72.120 -s netconf 2>&1" 
> failed: reason unknown
> 
> I was able to solve it by commenting out the below efflush statement in 
> gawk-5.2.2/io.c :  /* flush before closing to leverage special error handling 
> */ efflush(rp->output.fp, "flush", rp);
> Is it possible to make a fix for this in a coming gawk release?
> Many thanks.BRFinn
  

reply via email to

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