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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11109 in the body.
You can then email your comments to 11109 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#11109; Package emacs. (Wed, 28 Mar 2012 08:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sven Joachim <svenjoac <at> gmx.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 28 Mar 2012 08:14:02 GMT) Full text and rfc822 format available.

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

From: Sven Joachim <svenjoac <at> gmx.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.94; vc-git-state: Stack overflow in regexp matcher
Date: Wed, 28 Mar 2012 09:41:40 +0200
[Message part 1 (text/plain, inline)]
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.

This is an excerpt from the backtrace with the second line truncated
since it is *very* long.  Full backtrace is attached at the end of this
mail.

,----
| Debugger entered--Lisp error: (error "Stack overflow in regexp matcher")
|   string-match(":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\([ADMUT]\\).[^.]+.\\(\\(?:.\\|\n\\)*\\)\\'" ":100644 100644 04163e01d122e6a0b2e6172b91c7bdc69e496f25 0000000000000000000000000000000000000000 [...]
|   vc-git-state("/usr/local/src/deb-src/ncurses/ncurses/misc/terminfo.src")
|   apply(vc-git-state "/usr/local/src/deb-src/ncurses/ncurses/misc/terminfo.src")
|   vc-call-backend(Git state "/usr/local/src/deb-src/ncurses/ncurses/misc/terminfo.src")
|   vc-default-state-heuristic(Git "/usr/local/src/deb-src/ncurses/ncurses/misc/terminfo.src")
|   apply(vc-default-state-heuristic Git "/usr/local/src/deb-src/ncurses/ncurses/misc/terminfo.src")
|   vc-call-backend(Git state-heuristic "/usr/local/src/deb-src/ncurses/ncurses/misc/terminfo.src")
|   vc-state-refresh("/usr/local/src/deb-src/ncurses/ncurses/misc/terminfo.src" Git)
|   vc-state("/usr/local/src/deb-src/ncurses/ncurses/misc/terminfo.src" Git)
|   vc-default-mode-line-string(Git "/usr/local/src/deb-src/ncurses/ncurses/misc/terminfo.src")
|   vc-git-mode-line-string("/usr/local/src/deb-src/ncurses/ncurses/misc/terminfo.src")
|   apply(vc-git-mode-line-string "/usr/local/src/deb-src/ncurses/ncurses/misc/terminfo.src")
|   vc-call-backend(Git mode-line-string "/usr/local/src/deb-src/ncurses/ncurses/misc/terminfo.src")
|   vc-mode-line("/usr/local/src/deb-src/ncurses/ncurses/misc/terminfo.src" Git)
|   vc-find-file-hook()
|   run-hooks(find-file-hook)
|   after-find-file(nil t)
|   find-file-noselect-1(#<buffer terminfo.src> "/usr/local/src/deb-src/ncurses/ncurses/misc/terminfo.src" nil nil "/usr/local/src/deb-src/ncurses/ncurses/misc/terminfo.src" (665028 2055))
|   find-file-noselect("/usr/local/src/deb-src/ncurses/ncurses/misc/terminfo.src" nil nil t)
|   find-file("/usr/local/src/deb-src/ncurses/ncurses/misc/terminfo.src" t)
|   call-interactively(find-file nil nil)
`----


In GNU Emacs 24.0.94.2 (i486-pc-linux-gnu, GTK+ Version 2.24.10)
 of 2012-03-28 on turtle
Windowing system distributor `The X.Org Foundation', version 11.0.11200000
Configured using:
 `configure '--build=i486-pc-linux-gnu' '--without-gconf'
 'build_alias=i486-pc-linux-gnu''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: C
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: de_DE.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Debugger

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-x C-f / u s r <tab> l o c <tab> s r <tab> d e b <tab> 
n c <tab> / n c <tab> / m i s <tab> t e r m <tab> <return> 
C-x C-b C-x o <down> <down> d x M-x t o g g l e - d 
e b <tab> e r r <tab> <return> C-x C-f <up> <return> 
<up> C-SPC <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
M-w M-x r e p o r t - e m <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Loading vc-git...done
vc-git-state: Stack overflow in regexp matcher
Debug on Error enabled globally
Entering debugger...
Mark set

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail regexp-opt rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils help-mode easymenu view debug cus-start
cus-load vc-git time-date tooltip ediff-hook vc-hooks lisp-float-type
mwheel x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face files text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty emacs)

[backtrace.gz (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11109; Package emacs. (Wed, 28 Mar 2012 09:08:01 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Sven Joachim <svenjoac <at> gmx.de>
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:36:08 +0200
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?

Andreas.

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:

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11109; Package emacs. (Wed, 28 Mar 2012 09:22:02 GMT) Full text and rfc822 format available.

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




Reply sent to Andreas Schwab <schwab <at> linux-m68k.org>:
You have taken responsibility. (Wed, 28 Mar 2012 10:52:02 GMT) Full text and rfc822 format available.

Notification sent to Sven Joachim <svenjoac <at> gmx.de>:
bug acknowledged by developer. (Wed, 28 Mar 2012 10:52:03 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Sven Joachim <svenjoac <at> gmx.de>
Cc: 11109-done <at> debbugs.gnu.org
Subject: Re: bug#11109: 24.0.94; vc-git-state: Stack overflow in regexp matcher
Date: Wed, 28 Mar 2012 12:19:52 +0200
Thanks for testing.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 25 Apr 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 12 days ago.

Previous Next


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