>>>> "Ragnar" == Ragnar Skaret
<etoras(a)eto.ericsson.se> writes:
Ragnar> When I have finished the compilation of a C-program, and
Ragnar> try to go directly to any error in the compilation output
Ragnar> window, I get the following error message: Stack overflow
Ragnar> in regexp matcher.
I was annoyed in the same case.
>>>> "Stephen" == "Stephen J.
Turnbull" <stephen(a)xemacs.org> writes:
Stephen> Best workaround is to raise stack space using ulimit (bash) or such
Stephen> commands (I don't know what works on Solaris).
Perhaps, it is not solved.
Maybe 're_max_failure' in src/regex.c is too small.
That number doesn't have generality.
src/regex.c
--------------------------------
/* Roughly the maximum number of failure points on the stack. Would be
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)
/* 4400 was enough to cause a crash on Alpha OSF/1,
whose default stack limit is 2mb. */
int re_max_failures = 20000;
#else
int re_max_failures = 2000;
#endif
--------------------------------
The following macro do the last limitation check.
src/regex.c
--------------------------------
#define DOUBLE_FAIL_STACK(fail_stack) \
((int) (fail_stack).size > re_max_failures * MAX_FAILURE_ITEMS \
? 0 \
: ((fail_stack).stack = (fail_stack_elt_t *) \
REGEX_REALLOCATE_STACK ((fail_stack).stack, \
(fail_stack).size * sizeof (fail_stack_elt_t), \
((fail_stack).size << 1) * sizeof (fail_stack_elt_t)), \
\
(fail_stack).stack == NULL \
? 0 \
: ((fail_stack).size <<= 1, \
1)))
--------------------------------
This is the same also in version 21.5.