Loading ...
Sorry, an error occurred while loading the content.

137299Re: Vim freezes with 100% cpu usage on exit

Expand Messages
  • Thiago Padilha
    Apr 20, 2013
    • 0 Attachment
      Dominique thanks for your help.

      I have attached gdb to vim in both cases: when I re-attach to tmux after a reboot(which hangs without cpu activity for a while) and soon after that, when I send the quit command(which hangs vim with 100% cpu).

      In both cases it seems the issue is related with x11 libraries and the fact that my x11 session(provided by cygwin-x) has a different lifecycle than the vim session.The function that causes vim to freeze with 100% cpu is '_XtWaitForSomething' from libXt. As the name says this function waits for something that never happens with a busy poll which causes the freeze.

      The issue was fixed for me by replacing ubuntu's 'vim-gtk' for 'vim-nox' package. The x11 clipboard integration I replaced by creating mappings that invoke the xclip commandline utility(which doesn't keep a connection with x11 open).

      In any case I attached gdb backtraces for anyone interested in doing further investigations. It may be possible to reproduce these issues by starting vim with x11 support in a tmux/screen session, restarting x11 and then reattaching to it. To debug in debian/ubuntu just install the vim-gtk/vim-dbg packages


      On Fri, Apr 19, 2013 at 4:05 PM, Dominique Pellé <dominique.pelle@...> wrote:
      Thiago Padilha <tpadilha84@...> wrote:

      > Sometimes when I reattach to the tmux session after the virtual machine
      > has been frozen for a long time vim freezes right away without consuming 100% cpu,
      ...
      > This is really annoying me, I was hoping someone could give me hints on how to debug this issue.


      You could build vim with debug information (-g -O0). Then, when bug
      happens & Vim uses 100% of the CPU, you can attach with gdb to the
      Vim process that hogs the CPU, and look at the stack trace. That may
      give useful information to debug it.

      $ gdb
      (gdb) attach pid
      (gdb) bt

      (where pid is he process ID of the Vim process using 100% of the CPU)

      You can then continue with...

      (gdb) c

      ... and press CTRL-C in gdb to stop vim and run bt again to see if you
      get similar stack trace.  You can repeat that a few times to get a feeling
      of what Vim is doing.

      Dominique

      --
      --
      You received this message from the "vim_use" 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

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.



      --
      --
      You received this message from the "vim_use" 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
       
      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
       
       
    • Show all 8 messages in this topic