zsh-workers
 help / color / mirror / code / Atom feed
* BUG: restore_queue_signals(): q = 2 != queue_in = 3
@ 2017-01-30  6:53 Daniel Shahaf
  2017-01-30 15:24 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Shahaf @ 2017-01-30  6:53 UTC (permalink / raw)
  To: zsh-workers

Reproduction:

$ zsh -f
% autoload compinit
% compinit
% cd /t<TAB>88: exec.c:3855: BUG: q = 2 != queue_in = 3
mp/<CURSOR>

That line number is:

2643 execcmd_exec(Estate state, Execcmd_params eparams,
2645 {                                                                                                                       
3854                 dont_queue_signals();                                                                                   
3855                 if (!errflag)
3856                     lastval = execbuiltin(args, assigns, (Builtin) hn);
3857                 if (do_save & BINF_COMMAND)
3858                     errflag &= ~ERRFLAG_ERROR;
3859                 restore_queue_signals(q);

Further information:

% echo /t*
/tmp
% echo $ZSH_P<TAB>88: exec.c:3855: BUG: q = 2 != queue_in = 3
11: exec.c:3855: BUG: q = 2 != queue_in = 3
ATCHLEVEL 
zsh-5.3.1-62-gb007341


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: BUG: restore_queue_signals(): q = 2 != queue_in = 3
  2017-01-30  6:53 BUG: restore_queue_signals(): q = 2 != queue_in = 3 Daniel Shahaf
@ 2017-01-30 15:24 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2017-01-30 15:24 UTC (permalink / raw)
  To: zsh-workers

OK, this is one of those cases where I had to choose between HEAPDUP and
queue_signals() and I missed some "return" in the blocks.  There aren't
other globals being manipulated here so rather than try to catch all the
early "return" let's just drop use of PAT_STATIC.

diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c
index 49b338f..68bdf23 100644
--- a/Src/Zle/complete.c
+++ b/Src/Zle/complete.c
@@ -896,14 +896,12 @@ do_comp_vars(int test, int na, char *sa, int nb, char *sb, int mod)
 	    int i, l = arrlen(compwords), t = 0, b = 0, e = l - 1;
 	    Patprog pp;
 
-	    queue_signals();	/* Protect PAT_STATIC */
-
 	    i = compcurrent - 1;
 	    if (i < 0 || i >= l)
 		return 0;
 
 	    singsub(&sa);
-	    pp = patcompile(sa, PAT_STATIC, NULL);
+	    pp = patcompile(sa, PAT_HEAPDUP, NULL);
 
 	    for (i--, p = compwords + i; i >= 0; p--, i--) {
 		if (pattry(pp, *p)) {
@@ -932,9 +930,6 @@ do_comp_vars(int test, int na, char *sa, int nb, char *sb, int mod)
 		t = 0;
 	    if (t && mod)
 		restrict_range(b, e);
-
-	    unqueue_signals();
-
 	    return t;
 	}
     case CVT_PRENUM:
@@ -957,12 +952,10 @@ do_comp_vars(int test, int na, char *sa, int nb, char *sb, int mod)
 	{
 	    Patprog pp;
 
-	    queue_signals();	/* Protect PAT_STATIC */
-
 	    if (!na)
 		return 0;
 
-	    if (!(pp = patcompile(sa, PAT_STATIC, 0)))
+	    if (!(pp = patcompile(sa, PAT_HEAPDUP, 0)))
 		return 0;
 
 	    if (test == CVT_PREPAT) {
@@ -1043,9 +1036,6 @@ do_comp_vars(int test, int na, char *sa, int nb, char *sb, int mod)
 		if (mod)
 		    ignore_suffix(ol - (p - compsuffix));
 	    }
-
-	    unqueue_signals();
-
 	    return 1;
 	}
     }

-- 
Barton E. Schaefer


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-30 15:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-30  6:53 BUG: restore_queue_signals(): q = 2 != queue_in = 3 Daniel Shahaf
2017-01-30 15:24 ` Bart Schaefer

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).