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

Re: Deadlock when receiving kill-signal from child process



On Tue, Aug 11, 2015 at 12:17 AM, Mathias Fredriksson wrote:
} ... On a more serious note, I have not been able to produce
} any deadlocks after 36084! I also did not get around to test with
} --enable-zsh-mem since it is working just fine. I also tested building
} zsh without debugging, no problems there either.

Well, scratch that. I went back to my original use case where I'm
running commands in a zpty worker and notifying the original zsh pid
that the work is done (previously through WINCH, now tested with
USR1). There are usually two of these commands that are started at
precmd and usually finish either before or shortly after the prompt is
rendered. Now if I hold enter at and empty prompt, I can reproduce
this deadlock very quickly.

#0  0x00007fff8abfe72a in __sigsuspend ()
#1  0x00000001065013e9 in signal_suspend ()
#2  0x00000001064d8035 in zwaitjob ()
#3  0x00000001064d7e80 in waitjobs ()
#4  0x00000001064b9388 in execpline ()
#5  0x00000001064b86fb in execlist ()
#6  0x00000001064df9fc in execif ()
#7  0x00000001064bf4ce in execcmd ()
#8  0x00000001064b8fdd in execpline ()
#9  0x00000001064b8440 in execlist ()
#10 0x00000001064df9fc in execif ()
#11 0x00000001064bf4ce in execcmd ()
#12 0x00000001064b8fdd in execpline ()
#13 0x00000001064b8440 in execlist ()
#14 0x00000001064b8266 in execode ()
#15 0x00000001064bc092 in runshfunc ()
#16 0x00000001064bbabf in doshfunc ()
#17 0x00000001064c1fc1 in execshfunc ()
#18 0x00000001064bfc2b in execcmd ()
#19 0x00000001064b8fdd in execpline ()
#20 0x00000001064b8440 in execlist ()
#21 0x00000001064b8266 in execode ()
#22 0x00000001064bc092 in runshfunc ()
#23 0x00000001064bbabf in doshfunc ()
#24 0x000000010650ff96 in callhookfunc ()
#25 0x000000010651020f in preprompt ()
#26 0x00000001064d203e in loop ()
#27 0x00000001064d501b in zsh_main ()
#28 0x00007fff8610c5c9 in start ()

If I try to compile with --enable-zsh-mem I'm flooded with a bunch of
these messages (until zsh eventually segfaults):

3: mem.c:1575: MEM: allocation error at brk.
138: mem.c:1514: BUG: attempt to free storage at invalid address
175: mem.c:1514: BUG: attempt to free storage at invalid address
...
8: mem.c:1514: BUG: attempt to free storage at invalid address
8: mem.c:1514: BUG: attempt to free storage at invalid address
12: mem.c:1281: MEM: allocation error at sbrk, size 20480.



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