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 28904 invoked from network); 26 May 2022 08:58:07 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 26 May 2022 08:58:07 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1653555488; b=EmosBr95ja8N3yYm0nC0lQfQJpngh41C0shVDt4N8NxWkz5k3/zApvURfjGQvrIoRrGIk7bUnY vW2MGlW5wzntCwjzBCQy6c6jQQMXpI+Pa4Qm0W5fksYMK79sQpd9xWQ+B75wmUBGfi3HvPnmqx Q8hmzFDVsN94OVxirU20u3r1JzeJLM9elJR5RED5xbS2yjclV6lKIsV9uuDxxghirXMNq0Erkg C5BVx2aXpJyNogAY+mHk1tvm4p+B5mHwk0JXLX9Z7qslkRqQVvE7p3849hOxgNpVIIWai8T9yG q+aAeU5wW+R2PbS9qE4totKDe5ezt4sU+eVEvdm8OYty+w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (snd00006-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.6; 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=1653555488; bh=OhBYAUAGeDi44PYz5qfrZ5Twb5I54Hwl/uQFlk6tt0c=; 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=rVFnMZkuT9WJBApj90J116taSSb720MjffXY5DWp6Hp2GvPtn3kDuYS3zwX0m4VExCevFoWM3R 50oui/bZoZAtWiN/m7go1EifIbK6l5wkN4LCSbuxet2v/S+OqKyCaYID38Lt5JDqtqOkxvNWsP tD7GtwOi/QcyhUFs1HFdiKi5DrHz1gl2JrYMZnJ3su+ctRL4xjN9TegT8s92KUgWb2a1LVrAMz VzpKM1ypMRjoY2UxujVwoe3FMOA7aclJMS8WyVZzTa8vb4RrmgxnFqGYmH/miLTWsoqpoS7xZG cB+IRHv7mg9lgLf+ub3gqLLqIHdqfkB3A78g/JhdcwI1gg==; 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=wQEJz5MF1/L1DOfBIWjVB28vF7rC/qDKSHbSMzVjP/g=; b=gqYgFoa+7tn6cOdTnQAFjgLg1d OfE+MShn4sKICQf1OsH6IrLDafSe3rJdqH2V4MueMuvSgNQqI5tbYf22VieumY5Kjb5l9sHm9R6ax qmkvva3VF1He4gw+5+lfnN3JkaZMDBnk7QhFWeAxFhHlNtZj9eO48DInrLlCqTuD++xySdaYwKIKa vLNr7gt2XI1cJm1/9GYdjb4OdAIDEb2vMyrTQ51S4u/fWFhCUIYryZ54LTuPBd23DnX3151x4pjs3 YS5BHFEq4NeS+DlcAbrYVv9UqLU3a2o1HOkbV54imkiEiN4xL0VzsFs/58tVw3GtYz6JZStY4/WpV VI2PM/Cw==; Received: from authenticated user by zero.zsh.org with local id 1nu9Jm-000ErW-OK; Thu, 26 May 2022 08:58:06 +0000 Authentication-Results: zsh.org; iprev=pass (snd00006-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.6; dmarc=none header.from=kba.biglobe.ne.jp; arc=none Received: from snd00006-bg.im.kddi.ne.jp ([27.86.113.6]:39457 helo=dfmta0014.biglobe.ne.jp) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1nu9JW-000EW3-79; Thu, 26 May 2022 08:57:52 +0000 Received: from mail.biglobe.ne.jp by omta0014.biglobe.ne.jp with ESMTP id <20220526085746360.OMNZ.61979.mail.biglobe.ne.jp@biglobe.ne.jp> for ; Thu, 26 May 2022 17:57:46 +0900 From: Jun T Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: zargs with -P intermittently failing in zsh 5.9 and macOS Date: Thu, 26 May 2022 17:57:45 +0900 References: <9162a41e493cabeb0c8fb7c770f6b35035a0be0e@hey.com> To: zsh-workers@zsh.org In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3445.104.21) X-Biglobe-Sender: takimoto-j@kba.biglobe.ne.jp X-Seq: 50291 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/25 2:32, Bart Schaefer wrote: > >> +(eval):6> case 19 (<1-125>|128) >> +(eval):8> ret=123 >> >> at least once, even though f always returned 0. > > Something is causing the subshell that was running f to exit with > status 19 even though f returned 0. The problem can be reproduced by the following simplified script: #!/bin/zsh _zajobs=() ( # works OK if not run in a subshell np=10 # try increasing this if you do not get $? = 19 for ((i=0; i<$np; ++i)); do curl -so /dev/null 'https://example.com' & _zajobs+=( $! ) done #sleep 1 # works OK if 'sleep 1' is added here wait # works OK if this line is commented out for p in $_zajobs; do wait $p echo $p $? done ) If I run this script on my Mac, a few (one or two in most cases, zero or three sometimes) of the ten "wait $p" give $? = 19. But all the "wait $p" return 0 if (1) remove the "wait" before the "for p in $_zajobs", or (2) add "sleep 1" before the "wait", or (3) run whole script in the main shell, i.e., remove the enclosing "(" and ")", or (4) replace "curl -so /dev/null 'https://example.com'" by "sleep 1", or (5) run the script on Linux (I haven't tried other BSDs). (1)(2) may indicate that the first "wait" (without $p) can't correctly wait for some of the child procs...?