From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9999 invoked from network); 25 May 2004 17:56:58 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.86) by ns1.primenet.com.au with SMTP; 25 May 2004 17:56:58 -0000 Received: (qmail 29513 invoked from network); 25 May 2004 17:56:23 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 25 May 2004 17:56:23 -0000 Received: (qmail 17578 invoked by alias); 25 May 2004 17:56:15 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7476 Received: (qmail 17565 invoked from network); 25 May 2004 17:56:14 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by sunsite.dk with SMTP; 25 May 2004 17:56:11 -0000 Received: (qmail 28840 invoked from network); 25 May 2004 17:56:11 -0000 Received: from dsl3-63-249-88-2.cruzio.com (HELO binome.blorf.net) (63.249.88.2) by a.mx.sunsite.dk with SMTP; 25 May 2004 17:56:09 -0000 Received: by binome.blorf.net (Postfix, from userid 1000) id 851106F6; Tue, 25 May 2004 10:56:05 -0700 (PDT) Date: Tue, 25 May 2004 10:56:05 -0700 From: Wayne Davison To: Peter Stephenson Cc: Nicolas Cavigneaux , zsh-users@sunsite.dk Subject: Re: Job table full Message-ID: <20040525175605.GD7832@blorf.net> References: <7993.1084369229@csr.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="zYM0uCDKw75PZbzx" Content-Disposition: inline In-Reply-To: <7993.1084369229@csr.com> User-Agent: Mutt/1.5.5.1+cvs20040105i X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-0.0 required=6.0 tests=BAYES_44 autolearn=no version=2.63 X-Spam-Hits: -0.0 --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, May 12, 2004 at 02:40:29PM +0100, Peter Stephenson wrote: > A reliable way of reproducing it would help. It's pretty easy: zsh -f preexec() { x=`echo hi` } sleep 1 & : [execute any 20 commands] The problem appears to be that, after the job-control run, the value of "thisjob" in the preexec() function becomes -1. This comparison then fails due to a signed/unsigned mismatch: if (thisjob >= jobtabsize - 1 && !expandjobtab()) { This -1 value for "thisjob" only seems to affect a fork in preexec() (running normal commands doesn't call zfork() with thisjob set to -1). I fixed the problem by simply adding an "(int)" cast in front of the jobtabsize value, but perhaps the value of "thisjob" should really be fixed so that it doesn't get left at -1? ..wayne.. --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="zfork.patch" --- Src/exec.c 21 May 2004 11:19:30 -0000 1.62 +++ Src/exec.c 25 May 2004 17:51:40 -0000 @@ -219,7 +219,7 @@ zfork(void) /* * Is anybody willing to explain this test? */ - if (thisjob >= jobtabsize - 1 && !expandjobtab()) { + if (thisjob >= (int)jobtabsize - 1 && !expandjobtab()) { zerr("job table full", NULL, 0); return -1; } --zYM0uCDKw75PZbzx--