GNU bug report logs - #23040
"Stack overflow in regexp matcher" when entering group

Previous Next

Packages: gnus, emacs;

Reported by: Nikolaus Rath <Nikolaus <at> rath.org>

Date: Thu, 17 Mar 2016 15:25:01 UTC

Severity: normal

Done: Lars Ingebrigtsen <larsi <at> gnus.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 23040 in the body.
You can then email your comments to 23040 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 bugs <at> gnus.org:
bug#23040; Package gnus. (Thu, 17 Mar 2016 15:25:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nikolaus Rath <Nikolaus <at> rath.org>:
New bug report received and forwarded. Copy sent to bugs <at> gnus.org. (Thu, 17 Mar 2016 15:25:02 GMT) Full text and rfc822 format available.

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

From: Nikolaus Rath <Nikolaus <at> rath.org>
To: submit <at> debbugs.gnu.org (The Gnus Bugfixing Girls + Boys)
Subject: "Stack overflow in regexp matcher" when entering group
Date: Thu, 17 Mar 2016 08:24:45 -0700
Hello,

When attempting to enter an nnimap group, I'm getting the following
error:

Debugger entered--Lisp error: (error "Stack overflow in regexp matcher")
  re-search-forward("<.+@[a-z0-9]+\\.rath\\.org>" nil t)
  gnus-score-string((((touched nil) ("references" ("<.+@[a-z0-9]+\\.rath\\.org>" nil nil r)))) "references" 736040 736012 nil)
  gnus-score-headers(("/home/nikratio/lib/gnus/Score/all.SCORE" "/home/nikratio/lib/gnus/Score/nnimap:Junk Mail.SCORE") nil)
  gnus-possibly-score-headers()
  (progn (gnus-possibly-score-headers))
  (if gnus-use-scoring (progn (gnus-possibly-score-headers)))
  (cond ((not new-group) (gnus-set-global-variables) (if kill-buffer (progn (gnus-kill-or-deaden-summary kill-buffer))) (gnus-configure-windows (quote summary) (quote force)) (gnus-set-mode-line (quote summary)) (gnus-summary-position-point) (message "") t) ((null did-select) (if (and (derived-mode-p (quote gnus-summary-mode)) (not (equal (current-buffer) kill-buffer))) (progn (kill-buffer (current-buffer)) (if (not quit-config) (progn (gnus-summary-update-info) (set-buffer gnus-group-buffer) (gnus-group-jump-to-group group) (gnus-group-next-unread-group 1)) (gnus-handle-ephemeral-exit quit-config)))) (if (null (gnus-list-of-unread-articles group)) (gnus-message 3 "Group %s contains no messages" group) (gnus-message 3 "Can't select group")) nil) ((eq did-select (quote quit)) (and (derived-mode-p (quote gnus-summary-mode)) (not (equal (current-buffer) kill-buffer)) (kill-buffer (current-buffer))) (if kill-buffer (progn (gnus-kill-or-deaden-summary kill-buffer))) (if (not quit-config) (progn (set-buffer gnus-group-buffer) (gnus-group-jump-to-group group) (gnus-configure-windows (quote group) (quote force))) (gnus-handle-ephemeral-exit quit-config)) (signal (quote quit) nil)) (t (gnus-set-global-variables) (if (boundp (quote spam-install-hooks)) (progn (spam-initialize))) (setq gnus-newsgroup-active (gnus-copy-sequence (symbol-value (intern-soft gnus-newsgroup-name gnus-active-hashtb)))) (setq gnus-newsgroup-highest (cdr gnus-newsgroup-active)) (gnus-run-hooks (quote gnus-select-group-hook)) (if (memq (quote summary) (gnus-update-format-specifications nil (quote summary) (quote summary-mode) (quote summary-dummy))) (progn (gnus-update-summary-mark-positions))) (if gnus-use-scoring (progn (gnus-possibly-score-headers))) (if gnus-build-sparse-threads (progn (gnus-build-sparse-threads))) (if show-all (let ((gnus-newsgroup-dormant nil)) (gnus-summary-initial-limit show-all)) (gnus-summary-initial-limit show-all)) (if no-display nil (gnus-summary-prepare)) (if gnus-use-trees (progn (gnus-tree-open) (setq gnus-summary-highlight-line-function (quote gnus-tree-highlight-article)))) (if (and (zerop (buffer-size)) (not no-display)) (progn (cond (gnus-newsgroup-dormant (gnus-summary-limit-include-dormant)) ((and gnus-newsgroup-scored show-all) (gnus-summary-limit-include-expunged t))))) (gnus-run-hooks (quote gnus-apply-kill-hook)) (if (and (zerop (buffer-size)) (not no-display)) (progn (gnus-summary-catchup-and-exit nil t) (gnus-message 6 "No unread news") (if kill-buffer (progn (gnus-kill-or-deaden-summary kill-buffer))) nil) (gnus-summary-maybe-hide-threads) (gnus-configure-windows (quote summary)) (if kill-buffer (progn (gnus-kill-or-deaden-summary kill-buffer))) (gnus-summary-auto-select-subject) (if (and (not no-article) (not no-display) gnus-newsgroup-unreads gnus-auto-select-first) (progn (let ((art ...)) (if (and art gnus-plugged ... ...) (progn ...)))) (gnus-summary-position-point) (gnus-configure-windows (quote summary) (quote force)) (gnus-set-mode-line (quote summary))) (if (and gnus-auto-center-group (get-buffer-window gnus-group-buffer t)) (progn (let ((owin ...)) (select-window (get-buffer-window gnus-group-buffer t)) (if (gnus-group-goto-group group) (progn ...)) (select-window owin)))) (setq gnus-newsgroup-prepared t) (gnus-run-hooks (quote gnus-summary-prepared-hook)) (if (gnus-ephemeral-group-p group) nil (gnus-group-update-group group nil t)) t)))
  (let* ((new-group (gnus-summary-setup-buffer group)) (quit-config (gnus-group-quit-config group)) (did-select (and new-group (gnus-select-newsgroup group show-all select-articles)))) (cond ((not new-group) (gnus-set-global-variables) (if kill-buffer (progn (gnus-kill-or-deaden-summary kill-buffer))) (gnus-configure-windows (quote summary) (quote force)) (gnus-set-mode-line (quote summary)) (gnus-summary-position-point) (message "") t) ((null did-select) (if (and (derived-mode-p (quote gnus-summary-mode)) (not (equal (current-buffer) kill-buffer))) (progn (kill-buffer (current-buffer)) (if (not quit-config) (progn (gnus-summary-update-info) (set-buffer gnus-group-buffer) (gnus-group-jump-to-group group) (gnus-group-next-unread-group 1)) (gnus-handle-ephemeral-exit quit-config)))) (if (null (gnus-list-of-unread-articles group)) (gnus-message 3 "Group %s contains no messages" group) (gnus-message 3 "Can't select group")) nil) ((eq did-select (quote quit)) (and (derived-mode-p (quote gnus-summary-mode)) (not (equal (current-buffer) kill-buffer)) (kill-buffer (current-buffer))) (if kill-buffer (progn (gnus-kill-or-deaden-summary kill-buffer))) (if (not quit-config) (progn (set-buffer gnus-group-buffer) (gnus-group-jump-to-group group) (gnus-configure-windows (quote group) (quote force))) (gnus-handle-ephemeral-exit quit-config)) (signal (quote quit) nil)) (t (gnus-set-global-variables) (if (boundp (quote spam-install-hooks)) (progn (spam-initialize))) (setq gnus-newsgroup-active (gnus-copy-sequence (symbol-value (intern-soft gnus-newsgroup-name gnus-active-hashtb)))) (setq gnus-newsgroup-highest (cdr gnus-newsgroup-active)) (gnus-run-hooks (quote gnus-select-group-hook)) (if (memq (quote summary) (gnus-update-format-specifications nil (quote summary) (quote summary-mode) (quote summary-dummy))) (progn (gnus-update-summary-mark-positions))) (if gnus-use-scoring (progn (gnus-possibly-score-headers))) (if gnus-build-sparse-threads (progn (gnus-build-sparse-threads))) (if show-all (let ((gnus-newsgroup-dormant nil)) (gnus-summary-initial-limit show-all)) (gnus-summary-initial-limit show-all)) (if no-display nil (gnus-summary-prepare)) (if gnus-use-trees (progn (gnus-tree-open) (setq gnus-summary-highlight-line-function (quote gnus-tree-highlight-article)))) (if (and (zerop (buffer-size)) (not no-display)) (progn (cond (gnus-newsgroup-dormant (gnus-summary-limit-include-dormant)) ((and gnus-newsgroup-scored show-all) (gnus-summary-limit-include-expunged t))))) (gnus-run-hooks (quote gnus-apply-kill-hook)) (if (and (zerop (buffer-size)) (not no-display)) (progn (gnus-summary-catchup-and-exit nil t) (gnus-message 6 "No unread news") (if kill-buffer (progn (gnus-kill-or-deaden-summary kill-buffer))) nil) (gnus-summary-maybe-hide-threads) (gnus-configure-windows (quote summary)) (if kill-buffer (progn (gnus-kill-or-deaden-summary kill-buffer))) (gnus-summary-auto-select-subject) (if (and (not no-article) (not no-display) gnus-newsgroup-unreads gnus-auto-select-first) (progn (let (...) (if ... ...))) (gnus-summary-position-point) (gnus-configure-windows (quote summary) (quote force)) (gnus-set-mode-line (quote summary))) (if (and gnus-auto-center-group (get-buffer-window gnus-group-buffer t)) (progn (let (...) (select-window ...) (if ... ...) (select-window owin)))) (setq gnus-newsgroup-prepared t) (gnus-run-hooks (quote gnus-summary-prepared-hook)) (if (gnus-ephemeral-group-p group) nil (gnus-group-update-group group nil t)) t))))
  gnus-summary-read-group-1("nnimap:Junk Mail" nil nil nil nil nil)
  (or (gnus-summary-read-group-1 group show-all no-article kill-buffer no-display select-articles) (setq show-all nil select-articles nil))
  (let ((gnus-auto-select-next nil)) (or (gnus-summary-read-group-1 group show-all no-article kill-buffer no-display select-articles) (setq show-all nil select-articles nil)))
  (setq result (let ((gnus-auto-select-next nil)) (or (gnus-summary-read-group-1 group show-all no-article kill-buffer no-display select-articles) (setq show-all nil select-articles nil))))
  (null (setq result (let ((gnus-auto-select-next nil)) (or (gnus-summary-read-group-1 group show-all no-article kill-buffer no-display select-articles) (setq show-all nil select-articles nil)))))
  (and group (null (setq result (let ((gnus-auto-select-next nil)) (or (gnus-summary-read-group-1 group show-all no-article kill-buffer no-display select-articles) (setq show-all nil select-articles nil))))) (eq gnus-auto-select-next (quote quietly)))
  (while (and group (null (setq result (let ((gnus-auto-select-next nil)) (or (gnus-summary-read-group-1 group show-all no-article kill-buffer no-display select-articles) (setq show-all nil select-articles nil))))) (eq gnus-auto-select-next (quote quietly))) (set-buffer gnus-group-buffer) (if backward (progn (gnus-group-prev-unread-group 2))) (if (not (equal group (gnus-group-group-name))) (setq group (gnus-group-group-name)) (setq group nil)))
  (let (result) (while (and group (null (setq result (let ((gnus-auto-select-next nil)) (or (gnus-summary-read-group-1 group show-all no-article kill-buffer no-display select-articles) (setq show-all nil select-articles nil))))) (eq gnus-auto-select-next (quote quietly))) (set-buffer gnus-group-buffer) (if backward (progn (gnus-group-prev-unread-group 2))) (if (not (equal group (gnus-group-group-name))) (setq group (gnus-group-group-name)) (setq group nil))) result)
  gnus-summary-read-group("nnimap:Junk Mail" nil nil nil nil nil nil)
  gnus-group-read-group(nil nil nil)
  gnus-topic-read-group(nil)
  call-interactively(gnus-topic-read-group nil nil)
  command-execute(gnus-topic-read-group)



