GNU bug report logs - #65726
29.1.50; Crash in regexp engine

Previous Next

Package: emacs;

Reported by: martin rudalics <rudalics <at> gmx.at>

Date: Mon, 4 Sep 2023 07:48:02 UTC

Severity: normal

Found in version 29.1.50

Fixed in version 30.1

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: martin rudalics <rudalics <at> gmx.at>, Eli Zaretskii <eliz <at> gnu.org>,
 65726 <at> debbugs.gnu.org
Subject: Re: bug#65726: 29.1.50; Crash in regexp engine
Date: Sat, 9 Sep 2023 18:34:42 +0200
9 sep. 2023 kl. 17.55 skrev Stefan Monnier <monnier <at> iro.umontreal.ca>:

> My patch didn't include the assertion :-)

Oh, I thought you meant the eassert (p2 >= done); added at the start of mutually_exclusive_aux. Sorry about the confusion.
Anyway, disassembling the regexp makes it clear why:

Disassembly of regexp "\\`[^ ]+\\( [^ ]+\\)*\\'"

    0  begbuf
    1  charset-not [ ]
    8  on-failure-jump-smart to 21
   11  charset-not [ ]
   18  jump to 8
   21  on-failure-jump to 54
   24  start-memory group 1
   26  exact " "
   29  charset-not [ ]
   36  on-failure-jump-smart to 49
   39  charset-not [ ]
   46  jump to 36
   49  stop-memory group 1
   51  jump to 21
   54  endbuf
   55  succeed

which unless I'm mistaken we can condense to:

Disassembly of regexp "\\(?:ba*\\)*"

    0  on-failure-jump to 18
    3  exact "b"
    6  on-failure-jump-smart to 15
    9  exact "a"
   12  jump to 6
   15  jump to 0
   18  succeed

so yes, we may need to remember where we've been. (At this point someone will inevitably point out a helpful invariant that is obvious in hindsight. This is just my cunning attempt at making that happen.)





This bug report was last modified 1 year and 242 days ago.

Previous Next


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