GNU bug report logs - #11109
24.0.94; vc-git-state: Stack overflow in regexp matcher

Previous Next

Package: emacs;

Reported by: Sven Joachim <svenjoac <at> gmx.de>

Date: Wed, 28 Mar 2012 08:14:01 UTC

Severity: normal

Found in version 24.0.94

Done: Andreas Schwab <schwab <at> linux-m68k.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 11109 <at> debbugs.gnu.org (full text, mbox):

From: Sven Joachim <svenjoac <at> gmx.de>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 11109 <at> debbugs.gnu.org
Subject: Re: bug#11109: 24.0.94; vc-git-state: Stack overflow in regexp matcher
Date: Wed, 28 Mar 2012 10:49:58 +0200
On 2012-03-28 10:36 +0200, Andreas Schwab wrote:

> Sven Joachim <svenjoac <at> gmx.de> writes:
>
>> I'm getting frequent "Stack overflow in regexp matcher" errors when
>> visiting files under git version control with uncommitted changes.  This
>> started to happen rather recently.
>
> Does that help?

Yes, that seems to work.  Thanks.

> diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
> index bf7b7fb..b71dc95 100644
> --- a/lisp/vc/vc-git.el
> +++ b/lisp/vc/vc-git.el
> @@ -220,11 +220,10 @@ matching the resulting Git log output, and KEYWORDS is a list of
>      (let ((diff (vc-git--run-command-string
>                   file "diff-index" "-p" "--raw" "-z" "HEAD" "--")))
>        (if (and diff
> -	       (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\([ADMUT]\\)\0[^\0]+\0\\(\\(?:.\\|\n\\)*\\)\\'"
> +	       (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\([ADMUT]\\)\0[^\0]+\0\\(.\\)?"
>  			     diff))
> -          (let ((diff-letter (match-string 1 diff))
> -                (diff-contents (match-string 2 diff)))
> -            (if (not (string-match "\n." diff-contents))
> +          (let ((diff-letter (match-string 1 diff)))
> +            (if (not (match-beginning 2))
>                  ;; Empty diff: file contents is the same as the HEAD
>                  ;; revision, but timestamps are different (eg, file
>                  ;; was "touch"ed).  Update timestamp in index:

Cheers,
       Sven




This bug report was last modified 13 years and 118 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.