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

Re: core dump with completion.



Tanaka Akira wrote:

> zsh dumps core with completion with following operation.
> 
> Script started, file is typescript
> $ ls
> 7196              7217              7230              share
> 7202              7218              7231              typescript
> 7205              7219              7235              u2456
> 7209              7220              7241              zsh-3.1.6-test-2
> 7210              7223              bin
> 7213              7226              lib
> 7216              7229              man
> $ bin/zsh -f
> is27e1u11% bindkey -e; autoload -U compinit; compinit
> is27e1u11% cvs add <TAB><C-c>
> is27e1u11% A=sh<TAB>zsh: segmentation fault (core dumped)  bin/zsh -f
> $ Script done, file is typescript

This looked so much like 6814, that I made the patch below even though 
I couldn't reproduce it either (and this time neither on the DEC box,
nor on my Linux-Laptop). The patch isn't dangerous, so should probably 
be applied even if Tanaka says that it doesn't fix the bug.

Tanaka, could you try it? (Does it SEGV in callcompfunc() now?)

If we still get the bug, I'd be interested in the values stored in the 
owords arrays in previous stack frames of comp_wrapper() -- and in the 
values of clwords, clwsize, clwnum, and clwpos.

Hm, can't think of more just now...

Bye
 Sven

diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c	Tue Jul 20 11:36:54 1999
+++ Src/Zle/zle_tricky.c	Thu Jul 22 09:10:19 1999
@@ -4610,8 +4610,11 @@
 		kset |= CP_PARAMETER;
 		if (!clwpos) {
 		    clwpos = 1;
+		    clwnum = 2;
 		    zsfree(clwords[1]);
 		    clwords[1] = ztrdup(s);
+		    zsfree(clwords[2]);
+		    clwords[2] = NULL;
 		}
 		aadd = 1;
 		break;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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