Ma Gnus v0.14
GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5)
 of 2015-03-07 on trouble, modified by Debian


Best,
-Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«




Information forwarded to bugs <at> gnus.org:
bug#23040; Package gnus. (Wed, 27 Apr 2016 15:35:02 GMT) Full text and rfc822 format available.

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

From: Nikolaus Rath <Nikolaus <at> rath.org>
To: 23040 <at> debbugs.gnu.org 
Subject: Resolved
Date: Wed, 27 Apr 2016 08:34:28 -0700
The problem here is that recently some spam has started to come with
extremely long "References" headers, and that the regular expression
used in one of my scoring rules is sub-optimal when applied to such long
strings.

In particular, the leading dot in "<.+@[a-z0-9]+\\.rath\\.org>" first
matches the entire reference header, and then emacs presumably has to
backtrack character by character (or something like that).

Fixing the rule by restricting the match to one message id fixes the
problem: "<[^<>@]+@[a-z0-9]+\\.rath\\.org>"

Best,
-Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«




bug reassigned from package 'gnus' to 'emacs,gnus'. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 26 Jan 2017 23:05:03 GMT) Full text and rfc822 format available.

bug No longer marked as found in versions 5.130014. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 26 Jan 2017 23:05:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#23040; Package emacs,gnus. (Thu, 26 Jan 2017 23:06:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Nikolaus Rath <Nikolaus <at> rath.org>
Cc: 23040 <at> debbugs.gnu.org
Subject: Re: bug#23040: Resolved
Date: Thu, 26 Jan 2017 23:55:25 +0100
Nikolaus Rath <Nikolaus <at> rath.org> writes:

