Bug#400771: vim-gtk loops in syntax_start()
On Mon, Dec 04, 2006 at 12:52:53AM -0500, James Vega wrote: On Tue, Nov 28, 2006 at 05:27:15PM +0100, Carlo Wood wrote: vim uses 100% cpu while scrolling up (starting in a given state) the attached file. How to reproduce: [snipped] Thanks for the detailed steps to reproduce and debugging, unfortunately I'm unable to reproduce the bug in unstable or testing. Are you able to reproduce this if you start vim as vim -u /etc/vim/vimrc -N, :syntax on and then follow the steps you listed? No, if I do that I have to explicitely start /usr/bin/vim.gtk -u /etc/vim/vimrc -N Makefile.am then it reproduces (after a :syntax on). If I do: vim -u /etc/vim/vimrc -N Makefile.am then it doesn't reproduce. ~/usr/bin/vim.gtk --version VIM - Vi IMproved 7.0 (2006 May 7, compiled Oct 10 2006 00:14:41) Included patches: 1-122 Compiled by [EMAIL PROTECTED] Big version with GTK2 GUI. Features included (+) or not (-): +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +folding -footer +fork() +gettext -hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu +mksession +modify_fname +mouse +mouseshape +mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype +path_extra -perl +postscript +printer -profile -python +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save system vimrc file: $VIM/vimrc user vimrc file: $HOME/.vimrc user exrc file: $HOME/.exrc system gvimrc file: $VIM/gvimrc user gvimrc file: $HOME/.gvimrc system menu file: $VIMRUNTIME/menu.vim fall-back for $VIM: /usr/share/vim Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -O2 -g -Wall Linking: gcc -L/usr/local/lib -o vim -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lfontconfig -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXfixes -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lXt -lncurses -lgpm -- Carlo Wood [EMAIL PROTECTED] PS 'vim' is a personalized script here ;) ~which vim ~/bin/vim ~cat ~/bin/vim FILE=`echo $* | sed -e 's/.* \([^: ]*\)[^ ]*$/\1/' -e 's/\([^:]*\):.*$/\1/'` ARGS= ARG=$1 while shift 1; do ARGS+=`echo \\$ARG\\ | sed -e 's/:$//' -e 's/\(:[0-9][0-9]*\):[0-9][0-9]*$/\1/' -e 's/^\([^:]*\):\([0-9]*\)$/\1 +\2/'` ARG=$1 ARGFILE=`echo $ARG | sed -e 's/.* \([^: ]*\)[^ ]*$/\1/' -e 's/\([^:]*\):.*$/\1/'` if test $FILE = $ARGFILE; then while expr match $FILE \.\./.* /dev/null test ! -f $FILE; do ARG=`echo $ARG | sed -e 's%^\.\./%%'` FILE=`echo $FILE | sed -e 's%^\.\./%%'` done fi done eval /usr/bin/vim $ARGS Running /usr/bin/vim -u /etc/vim/vimrc -N Makefile.am also reproduces. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#400771: vim-gtk loops in syntax_start()
On Tue, Nov 28, 2006 at 05:27:15PM +0100, Carlo Wood wrote: vim uses 100% cpu while scrolling up (starting in a given state) the attached file. How to reproduce: [snipped] Thanks for the detailed steps to reproduce and debugging, unfortunately I'm unable to reproduce the bug in unstable or testing. Are you able to reproduce this if you start vim as vim -u /etc/vim/vimrc -N, :syntax on and then follow the steps you listed? James -- GPG Key: 1024D/61326D40 2003-09-02 James Vega [EMAIL PROTECTED] signature.asc Description: Digital signature
Bug#400771: vim-gtk loops in syntax_start()
Package: vim-gtk Version: 7.0-122+1 vim uses 100% cpu while scrolling up (starting in a given state) the attached file. How to reproduce: Open a gnome-terminal with a height of 24 lines and a width of 126 characters (maximized horizontally on a 1024x768 screen using courier 11 font (default)). In this gnome-terminal run: $ /usr/bin/vim.gtk Makefile.am Go to the top of the file if not already there. Press and hold 'j', scrolling down until you hit the bottom. Then press and hold 'k', scrolling up until vim freezes and starts to use 100% cpu. If it doesn't freeze the first time, try doing it again (go always completely to the bottom and completely to the top - use scrolling, not 'G' to jump). Once looping, it loops inside syntax_start where current_lnum loops over the values 27 to 31, jumping back to 27 after having had value 31 in the last line of load_current_state. At that moment we have the following backtrace: #0 load_current_state (from=0x827a154) at syntax.c:1504 #1 0x0817167f in syntax_start (wp=0x81e5a38, lnum=37) at syntax.c:593 #2 0x08142c85 in win_update (wp=0x81e5a38) at screen.c:2694 #3 0x0814565f in update_screen (type=0) at screen.c:535 #4 0x080d2bb5 in main_loop (cmdwin=0, noexmode=0) at main.c:1083 #5 0x080d5c86 in main (argc=Cannot access memory at address 0x3) at main.c:934 It never leaves syntax_start(), in fact, it never leaves the while loop in this function: 559 while (current_lnum lnum) 560 { 561 syn_start_line(); 562 (void)syn_finish_line(FALSE); 563 ++current_lnum; 564 565 /* If we parsed at least minlines lines or started at a valid 566 * state, the current state is considered valid. */ 567 if (current_lnum = first_stored) 568 { 569 /* Check if the saved state entry is for the current line and is 570 * equal to the current state. If so, then validate all saved 571 * states that depended on a change before the parsed line. */ 572 if (prev == NULL) 573 sp = syn_buf-b_sst_first; 574 else 575 sp = prev-sst_next; 576 if (sp != NULL 577 sp-sst_lnum == current_lnum 578 syn_stack_equal(sp)) 579 { 580 parsed_lnum = current_lnum; 581 prev = sp; 582 while (sp != NULL sp-sst_change_lnum = parsed_lnum) 583 { 584 if (sp-sst_lnum = lnum) 585 /* valid state before desired line, use this one */ 586 prev = sp; 587 else if (sp-sst_change_lnum == 0) 588 /* past saved states depending on change, break here. */ 589 break; 590 sp-sst_change_lnum = 0; 591 sp = sp-sst_next; 592 } 593 load_current_state(prev); 594 } 595 /* Store the state at this line when it's the first one, the line 596 * where we start parsing, or some distance from the previously 597 * saved state. But only when parsed at least 'minlines'. */ 598 else if (prev == NULL 599 || current_lnum == lnum 600 || current_lnum = prev-sst_lnum + dist) 601 prev = store_current_state(prev); 602 } Attached: 'Makefile.am.gz', please gunzip before opening ;). Output of :filetype filetype detection:ON plugin:ON indent:OFF Output of :set filetype filetype=automake -- Carlo Wood [EMAIL PROTECTED] Makefile.am.gz Description: Binary data