From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22036 invoked by alias); 26 Oct 2013 16:58:33 -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: 31903 Received: (qmail 27409 invoked from network); 26 Oct 2013 16:58:17 -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: <131026095746.ZM8910@torch.brasslantern.com> Date: Sat, 26 Oct 2013 09:57:46 -0700 In-reply-to: <131026004551.ZM32043@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: Not quite out of the pipestatus woods yet ..." (Oct 26, 12:45am) References: <131025162543.ZM7466@torch.brasslantern.com> <131026004551.ZM32043@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: Not quite out of the pipestatus woods yet ... MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Oct 26, 12:45am, Bart Schaefer wrote: } } I think it has something to do with the oldjobtab / jobtab switching, but } have not yet confirmed. Yes, this definitely it. [[ DO NOT APPLY THIS DIFF AS A PATCH. Included for explanation only. ]] diff --git a/Src/jobs.c b/Src/jobs.c index c218743..d5e316f 100644 --- a/Src/jobs.c +++ b/Src/jobs.c @@ -945,6 +945,13 @@ printjob(Job jn, int lng, int synch) job = jn - oldjobtab; else job = jn - jobtab; + /* + DPUTS3(job < 0 || job > maxjob, + "bogus job number, jn = %L, jobtab = %L, oldjobtab = %L", + (long)jn, (long)jobtab, (long)oldjobtab); + */ + if (job < 0 || job > maxjob) + job = jn - jobtab; if (jn->stat & STAT_NOPRINT) { skip_print = 1; With this code change, the stress test never prints the wrong $pipestatus, regardless of the order of signals arriving. HOWEVER, with the "setopt MONITOR" added before the stress test, I have had the shell go into a fast busy in acquire_pgrp() -- the while loop condition never becomes false but the shell never gets SIGT* either. I think that's a separate problem, but: PWS, do you remember enough about why there is an assumption that oldjobtab never needs to be set back to NULL once it has been created? Or is this just a case of not realizing that printjob() has multiple responsibilities, including the reaping of old jobs?