> The problem here is that recently some spam has started to come with
> extremely long "References" headers, and that the regular expression
> used in one of my scoring rules is sub-optimal when applied to such long
> strings.
>
> In particular, the leading dot in "<.+@[a-z0-9]+\\.rath\\.org>" first
> matches the entire reference header, and then emacs presumably has to
> backtrack character by character (or something like that).
>
> Fixing the rule by restricting the match to one message id fixes the
> problem: "<[^<>@]+@[a-z0-9]+\\.rath\\.org>"

Could you submit a patch for this problem? 

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#23040; Package emacs,gnus. (Fri, 27 Jan 2017 17:57:02 GMT) Full text and rfc822 format available.

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

From: Nikolaus Rath <Nikolaus <at> rath.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 23040 <at> debbugs.gnu.org
Subject: Re: bug#23040: Resolved
Date: Fri, 27 Jan 2017 09:56:39 -0800
On Jan 26 2017, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> Nikolaus Rath <Nikolaus <at> rath.org> writes:
>
>> The problem here is that recently some spam has started to come with
>> extremely long "References" headers, and that the regular expression
>> used in one of my scoring rules is sub-optimal when applied to such long
>> strings.
>>
>> In particular, the leading dot in "<.+@[a-z0-9]+\\.rath\\.org>" first
>> matches the entire reference header, and then emacs presumably has to
>> backtrack character by character (or something like that).
>>
>> Fixing the rule by restricting the match to one message id fixes the
>> problem: "<[^<>@]+@[a-z0-9]+\\.rath\\.org>"
>
> Could you submit a patch for this problem? 

If I understand the issue correctly, then it is caused by a sub-optimal
regular expression in my local configuration that triggers problems in
Emacs' regular expression engine. I think the former can't be patched in
Gnus, and the latter is definitely beyond my area of expertise, sorry.


Best,
-Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#23040; Package emacs,gnus. (Fri, 27 Jan 2017 19:10:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Nikolaus Rath <Nikolaus <at> rath.org>
Cc: 23040 <at> debbugs.gnu.org
Subject: Re: bug#23040: Resolved
Date: Fri, 27 Jan 2017 20:09:13 +0100
Nikolaus Rath <Nikolaus <at> rath.org> writes:

> If I understand the issue correctly, then it is caused by a sub-optimal
> regular expression in my local configuration that triggers problems in
> Emacs' regular expression engine. I think the former can't be patched in
> Gnus, and the latter is definitely beyond my area of expertise, sorry.

OK; closing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 23040 <at> debbugs.gnu.org and Nikolaus Rath <Nikolaus <at> rath.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 27 Jan 2017 19:10:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 25 Feb 2017 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 176 days ago.

Previous Next


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