zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: bug in zsh wait builtin - rhbz#1150541
Date: Sat, 25 Oct 2014 15:28:27 -0700	[thread overview]
Message-ID: <141025152827.ZM7060@torch.brasslantern.com> (raw)
In-Reply-To: <20141025200847.782316a4@pws-pc.ntlworld.com>

On Oct 25,  8:08pm, Peter Stephenson wrote:
}
} Here's an implementation.  I've given it the obvious finger test, but
} there may be some more stressful tests we could apply.

I've run "make check" on this patch twice now and gotten different
numbers of silent failure each time -- 8 the first time (with 3 core
files) and 7 the second time (2 core files) so it's probably a race
condition.

In all core dumps the "jn" pointer is NULL in wait_for_processes().  Here
are two sample backtraces, though they're not very helpful.

#0  0x080b7085 in wait_for_processes () at ../../zsh-5.0/Src/signals.c:537
537             if (!(jn->stat & (STAT_CURSH|STAT_BUILTIN)) && jn - jobtab !=
thisjob)
(gdb) p jn
$1 = 0x0
(gdb) where
#0  0x080b7085 in wait_for_processes () at ../../zsh-5.0/Src/signals.c:537
#1  0x080b726c in zhandler (sig=17) at ../../zsh-5.0/Src/signals.c:600
#2  <signal handler called>
#3  0x0086e7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#4  0x008afe8c in sigsuspend () from /lib/tls/libc.so.6
#5  0x080b6dba in signal_suspend (sig=17, wait_cmd=0)
    at ../../zsh-5.0/Src/signals.c:375
#6  0x08084ea2 in waitforpid (pid=27019, wait_cmd=0)
    at ../../zsh-5.0/Src/jobs.c:1402
#7  0x0806982f in getoutput (cmd=0xb7daf7c2 "diff \"$@\"", qt=1)
    at ../../zsh-5.0/Src/exec.c:3862


(gdb) where
#0  0x080b7085 in wait_for_processes () at ../../zsh-5.0/Src/signals.c:537
#1  0x080b726c in zhandler (sig=17) at ../../zsh-5.0/Src/signals.c:600
#2  <signal handler called>
#3  0x0086e7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#4  0x008afe8c in sigsuspend () from /lib/tls/libc.so.6
#5  0x080b6dba in signal_suspend (sig=17, wait_cmd=0)
    at ../../zsh-5.0/Src/signals.c:375
#6  0x08085199 in zwaitjob (job=6, wait_cmd=0) at ../../zsh-5.0/Src/jobs.c:1454
#7  0x08085372 in waitjobs () at ../../zsh-5.0/Src/jobs.c:1499
#8  0x080637f2 in execpline (state=0xbffb4380, slcode=4098, how=18, last1=0)
    at ../../zsh-5.0/Src/exec.c:1561
#9  0x08062cf6 in execlist (state=0xbffb4380, dont_change_job=1, exiting=0)
    at ../../zsh-5.0/Src/exec.c:1268
#10 0x0806272e in execode (p=0xb7d43a30, dont_change_job=1, exiting=0, 
    context=0x813a2f7 "eval") at ../../zsh-5.0/Src/exec.c:1074
#11 0x0805b5a2 in eval (argv=0xb7d43770) at ../../zsh-5.0/Src/builtin.c:5043
#12 0x0805bae1 in bin_eval (nam=0xb7d436e0 "eval", argv=0xb7d43770, 
    ops=0xbffb4470, func=14) at ../../zsh-5.0/Src/builtin.c:5208


  parent reply	other threads:[~2014-10-25 22:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-21  7:53 Tim Speetjens
2014-10-21 20:02 ` Peter Stephenson
2014-10-22  6:55   ` Bart Schaefer
     [not found]     ` <CAO7vJOjrb=N3xuTJVSb7U8mdXtexYp8nN4YaoknfUb3fofU2zg@mail.gmail.com>
2014-10-22 15:48       ` Bart Schaefer
2014-10-22 18:32     ` Chet Ramey
2014-10-23  8:32     ` Peter Stephenson
2014-10-24  4:50       ` Bart Schaefer
2014-10-24  8:04         ` Tim Speetjens
2014-10-25 19:08         ` Peter Stephenson
2014-10-25 21:54           ` Bart Schaefer
2014-10-25 22:28           ` Bart Schaefer [this message]
2014-10-25 22:32             ` Bart Schaefer
2014-10-25 23:04               ` Peter Stephenson
2014-10-25 23:17                 ` Peter Stephenson
2014-10-26 19:01                   ` Peter Stephenson
2014-10-26 20:41                     ` Bart Schaefer
2014-10-26 21:22                       ` Peter Stephenson

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=141025152827.ZM7060@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /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).