Closed Rinzwind closed 4 months ago
@Rinzwind, Thanks for your interest.
Regarding the stack overflow behavior, that is best reported/discussed on the GemStone-Smalltalk mailing list.
... and the RxMatcher is actually part of the glassdb/glass project, so if you have improvements to RxMatcher please submit a PR with your improvements as well as tests to that project and if the CI tests pass it will be integrated for all to use ...
Thanks!
The matching of an RxMatcher uses a recursive implementation so the size of the string that can be matched is limited by the stack limit as demonstrated by the example in the Dockerfile given below:
Avoiding that would presumably require transforming RxMatcher to keep its own stack. One can increase the stack limit, but doing so only for RxMatcher’s sake may not be desirable in all applications, and there’s a maximum limit as well: 1000000 per the documentation on
GEM_MAX_SMALLTALK_STACK_DEPTH
for GemStone/S v3.4, or just 30000 for native code on an Intel CPU per the documentation for GemStone/S v3.7.A question I have myself regarding the example is how it is that the AlmostOutOfStack occurs only at a stack depth of 3256 while
GEM_MAX_SMALLTALK_STACK_DEPTH
is set to 1234. I guess the explanation is in the documentation’s mention of it being an ‘approximate number’ but it’s not quite clear to me.Dockerfile: