zsh-workers
 help / color / mirror / code / Atom feed
* Segmentation fault on Ctrl-D
@ 2008-05-07  7:35 Hiroto Kagotani
  2008-05-07  8:46 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Hiroto Kagotani @ 2008-05-07  7:35 UTC (permalink / raw)
  To: zsh-workers

Hi there,

I'm new to this list so please let me know if I'm missing any important
information.

zsh (CVS, 4.3.6, 4.3.4 on FreeBSD, and 4.3.4 on Cygwin) crashes
when I type a key sequence followed by two Ctrl-D's.

zsh -f
q<TAB><TAB><^D><^D>
 -> Segmentation fault

"q" may be any letter.  If you have a lot of commands begin with the letter,
type three <TAB>s to force zsh choose a candidate.


In my case, the first candidate beginning with "q" is qembed, and the gdb
back trace for the latest CVS is as follows:

Program received signal SIGSEGV, Segmentation fault.
0x28276783 in zlelineasstring (instr=0x0, inll=6, incs=6, outllp=0x80d7c00,
    outcsp=0x80d7c3c, useheap=0) at zle_utils.c:198
198             j = wcrtomb(s + mb_len, instr[i], &mbs);
(gdb) bt
#0  0x28276783 in zlelineasstring (instr=0x0, inll=6, incs=6,
    outllp=0x80d7c00, outcsp=0x80d7c3c, useheap=0) at zle_utils.c:198
#1  0x28270bd3 in metafy_line () at zle_tricky.c:960
#2  0x2825f1ce in execzlefunc (func=0x28281dc0, args=0x28284900, set_bindk=0)
    at zle_main.c:1356
#3  0x2825e3a4 in zlecore () at zle_main.c:1043
#4  0x2825ea46 in zleread (lp=0x80d7e08, rp=0x0, flags=3, context=0)
    at zle_main.c:1205
#5  0x080808d8 in autoload_zleread (lp=0x80d7e08, rp=0x0, ha=3, con=0)
    at init.c:1227
#6  0x080810c9 in inputline () at input.c:278
#7  0x08080f7f in ingetc () at input.c:214
#8  0x08077bbf in ihgetc () at hist.c:240
#9  0x0808807e in gettok () at lex.c:663
#10 0x08087951 in yylex () at lex.c:350
#11 0x080a1365 in parse_event () at parse.c:451
#12 0x0807e1f6 in loop (toplevel=1, justonce=0) at init.c:134
#13 0x08080bd1 in zsh_main (argc=2, argv=0xbfbfe3ec) at init.c:1358
#14 0x08052316 in main (argc=2, argv=0xbfbfe3ec) at ./main.c:93

Thanks.
-- 
Hiroto Kagotani
<hiroto.kagotani@gmail.com>


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

* Re: Segmentation fault on Ctrl-D
  2008-05-07  7:35 Segmentation fault on Ctrl-D Hiroto Kagotani
@ 2008-05-07  8:46 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2008-05-07  8:46 UTC (permalink / raw)
  To: Hiroto Kagotani, zsh-workers

On Wed, 7 May 2008 16:35:05 +0900
"Hiroto Kagotani" <hiroto.kagotani@gmail.com> wrote:
> Hi there,
> 
> I'm new to this list so please let me know if I'm missing any important
> information.
> 
> zsh (CVS, 4.3.6, 4.3.4 on FreeBSD, and 4.3.4 on Cygwin) crashes
> when I type a key sequence followed by two Ctrl-D's.
> 
> zsh -f
> q<TAB><TAB><^D><^D>
>  -> Segmentation fault
> 
> "q" may be any letter.  If you have a lot of commands begin with the letter,
> type three <TAB>s to force zsh choose a candidate.

Thanks.  This was a very obvious mistake when I looked.  Unfortunately
old-fashion completion doesn't get the same level of testing as the new
sort nowadays.

Index: Src/Zle/compresult.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compresult.c,v
retrieving revision 1.74
diff -u -r1.74 compresult.c
--- Src/Zle/compresult.c	13 Apr 2008 16:58:42 -0000	1.74
+++ Src/Zle/compresult.c	7 May 2008 08:44:21 -0000
@@ -1188,6 +1188,12 @@
 {
     int was_meta;
 
+    /* Just list the matches if the list was requested. */
+    if (lst == COMP_LIST_COMPLETE) {
+	showinglist = -2;
+	return;
+    }
+
     /* Already metafied when called from domenuselect already */
     if (zlemetaline == NULL) {
 	was_meta = 0;
@@ -1195,12 +1201,6 @@
     } else
 	was_meta = 1;
 
-    /* Just list the matches if the list was requested. */
-    if (lst == COMP_LIST_COMPLETE) {
-	showinglist = -2;
-	return;
-    }
-
     /* Otherwise go to the next match in the array... */
     do {
 	if (!*++(minfo.cur)) {

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


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

end of thread, other threads:[~2008-05-07  8:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-07  7:35 Segmentation fault on Ctrl-D Hiroto Kagotani
2008-05-07  8:46 ` Peter Stephenson

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