Ben Schmidt wrote:

> > I just tried the file. Opening Vim took about a minute with Vim
> > running at 100% CPU after which Vim became responsive. I then scrolled
> > down by repeating 99<PageDown> and just before I reached the bitmap
> > part of the XPM file Vim crashed. I've tried a few times and it
> > crashes every time, but only after reaching the bitmap part.
> 
> There are way too many syntax groups, and they overflow into syntax
> clusters, because clusters are stored in a high part of the syntax group
> id number-space, and Vim doesn't check it.
> 
> The attached preliminary patch puts in a check for this and a couple of
> other possible syntax overflow conditions, so we should get errors, not
> crashes.
> 
> It fixes this particular problem for me. An error occurs when the file
> is loaded, and scrolling is slow, but doesn't crash, and can be
> interrupted with control-C.
> 
> Can others test this and confirm?
> 
> Bram, if you're happy with this approach, I can tidy up the patch a bit,
> i.e. put in error message numbers, including in the documentation, if
> that's helpful.

The checks for things going wrong are obviously good.  I wonder if we
can change the numbers without causing trouble.  I don't think we ever
thought of hitting these limits.

On the other hand, allowing ridiculous numbers probably makes Vim run
really slow, thus disallowing this might be better.  Or we need to fix
the slowness.


-- 
Q:   How many hardware engineers does it take to change a lightbulb?
A:   None.  We'll fix it in software.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui