bug-auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22146: Stack overflow in reftex-parse-all


From: Tassilo Horn
Subject: bug#22146: Stack overflow in reftex-parse-all
Date: Sun, 13 Dec 2015 17:55:27 +0100
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux)

David Kastrup <address@hidden> writes:

>>     (re-search-forward "\\[[^]]*\\<label")
>>
>> at the beginning of the buffer suggested by Nils.  So, it doesn't
>> seem there is an incomplete match, but simply "\\[[^]]*" is too
>> greedy.
>
> This expression contains only a single explicit wildcard.  A stack
> overflow for it most certainly is a bug.  Is this really fixed in 25.1
> or is there just a larger stack?

I also get a stack overflow with this starting with a buffer size of
about 800 lines.  But I can run

  (re-search-forward reftex-everything-regexp nil t)

without problems even after adding 100.000 more "foo foo foo..." lines
to the test file...

Ah, `reftex-everything-regexp' doesn't include that problematic regex
anymore.
Now it contains "\\[[^[]]*\\<label"
instead of      "\\[[^]]*\\<label".

Well, that new regexp has not this problem because it is wrong and
doesn't match keyval style labels anymore.  That problem has been
introduced by:

--8<---------------cut here---------------start------------->8---
commit 32a488344057f210b51f4618feb3a85799eef0c5
Author: Nils Ackermann <address@hidden>
Date:   Tue Jun 16 09:24:47 2015 +0200

    Improve reftex-label-regexps default value
    
    * lisp/textmodes/reftex-vars.el (reftex-label-regexps): Make
    keyvals label regexp more strict to better cope with unbalanced
    brackets common in math documents.
--8<---------------cut here---------------end--------------->8---

I just now changed the regexp (`reftex-label-regexps') to

  "\\[[^][]*\\<label[[:space:]]*=[[:space:]]*{?\\(?1:[^],}]+\\)}?"

(the stuff after \\<label has been there before, too) which works again
in the sense it matches keyval style labels but unfortunately also
causes the stack overflow.

Bye,
Tassilo





reply via email to

[Prev in Thread] Current Thread [Next in Thread]