zsh-workers
 help / color / mirror / code / Atom feed
From: Mathias Fredriksson <mafredri@gmail.com>
To: zsh-workers@zsh.org
Subject: Re: Deadlock when receiving kill-signal from child process
Date: Tue, 11 Aug 2015 01:53:01 +0300	[thread overview]
Message-ID: <CA+=GgY607MNdgg_YF9zbA_VPZL3O3+2nhao_f0k=DeMaySe-tg@mail.gmail.com> (raw)
In-Reply-To: <CA+=GgY6LVcYBJehR_9=Q08kkvJy-9rxpLnQ-wGF+brPQFf1oiQ@mail.gmail.com>

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.


  reply	other threads:[~2015-08-10 22:53 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03 11:25 Mathias Fredriksson
2015-08-03 15:52 ` Bart Schaefer
2015-08-03 20:36   ` Mathias Fredriksson
2015-08-03 20:58     ` Bart Schaefer
2015-08-04 21:52       ` Mathias Fredriksson
2015-08-05  0:05         ` Mathias Fredriksson
2015-08-05  6:53         ` Bart Schaefer
2015-08-05 10:37           ` Mathias Fredriksson
2015-08-05 15:52             ` Bart Schaefer
2015-08-05 16:05               ` Mathias Fredriksson
2015-08-05 18:52                 ` Bart Schaefer
2015-08-05 19:11                   ` Mathias Fredriksson
2015-08-05 20:20                     ` Bart Schaefer
2015-08-05 21:49                       ` Mathias Fredriksson
2015-08-06  5:06                         ` Bart Schaefer
2015-08-06  8:24                           ` Mathias Fredriksson
2015-08-06 15:54                             ` Bart Schaefer
2015-08-07  0:45                               ` Mathias Fredriksson
2015-08-07  5:39                                 ` Bart Schaefer
2015-08-09 13:53                                   ` Mathias Fredriksson
2015-08-09 23:42                                     ` Bart Schaefer
2015-08-10  0:02                                       ` Mikael Magnusson
2015-08-10  0:16                                         ` Mathias Fredriksson
2015-08-10  1:47                                           ` Bart Schaefer
2015-08-10  2:02                                             ` Mikael Magnusson
2015-08-10 15:59                                               ` Bart Schaefer
2015-08-10 17:30                                                 ` Mathias Fredriksson
2015-08-10  0:36                                         ` Bart Schaefer
2015-08-10  0:29                                       ` Bart Schaefer
2015-08-10 19:34                                     ` Bart Schaefer
2015-08-10 21:17                                       ` Mathias Fredriksson
2015-08-10 22:53                                         ` Mathias Fredriksson [this message]
2015-08-11  0:53                                           ` Bart Schaefer
2015-08-11 12:17                                             ` Mathias Fredriksson
2015-08-11 14:38                                               ` Mathias Fredriksson
2015-08-11 15:07                                               ` Bart Schaefer
2015-08-11 15:22                                                 ` Mathias Fredriksson
2015-08-11  4:06                                           ` Running commands in a zpty worker Bart Schaefer
2015-08-11 13:14                                             ` Mathias Fredriksson
2015-08-11 14:35                                               ` Mathias Fredriksson
2015-08-11 14:37                                               ` Bart Schaefer

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='CA+=GgY607MNdgg_YF9zbA_VPZL3O3+2nhao_f0k=DeMaySe-tg@mail.gmail.com' \
    --to=mafredri@gmail.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).