From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1212 invoked by alias); 24 Oct 2013 16:39:38 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31886 Received: (qmail 503 invoked from network); 24 Oct 2013 16:39:31 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <131024093930.ZM28329@torch.brasslantern.com> Date: Thu, 24 Oct 2013 09:39:29 -0700 In-reply-to: <20131024164829.55842279@pwslap01u.europe.root.pri> Comments: In reply to Peter Stephenson "Re: Strange function/pipestatus behavior, maybe a scope bug?" (Oct 24, 4:48pm) References: <20131023092155.5ba8a54b@pwslap01u.europe.root.pri> <20131023221412.5cdecd76@pws-pc.ntlworld.com> <131023221548.ZM2352@torch.brasslantern.com> <20131024095713.44d2982e@pwslap01u.europe.root.pri> <20131024164829.55842279@pwslap01u.europe.root.pri> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: Strange function/pipestatus behavior, maybe a scope bug? MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Oct 24, 4:48pm, Peter Stephenson wrote: } Subject: Re: Strange function/pipestatus behavior, maybe a scope bug? } } I can't see any problem here, which might not be too surprising if it's } a race, but I don't see how the following fix can be wrong if pipestatus } is now working: the most complicated case appears to be if it gets } called multiple times and STAT_CURSH is set, but even there it looks } like it's idempotent with respect to lastval (assuming the information } hasn't changed, of course). Unfortunately (see my patch which crossed in the mail with yours) there are cases where updating lastval both from update_job() and then again from print_job() will in fact end up with the wrong lastval. You have to run some pipelines both with and without PIPEFAIL set to see this. } I don't know if this potentially makes one of the calls removable. I *suspect* that the call in update_job() is removable, but I got inconsistent results from testing it both ways (hence my conclusion that there's still a signal handling race).