From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5822 invoked by alias); 13 Jun 2011 00:03:00 -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: 29475 Received: (qmail 18436 invoked from network); 13 Jun 2011 00:02:56 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.161.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=eLEd9J+aMtFzxX6sHvWw3yE1gJIInSuH2HzoR+yUdDk=; b=xt2pxMc9g6VdY/flq6l2TCgO6IhYdJB1p4G8FuoPCjMxrqhd7yrcYiCcD4cSgeuPHx 8JLiTQdh8YmBcNjG63LJHssYqIVAy5wCt1QRYYqizuKyno05FhKJZqYxp8Dupk9rTdkw kuGJQygYO3rDtZWQBK04pkkKPjVc7Wo/9wlPM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=lM4hUwWCrOoH3vvWkMyjvP7kC8268datVufVsEDIId93ODb+YvTUNzRwutrCA00cQe NgDNUacryHUGZSlRyaJmtXZKknV7guzMZrtAmMIBNP3QSod4tTCcuLeFxYgGWWYlMjHT UWYPq5+JaoDUTVuDrjNjQC2apl3WbmoJHhR30= From: Pan Tsu To: Bart Schaefer Cc: zsh-workers@zsh.org Subject: Re: killing suspended jobs makes zsh hang after 47d1215 References: <86aadnwtl2.fsf@gmail.com> <110612072211.ZM26399@torch.brasslantern.com> <110612075958.ZM27334@torch.brasslantern.com> Date: Mon, 13 Jun 2011 04:02:43 +0400 In-Reply-To: <110612075958.ZM27334@torch.brasslantern.com> (Bart Schaefer's message of "Sun, 12 Jun 2011 07:59:57 -0700") Message-ID: <8662oaha3g.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Bart Schaefer writes: > On Jun 12, 7:22am, Bart Schaefer wrote: > } > } ---------------------------- > } revision 1.80 > } date: 2011/04/01 11:02:16; author: pws; state: Exp; lines: +18 -1 > } Stef van Vlierberghe: 28965 (as posted in 28967): > } findproc() should not return processes not marked as SP_RUNNING > } ---------------------------- > } > } Evidently there are in fact cases where we need to find jobs that are > } not running. > > The specific bug is fixed by the patch below, but I wonder if there are > other job status that need to be tested here as well. After playing a bit more with pn->status... % cat | cat & [1] 91580 97756 [1] + suspended (tty input) cat | cat % % [1] + continued cat | cat ^C load: 0.06 no foreground process group or when less(1) in `cat /dev/random | less' pipeline exits before cat(1) is done Breakpoint 1, findproc (pid=97756, jptr=0x7fffffff4c08, pptr=0x7fffffff4c00, aux=0) at jobs.c:192 192 if (pn->pid == pid && pn->status == SP_RUNNING) { (gdb) p pn->status $1 = 19 (gdb) p WIFSIGNALED(pn->status) $2 = 1 (gdb) bt #0 findproc (pid=97756, jptr=0x7fffffff4c08, pptr=0x7fffffff4c00, aux=0) at jobs.c:192 #1 0x000000000047d83c in wait_for_processes () at signals.c:493 #2 0x000000000047d9f4 in zhandler (sig=20) at signals.c:584 #3 0x00007ffffffff003 in ?? () #4 0x000000000047d900 in wait_for_processes () at signals.c:524 #5 0x00000000004481e8 in zwaitjob (job=1, wait_cmd=0) at jobs.c:1317 #6 0x0000000000448390 in waitjobs () at jobs.c:1362 #7 0x000000000044a1d9 in bin_fg (name=0x80f318738 "fg", argv=0x7fffffff52c0, ops=0x7fffffff5390, func=2) at jobs.c:2058 #8 0x000000000040ed73 in execbuiltin (args=0x80f318700, bn=0x6af3c0) at builtin.c:450 #9 0x000000000042ab5d in execcmd (state=0x7fffffff59a0, input=0, output=0, how=2, last1=2) at exec.c:3182 #10 0x00000000004265a0 in execpline2 (state=0x7fffffff59a0, pcode=195, how=18, input=0, output=0, last1=0) at exec.c:1640 #11 0x0000000000425aef in execpline (state=0x7fffffff59a0, slcode=3074, how=18, last1=0) at exec.c:1424 #12 0x000000000042531e in execlist (state=0x7fffffff59a0, dont_change_job=0, exiting=0) at exec.c:1207 #13 0x0000000000424d63 in execode (p=0x80f318660, dont_change_job=0, exiting=0, context=0x49b217 "toplevel") at exec.c:1028 #14 0x00000000004412f3 in loop (toplevel=1, justonce=0) at init.c:185 #15 0x000000000044431d in zsh_main (argc=2, argv=0x7fffffff5b00) at init.c:1528 #16 0x000000000040e12b in main (argc=2, argv=0x7fffffff5b00) at ./main.c:93