zsh-users
 help / color / mirror / code / Atom feed
From: Wayne Davison <wayned@users.sourceforge.net>
To: Peter Stephenson <pws@csr.com>
Cc: Nicolas Cavigneaux <bounga@altern.org>, zsh-users@sunsite.dk
Subject: Re: Job table full
Date: Tue, 25 May 2004 10:56:05 -0700	[thread overview]
Message-ID: <20040525175605.GD7832@blorf.net> (raw)
In-Reply-To: <7993.1084369229@csr.com>

[-- Attachment #1: Type: text/plain, Size: 807 bytes --]

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..

[-- Attachment #2: zfork.patch --]
[-- Type: text/plain, Size: 361 bytes --]

--- 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;
     }

      parent reply	other threads:[~2004-05-25 17:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-12 12:49 Nicolas Cavigneaux
2004-05-12 13:40 ` Peter Stephenson
2004-05-12 13:52   ` Nicolas Cavigneaux
2004-05-25 17:56   ` Wayne Davison [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040525175605.GD7832@blorf.net \
    --to=wayned@users.sourceforge.net \
    --cc=bounga@altern.org \
    --cc=pws@csr.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).