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

Re: zsh 5.1 freezes with zombie child



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);
 }



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