NetBSD-Bugs archive

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

Re: bin/57053: continuation problem in shell pipelines



The following reply was made to PR bin/57053; it has been noted by GNATS.

From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: bin/57053: continuation problem in shell pipelines
Date: Wed, 12 Oct 2022 20:31:01 +0700

 As I indicated in the e-mail exchange that preceded this PR, the
 issue with /bin/sh is completely different, and unrelated to the
 problem being observed with zsh.
 
 sh is failing to find the process to restart - I know why that is,
 and it had already been fixed (not yet committed) before this issue
 was reported.
 
 zsh is restarting the job, after which it stops again.   That will
 be a process group related issue - when restarting a job, the controlling
 tty needs to have its pgrp changed to the pgrp of the job being given
 control (otherwise when less attempts the ioctl to change the modes of
 the terminal back to cbreak mode (or what used to be called that), the
 process will stop).
 
 Either zsh isn't using the correct method to change the tty pgrp, or
 isn't doing it quickly enough.   Since it used to work (and is an old
 binary apparently) the only explanation for the former I can think of
 would be if zsh is adapting its behaviour based upon the kernel version
 (ioctls are one of the few userland interfaces where that makes sense)
 and has been confused by the change to 9.99.100.
 
 Perhaps someone who knows the zsh sources might be able to check that out.
 
 The latter would indicate that the timings have changed somehow, though
 I am having trouble imaging a change which could cause that - maybe it
 used to be that after sending a signal, the process kept running, and
 zsh is doing things in the wrong order - sending SIGCONT before changing
 the tty pgrp - and now the awoken process is getting to run before the
 parent (zsh) gets a chance to continue, so the child (less) is starting
 while the tty pgrp still belongs to zsh.
 
 FWIW in addition to the shells that others mentioned, I also tested
 the FreeBSD sh (running on NetBSD) dash yash bosh and mksh, and they
 all work fine as well.   The pgrp problem is not a problem with /bin/sh
 either, once its "find the process" problem is fixed.
 
 kre
 


Home | Main Index | Thread Index | Old Index