zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Vincent Lefevre <vincent@vinc17.net>, zsh-workers@zsh.org
Subject: Re: zsh 5.1 freezes with zombie child
Date: Tue, 1 Sep 2015 19:14:41 -0700	[thread overview]
Message-ID: <150901191441.ZM15728@torch.brasslantern.com> (raw)
In-Reply-To: <20150902001322.GA17603@zira.vinc17.org>

On Sep 2,  2:13am, Vincent Lefevre wrote:
}
} zira% updprompt() { true && { : } }
} zira% TRAPCHLD() { updprompt }
} zira% sleep 2 & sleep 3 ; echo OK
} [1] 20452
} [1]  + done       sleep 2
} 
} and zsh freezes here.

The following fixes it, but makes me nervous.  Is Mathias Fredriksson
still listening?  Try to reproduce that deadlock from the thread back
at the beginning of August?  (Was it really that recently?  Gaah.)


diff --git a/Src/signals.c b/Src/signals.c
index f45c186..aa0b5aa 100644
--- a/Src/signals.c
+++ b/Src/signals.c
@@ -1348,6 +1348,7 @@ void
 dotrap(int sig)
 {
     void *funcprog;
+    int q = queue_signal_level();
 
     if (sigtrapped[sig] & ZSIG_FUNC) {
 	HashNode hn = gettrapnode(sig, 0);
@@ -1370,5 +1371,9 @@ dotrap(int sig)
     if ((sigtrapped[sig] & ZSIG_IGNORED) || !funcprog || errflag)
 	return;
 
+    dont_queue_signals();
+
     dotrapargs(sig, sigtrapped+sig, funcprog);
+
+    restore_queue_signals(q);
 }


  reply	other threads:[~2015-09-02  2:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01 23:07 Vincent Lefevre
2015-09-01 23:14 ` Vincent Lefevre
2015-09-02  0:13 ` Vincent Lefevre
2015-09-02  2:14   ` Bart Schaefer [this message]
2015-09-02  6:00     ` Mathias Fredriksson
2015-09-04 22:39     ` Mathias Fredriksson
2015-09-06 17:38       ` Peter Stephenson
2015-09-10 14:25         ` Bart Schaefer
2015-09-10 14:51           ` Infinite loop on exit Peter Stephenson
2015-09-10 15:43             ` Bart Schaefer
2015-09-10 15:55               ` 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=150901191441.ZM15728@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=vincent@vinc17.net \
    --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).