From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21968 invoked by alias); 25 Oct 2014 22:28:58 -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: 33533 Received: (qmail 21230 invoked from network); 25 Oct 2014 22:28:48 -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 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=FrayJNvv c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=9aLuc_yJdeLRvO2pXIEA:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <141025152827.ZM7060@torch.brasslantern.com> Date: Sat, 25 Oct 2014 15:28:27 -0700 In-reply-to: <20141025200847.782316a4@pws-pc.ntlworld.com> Comments: In reply to Peter Stephenson "Re: bug in zsh wait builtin - rhbz#1150541" (Oct 25, 8:08pm) References: <20141021210234.199eee3d@pws-pc.ntlworld.com> <141021235542.ZM14840@torch.brasslantern.com> <20141023093232.1f4201e2@pwslap01u.europe.root.pri> <141023215041.ZM19768@torch.brasslantern.com> <20141025200847.782316a4@pws-pc.ntlworld.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: bug in zsh wait builtin - rhbz#1150541 MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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 #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 #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