GNU bug report logs - #22146
Stack overflow in reftex-parse-all

Previous Next

Package: auctex;

Reported by: Nils Kanning <nils <at> kanning.de>

Date: Fri, 11 Dec 2015 21:19:02 UTC

Severity: normal

Done: Tassilo Horn <tsdh <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Nils Kanning <nils <at> kanning.de>
Subject: bug#22146: closed (Re: bug#22146: Stack overflow in reftex-parse-all)
Date: Sun, 13 Dec 2015 18:56:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#22146: Stack overflow in reftex-parse-all

which was filed against the auctex package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 22146 <at> debbugs.gnu.org.

-- 
22146: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22146
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Tassilo Horn <tsdh <at> gnu.org>
To: David Kastrup <dak <at> gnu.org>
Cc: Nils Kanning <nils <at> kanning.de>, 22146-done <at> debbugs.gnu.org,
 Mosè Giordano <mose <at> gnu.org>
Subject: Re: bug#22146: Stack overflow in reftex-parse-all
Date: Sun, 13 Dec 2015 19:55:22 +0100
David Kastrup <dak <at> gnu.org> writes:

>> Isn't the syntax "\\[[^]]\\{0,1000\\}\\<label"?  I tried going up to
>> a maximum of 30000 and it still didn't overflow, so I think that's an
>> appropriate fix (say, maybe 2000 instead of 1000 to be extra safe).
>> Feel free to change `reftex-label-regexps' accordingly.
>>
>> Interestingly, "x\\{0,40000\\}" gives an error:
>>
>>   (invalid-regexp "Invalid content of \\{\\}")
>>
>> So there seems to be a (pretty random) limit...
>
> I'd guess that the regexp library translates this into a "short", so
> the limit would be SHORT_MAX, namely 32767.

(re-search-forward "x\\{0,32767\\}") => works
(re-search-forward "x\\{0,32768\\}") => error

Yup, of course you're right.

Anyway, I'm closing this bug with the recent emacs/reftex commit which
looks at a label=... at most 2000 chars after the opening [.

Bye,
Tassilo

[Message part 3 (message/rfc822, inline)]
From: Nils Kanning <nils <at> kanning.de>
To: bug-auctex <at> gnu.org
Subject: Stack overflow in reftex-parse-all
Date: Fri, 11 Dec 2015 22:03:24 +0100
Dear all,

I encounter the error "Stack overflow in regexp matcher" if I apply the
function reftex-parse-all to the following file:

\documentclass{article}
\begin{document} 
[\}
foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo
...
foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo
\end{document}

Here ... stands for 500 copies of the line above. The file can be
compiled successfully with pdflatex.

I am using the Debian packages emacs24 24.5+1-3 and auctex 11.88-1.1.
The same error also occurs with different versions.

In case you are wondering, the non-matching brackets [\} appear for
example in physics as so-called "super Lie brackets".

Best
Nils



This bug report was last modified 9 years and 163 days ago.

Previous Next


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