Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Segfault while testing __git_files functions
- X-seq: zsh-workers 29268
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Zsh Workers <zsh-workers@xxxxxxx>
- Subject: Re: Segfault while testing __git_files functions
- Date: Sat, 14 May 2011 01:13:15 +0100
- In-reply-to: <alpine.LNX.2.01.1104270208490.28316@hp>
- 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: <alpine.LNX.2.01.1104270208490.28316@hp>
On Wed, 27 Apr 2011 02:16:04 -0400 (EDT)
"Benjamin R. Haskell" <zsh@xxxxxxxxxx> wrote:
> While trying to come up with a minimal "do __git_tree_files when I say
> __git_files" example, I came upon an error that gives me a reproducible
> segfault.
>
> Attached test script can be run from `zsh -ldf`:
>
> host% . ./git-break.zsh
>
> It'll create a git repo, and prep it for the point where it'll break if
> you hit Tab.
... thanks to this I was able to try the heap debugging and look at the
result. However, it's nothing to do with using invalid heaps for the
matcher group itself, it's simply that one particular element of the
structure isn't being duplicated properly, so it didn't take much
tracking down.
I expect there are other problems, though.
Index: Src/Zle/compcore.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/compcore.c,v
retrieving revision 1.105
diff -p -u -r1.105 compcore.c
--- Src/Zle/compcore.c 18 Feb 2011 22:08:46 -0000 1.105
+++ Src/Zle/compcore.c 13 May 2011 23:18:31 -0000
@@ -2329,7 +2344,7 @@ addmatches(Cadata dat, char **argv)
dat->pre = dupstring(dat->pre);
if (dat->suf)
dat->suf = dupstring(dat->suf);
- if (!dat->prpre && (dat->prpre = oppre)) {
+ if (!dat->prpre && (dat->prpre = dupstring(oppre))) {
singsub(&(dat->prpre));
untokenize(dat->prpre);
} else
--
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author