Re: VIM crashes in one extreme situation
- George Reilly wrote:
> Bram Moolenaar wrote:We would still run out of stack. Or do you mean that we would know how
> >The examples I found with this mechanism are around very simple code.
> >We do recursive function calls. That might be the reason it doesn't
> >work for Vim.
> >If someone has good ideas how to make this work reliably, let's hear it!
> >Otherwise the only solution is to compile with MSVC.
> Unbounded recursion is a really bad idea. (I assume that's the
> underlying problem.) Why not explicitly manage the recursion state on a
> custom stack, instead of implicitly on the system stack?
large the stack is and we can check that it's almost full? We actually
already have code for that: mch_stackcheck(). But it can only be used
if we know how big the stack is, therefore it's only used when
getrlimit() is present.
Thus if you know a way to figure out the size of the stack, we can use
An ever better solution would be to change the regexp code from using
recursive calls to a linear approach. But that means rewriting most of
the complex regexp code...
GALAHAD: Camelot ...
LAUNCELOT: Camelot ...
GAWAIN: It's only a model.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
/// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ Project leader for A-A-P -- http://www.A-A-P.org ///
\\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///