>>>> "Dres" == James LewisMoss
<dres(a)lewismoss.org> writes:
Dres> With the latest xemacs I noticed REGEX_MALLOC is now the
Dres> default. When I tried setting it with 21.4.13 the same
Dres> problem occured.
Dres> The error message is:
Dres> Stack overflow in regexp matcher
My feeling is that what is happening here is that a problem you
wouldn't see when using ALLOCA is being exposed by using
REGEX_MALLOC.
Dres> And the value of compilation-error-regexp-alist is:
Using multiline regexps is a clear sign of a pact with the Devil.
I really don't know what to say; we don't have much choice about using
such regexps at the moment. You have a very hard choice (as Debian
maintainer): you can prevent crashes (ie, leave REGEX_MALLOC enabled)
at the expense of forcing a lot of matches that would otherwise
succeed to end in error.
This patch should help, and I'd appreciate testing. But the logic
regarding MATCH_MAY_ALLOCATE has changed a lot in 21.5, and the 21.4
usage seems real weird to me, especially in light of comments in
21.5. So watch out.
Index: src/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.290.2.53
diff -u -U0 -r1.290.2.53 ChangeLog
--- src/ChangeLog 4 Sep 2003 02:44:48 -0000 1.290.2.53
+++ src/ChangeLog 13 Sep 2003 07:16:06 -0000
@@ -0,0 +1,4 @@
+2003-09-13 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * regex.c (re_max_failures): Bump to 20000 for REGEX_MALLOC, too.
+
Index: src/regex.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/regex.c,v
retrieving revision 1.25.2.4
diff -u -r1.25.2.4 regex.c
--- src/regex.c 19 Jun 2003 03:34:42 -0000 1.25.2.4
+++ src/regex.c 13 Sep 2003 07:16:15 -0000
@@ -1135,7 +1135,7 @@
exactly that if always used MAX_FAILURE_SPACE each time we failed.
This is a variable only so users of regex can assign to it; we never
change it ourselves. */
-#if defined (MATCH_MAY_ALLOCATE)
+#if defined (MATCH_MAY_ALLOCATE) || defined (REGEX_MALLOC)
/* 4400 was enough to cause a crash on Alpha OSF/1,
whose default stack limit is 2mb. */
int re_max_failures = 20000;
--
Institute of Policy and Planning Sciences
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.