Hi

I can reproduce a vim bug filed in Ubuntu launchpad using the latest
vim-7.1 (Patches 1-166). Here is a link to the original bug description:

  https://bugs.launchpad.net/ubuntu/+source/vim/+bug/68960

Here is how I can reproduce it. I did not use '-u NONE', because
standard plugins need to be loaded to reproduce that bug.
".vimrc" file only needs to contain "syntax on" to reproduce it:

   $ cat ~/.vimrc
   syntax on

   $ vim +89 vim_testcase     # file "vim_testcase" is attached

... then, when moving cursor around closing parentheses at
line 89, observe that vim freezes and takes 100% of CPU (it
can be interrupted with Ctrl-C).

Trying to debug, I found that vim loops forever in a while(...)
loop in syntax.c in function syntax_start():

syntax.c:

 562     while (current_lnum < lnum)
 563     {
 ...
 ...
 596                 load_current_state(prev);
 ...
 ...
 609         line_breakcheck();
 610         if (got_int)
 611         {
 612             current_lnum = lnum;
 613             break;
 614         }
 615     }

This while loop never ends with attached "vim_testcase" file.
Adding some printf(), I can see that:

  - Before entering above while loop:
      - current_lnum == 65
      - lnum == 80

  - Then when iterating in the while loop:
      - lnum remains unchanged (80)
      - current_lnum becomes:

        65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
        65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
        65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
        etc.

current_lnum never reaches lnum (80) so loop never ends.

current_lnum goes back from 78 to 65 when calling
load_current_state(prev) at line 596.

I do not understand the idea behind load_current_state() and
store_current_state() to go beyond and come up with fix for this.

I'm using vim-7.1 (Patches 1-166) on Linux x86, built with
'configure --with-features=huge'.

-- Dominique

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Attachment: vim_testcase
Description: Binary data

Raspunde prin e-mail lui