Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] queueing_enabled grows infinitely when in .recursive-edit
- X-seq: zsh-workers 39548
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [BUG] queueing_enabled grows infinitely when in .recursive-edit
- Date: Mon, 3 Oct 2016 09:07:50 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=7q3yX6kUlRjkI1p41G/cGZsA9zCE0vTgJYYplVkTYu4=; b=i/maT4WDs8zVfRm3PdFU4D6qogxh2xPBLMatujBBYg6v+/oE1XU7kQ9tDnKaPpsglS Js23YooWVmB1nfxK/xHcnlagufussZyR1tn0YwDboDhPkwA83dA/8rG4m5Sai0o8BCLr jeMh5XnfFUGVEqX3esTEvsnD+JhRBoWKVxv01sJbj8eC8amESelJxZmlhMhotupK75Lc EXwIvNDC0TAbcpxW/FleB4HuCywkaOdDc56x+t3lUoeH/t/5zlVlw6SM9q2DBRmmpEa5 yh1efoat52G38RXq7ImTGrlc6Mew/645RDpLpOfd3JHZyzl6w12JX45Ohg0h7MFmIlYq Im2A==
- In-reply-to: <161003082029.ZM7267@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVAoLMj+dwEugbvggrmcjQbLP3GutxiNHPbpwvLw-a9F=w@mail.gmail.com> <CGME20161002233734eucas1p1136e84f7a57eaf467c44d8d7446856df@eucas1p1.samsung.com> <161002162145.ZM22574@torch.brasslantern.com> <20161003111840.3e5081f0@pwslap01u.europe.root.pri> <161003082029.ZM7267@torch.brasslantern.com>
On Oct 3, 8:20am, Bart Schaefer wrote:
}
} I will clean up that additional debugging for signals.h to make it
} suitable for commit, so that we have a better chance of catching these
} problems in new code.
Here is that.
diff --git a/Src/signals.c b/Src/signals.c
index e2587dc..9e05add 100644
--- a/Src/signals.c
+++ b/Src/signals.c
@@ -72,6 +72,10 @@ mod_export int queueing_enabled, queue_front, queue_rear;
mod_export int signal_queue[MAX_QUEUE_SIZE];
/**/
mod_export sigset_t signal_mask_queue[MAX_QUEUE_SIZE];
+#ifdef DEBUG
+/**/
+mod_export int queue_in;
+#endif
/* Variables used by trap queueing */
diff --git a/Src/signals.h b/Src/signals.h
index d680968..1904f43 100644
--- a/Src/signals.h
+++ b/Src/signals.h
@@ -82,8 +82,6 @@
#define MAX_QUEUE_SIZE 128
-#define queue_signals() (queueing_enabled++)
-
#define run_queued_signals() do { \
while (queue_front != queue_rear) { /* while signals in queue */ \
sigset_t oset; \
@@ -94,12 +92,35 @@
} \
} while (0)
+#ifdef DEBUG
+
+#define queue_signals() (queue_in++, queueing_enabled++)
+
#define unqueue_signals() do { \
DPUTS(!queueing_enabled, "BUG: unqueue_signals called but not queueing"); \
+ --queue_in; \
if (!--queueing_enabled) run_queued_signals(); \
} while (0)
-#define queue_signal_level() queueing_enabled
+#define dont_queue_signals() do { \
+ queue_in = queueing_enabled; \
+ queueing_enabled = 0; \
+ run_queued_signals(); \
+} while (0)
+
+#define restore_queue_signals(q) do { \
+ DPUTS2(queueing_enabled && queue_in != q, \
+ "BUG: q = %d != queue_in = %d", q, queue_in); \
+ queue_in = (queueing_enabled = (q)); \
+} while (0)
+
+#else /* !DEBUG */
+
+#define queue_signals() (queueing_enabled++)
+
+#define unqueue_signals() do { \
+ if (!--queueing_enabled) run_queued_signals(); \
+} while (0)
#define dont_queue_signals() do { \
queueing_enabled = 0; \
@@ -108,6 +129,10 @@
#define restore_queue_signals(q) (queueing_enabled = (q))
+#endif /* DEBUG */
+
+#define queue_signal_level() queueing_enabled
+
#ifdef BSD_SIGNALS
#define signal_block(S) sigblock(S)
#else
Messages sorted by:
Reverse Date,
Date,
Thread,
Author