From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21053 invoked from network); 27 May 2022 17:26:11 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 27 May 2022 17:26:11 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1653672371; b=aZeZ0U0fLd2tw3QPOY0OK3lZ8+aMYgRQM2bem13HQpcgZ8xiLY5t3LGZno/xFs08+HyC3IIRex C8yEAoLt1lcRx6Tr/pIKyfNrN++Z5b2Bjr8D7UPNRCofzDLqZjibfIYHu1HprzaT0ZWoBOqpm6 fxUk68ISm3gF3pP+fscHCVNyf8VasehvGmWlWUgGyRUi39XlpocPmQDoflp0D5NN3o7TL4KkwZ bTVp8kVhSAtDZwN+z9ZRXxYVwrFQIaY+GQ+rZYqOyWC5VVxIY1ZccROtpG9YHK37UUvjOu/vSZ zphjobO1QaMINoqlMUpdzEDzHHlL/uF4gcRewOVLgV8VZQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (snd01010-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.26; dmarc=none header.from=kba.biglobe.ne.jp; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1653672371; bh=p8Mvp/epJUg1C6IaT0l2t+2zPj2J7RnfttAoWF0MgPc=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Message-ID:In-Reply-To:To:References:Date:Subject: MIME-Version:Content-Transfer-Encoding:Content-Type:From:DKIM-Signature; b=n7XWA7lE3qGmZY4yn7XOPhiEoGKlAe28eyUk0FCTt7YsERSg0gRTON43LHeSD5OIa7dHuqMtcy GD2NRw1tZ9E9WdzCvQLpV1a7vsMqB+B/UWFXMvPt9xSWKRMr+dEQomkIX6djr3FBMIKHVN7ZjB FYaVeE5DEDWII4s+NYSgg6skh+h/bSfh3gwAWkrehtP4/tUuxklVVwA0YG1KrOz3rtbzu8C7mk 9ICfSike4jjfTWexmVFhvrc/iODLnnBMUio99ZPZm8t0U8Fn0d40fvnh5W8f0ov/VyPrfJDsg2 mvbtY2ppI1rXe+pQ6Sv/3HZwt1+XzNt63FoeYvU9wCllfA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-Id:In-Reply-To:To:References: Date:Subject:Mime-Version:Content-Transfer-Encoding:Content-Type:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=/rrp4oYsd2+z5k3RHfCg9ilpImtX7oANqHLomMByk6s=; b=T5jQSuUjU1zFg/XrQcY/IqLxVL 8OnMYCAMunldKrpOFNUi0q5Gn4Ajkmhyc84w1mlap9JDBK5jpEHnk8MdKMR66ptM3LGkDziqQ4emA HLLp2in161gb8pQX8AwLiOGeMfhRMzt31ORuzxyuPq+WiL180dvdPKLmMm9CHH0FtGHNhIS640z4t rC0UppdEAbBDvoO6B9cJ4Hq2gecR5KyP6LvBWRdiTR/mD7z6ibZFO+C8buqqfyrY5Tr7tKM6KkmHm NNLvuiggGNQZIDflK+y2KWixLPvC19Dx1FJd+C77Jh0sywyY0enTFiWqci3hlziZJvH7ayxZFYeKw tFYHVxxA==; Received: from authenticated user by zero.zsh.org with local id 1nudj1-000BDK-C9; Fri, 27 May 2022 17:26:11 +0000 Authentication-Results: zsh.org; iprev=pass (snd01010-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.26; dmarc=none header.from=kba.biglobe.ne.jp; arc=none Received: from snd01010-bg.im.kddi.ne.jp ([27.86.113.26]:39457 helo=dfmta1022.biglobe.ne.jp) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1nudim-000AtN-In; Fri, 27 May 2022 17:25:58 +0000 Received: from mail.biglobe.ne.jp by omta1022.biglobe.ne.jp with ESMTP id <20220527172551133.ONAU.129400.mail.biglobe.ne.jp@biglobe.ne.jp> for ; Sat, 28 May 2022 02:25:51 +0900 From: "Jun. T" Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Subject: Re: zargs with -P intermittently failing in zsh 5.9 and macOS Date: Sat, 28 May 2022 02:25:49 +0900 References: <9162a41e493cabeb0c8fb7c770f6b35035a0be0e@hey.com> <8CB92976-5B21-4239-844E-93C88EC734F5@kba.biglobe.ne.jp> To: zsh-workers@zsh.org In-Reply-To: Message-Id: <957FB7CE-B2AE-4C22-9CC5-0883B2FAB62D@kba.biglobe.ne.jp> X-Mailer: Apple Mail (2.3696.80.82.1.1) X-Biglobe-Sender: takimoto-j@kba.biglobe.ne.jp X-Seq: 50299 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: > 2022/05/28 1:10=E3=80=81Bart Schaefer = =E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB: >=20 > On Thu, May 26, 2022 at 10:30 PM Jun T = wrote: >>=20 >>=20 >> When 'wait pid' calls getbgstatus(pid), it finds the entry with = status=3D19 >> and returns it. >=20 > Even if it's correct to have two entries, it's wrong to return the > least recent one. Yes, of course, so we need to fix it. >> So I guess we need to call addbgstatus() only if the process has = actually >> exited (or killed). If this is the case, better solution would be >> (B) call addbgstatus() only if WIFEXITED() or WIFSIGNALED() is true. >> This it the patch below. >=20 > Does that really work? I would expect WIFSIGNALED to be true when > each of WIFSTOPPED and WIFCONTINUED is also true, so it wouldn't > change anything? (There isn't any way to stop/continue without using > a signal that I can think of.) I've tried A, B, C, and it seems all of them work in the sense that it solves the current zargs's problem, and 'make check' passes. But I think A is insufficient, as you write. I was thinking B is enough, because: WIFEXITED: has exited spontaneously WIFSIGNALED: has been killed by a signal WIFSTOPPED: still alive but now stoeepd WIFCONTINUED: has been stopped but now continued So these 4 are mutually exclusive. In the case of EXITED/SIGNALED, further call of wait3() will not report the status of the process. So if we call addbgstatus() only for EXITED/SIGNALED, then it records the final state of the process just onece. How do you think? Do you have a Mac for testing? Or we can use both B and C, and add a DPUTS() if addbgstatus() is called more than once for a single pid.=