Vim pegs the CPU when typing ( open paren

Bug #270386 reported by Baron Schwartz
6
Affects Status Importance Assigned to Milestone
vim (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: vim

Vim pegs the CPU at 100% for about 30 to 60 seconds when I type an open parentheses '(' in a certain location in the file.

baron@kanga:~$ dpkg -l | grep vim
ii vim-common 1:7.1-138+1ubuntu3 Vi IMproved - Common files
ii vim-full 1:7.1-138+1ubuntu3 Vi IMproved - enhanced vi editor (transition
ii vim-gnome 1:7.1-138+1ubuntu3 Vi IMproved - enhanced vi editor - with GNOM
ii vim-gui-common 1:7.1-138+1ubuntu3 Vi IMproved - Common GUI files
ii vim-runtime 1:7.1-138+1ubuntu3 Vi IMproved - Runtime files
ii vim-tiny 1:7.1-138+1ubuntu3 Vi IMproved - enhanced vi editor - compact v

I'm on 8.04.

To repro (another user repro'ed, by the way), place the cursor after this text in the attached file:

CREATE TABLE checksum (
 db char(64) NOT NULL,
 tbl char(64) NOT NULL,
 chunk int NOT NULL,
 boundaries char(64) NOT NULL,
 this_crc char(40) NOT NULL,
 this_cnt int NOT NULL,
 master_crc char(40) NULL,
 master_cnt int NULL,
 ts timestamp NOT NULL,
 PRIMARY KEY (db, tbl, chunk)
);

Now type

create table argtest (

And watch it hang.

After it becomes responsive again, you can start a new line and type

 db char(64) NOT NULL,

And it'll do the same thing at the (.

Revision history for this message
Baron Schwartz (baron-xaprb) wrote :
Revision history for this message
Dominique Pellé (dominique-pelle) wrote :

I could not reproduce it somehow, but the bug description sounds an awful lot like the following bug which was fixed in vim-7.1.227 on Jan 13 2008:

Patch 7.1.227
Problem: Hang in syntax HL when moving over a ")". (Dominique Pelle)
Solution: Avoid storing a syntax state in the wrong position in the list of
            remembered states.
Files: src/syntax.c

Revision history for this message
Dominique Pellé (dominique-pelle) wrote :

The following patch could from Jan 6 2008 could also be relevant:

Patch 7.1.211
Problem: The matchparen plugin may take an unexpected amount of time, so
            that it looks like Vim hangs.
Solution: Add a timeout to searchpair(), searchpairpos(), search() and
            searchpos(). Use half a second timeout in the plugin.
Files: runtime/doc/eval.txt, runtime/plugin/matchparen.vim, src/edit.c,
            src/eval.c, src/ex_cmds2.c, src/ex_docmd.c, src/normal.c,
            src/proto/eval.pro, src/proto/ex_cmds2.pro, src/proto/search.pro,
            src/search.c

Revision history for this message
Baron Schwartz (baron-xaprb) wrote :

It doesn't reproduce in Ubuntu 8.10 so I believe it must be fixed as you said.

Revision history for this message
Andrew McCarthy (andrewmccarthy) wrote :

Thanks for taking the time to report this bug. Since it appears to be fixed in the latest release of Ubuntu, I am closing this bug.

Changed in vim:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.