unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#18577: Regexp I-search: [(error Stack overflow in regexp matcher)]
@ 2014-09-28  8:55 Alan Mackenzie
  2014-09-28 10:56 ` Andreas Schwab
  0 siblings, 1 reply; 13+ messages in thread
From: Alan Mackenzie @ 2014-09-28  8:55 UTC (permalink / raw)
  To: 18577

Hi, Emacs.

In the trunk, emacs -Q.  Visit our favourite big file, xdisp.c.

With point at BOB, do C-M-s and enter this regular expression at the
prompt:

/\*\(\([^'*]\|\*[^/']\)*\*?'\([^'*]\|\*[^/']\)*\*?'\)*\([^'*]\|\*[^'/]\)*\*?'\([^'*]\|\*[^/']\)*\*?\*/

Press C-s.  This gives the error message "[(error Stack overflow in
regexp matcher)]".

This feels like a bug.  Regexp searching with this expression (which
finds a block comment containing an odd number of apostrophes) works fine
in the rest of the buffer.  Only in the second (large) comment in xdisp.c
does it trigger this error.  Surely an iterative regexp (which all
regexps are, surely?) shouldn't be triggering unbounded recursive
behaviour in the search engine.

[N.B. the regexp when parsed a bit looks like this:

/\*\(                                              \)*\(     \|       \)*\*?'\(     \|       \)*\*?\*/
     \(     \|       \)*\*?'\(     \|       \)*\*?'     [^'*]  \*[^'/]         [^'*]  \*[^/']
       [^'*]  \*[^/']         [^'*]  \*[^/']

].  

-- 
Alan Mackenzie (Nuremberg, Germany).





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-10-24 22:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-28  8:55 bug#18577: Regexp I-search: [(error Stack overflow in regexp matcher)] Alan Mackenzie
2014-09-28 10:56 ` Andreas Schwab
2014-09-28 12:37   ` Alan Mackenzie
2014-09-28 12:48     ` Andreas Schwab
2014-09-28 17:35       ` Stefan Monnier
2014-11-27  8:44         ` Tassilo Horn
2021-10-23  2:47         ` Stefan Kangas
2021-10-23  7:32           ` Eli Zaretskii
2021-10-23  8:30             ` Stefan Kangas
2021-10-23  8:39               ` Eli Zaretskii
2021-10-23  9:32                 ` Stefan Kangas
2021-10-23 11:27                   ` Eli Zaretskii
2021-10-24 22:08                     ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).