Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: bug in zsh wait builtin - rhbz#1150541



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



Messages sorted by: Reverse Date, Date, Thread, Author