Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gvim crashes with Gcommit #456

Closed
oz123 opened this issue Mar 27, 2014 · 7 comments
Closed

Gvim crashes with Gcommit #456

oz123 opened this issue Mar 27, 2014 · 7 comments

Comments

@oz123
Copy link

oz123 commented Mar 27, 2014

Hi,
For some reason, doing :Gcommit inside Gvim (7.4 on Debian) causes Gvim to SEGFAULT.

I tested deactivating all my bundles except vim-fugitive.

This is not happening in vim inside the terminal.

Can I do something to supply a better trace ?

@tpope
Copy link
Owner

tpope commented Mar 27, 2014

I just tried on Ubuntu (which appears to use a stock Vim 7.4.000 from Debian) and can't reproduce. Can you check :version and see if there are any patches included? It will say so in the first few lines if so.

@oz123
Copy link
Author

oz123 commented Mar 28, 2014

Hi, here it is:

:version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Feb  3 2014 00:35:25)
Included patches: 1-161
Modified by pkg-vim-maintainers@lists.alioth.debian.org   

I can reproduce it two different Debian installations (both with Debian Jessie).

$ aptitude show vim-gtk
Package: vim-gtk                         
State: installed
Automatically installed: no
Version: 2:7.4.161-1
Priority: extra
Section: editors
Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
Architecture: amd64
Uncompressed Size: 2,632 k
Depends: vim-gui-common (= 2:7.4.161-1), vim-common (= 2:7.4.161-1), vim-runtime (= 2:7.4.161-1), libacl1 (>= 2.2.51-8), libc6 (>= 2.15), libgdk-pixbuf2.0-0 (>=
         2.22.0), libglib2.0-0 (>= 2.12.0), libgpm2 (>= 1.20.4), libgtk2.0-0 (>= 2.24.0), libice6 (>= 1:1.0.0), liblua5.1-0, libpango-1.0-0 (>= 1.14.0), libperl5.18 (>=
         5.18.2), libpython2.7 (>= 2.7), libruby1.9.1 (>= 1.9.2.0), libselinux1 (>= 1.32), libsm6, libtinfo5, libx11-6, libxt6, tcl8.5 (>= 8.5.0)

...

@tpope
Copy link
Owner

tpope commented Mar 28, 2014

My guess would be one of those 161 patches introduced a bug. You can try throwing return '' at various points in s:Commit() and see if you can isolate the trigger. Or you could try compiling Vim yourself with some other subset of patches.

@oz123
Copy link
Author

oz123 commented Mar 30, 2014

Hi,
I compile vim 7.4 from source without any patches on Ubuntu 13.10 with --with-features=big, no patches applied. The issue is still there. I also tried deactivating all my other plugins. Still no success. I would like to explore the other option you mentioned, but it is not clear what it is. Can you explain how to trace it?

@tpope
Copy link
Owner

tpope commented Mar 30, 2014

Search for function! s:Commit( in the source. The inner workings may be opaque but hopefully the basic structure is pretty obvious.

Add return '' as the first line of the function. Now if you :Gcommit, it should do nothing, but also not crash. Good! Now move that return '' somewhere else and try again. Try to find the latest point you can put it and not crash. That means the next line is causing the crash.

@oz123
Copy link
Author

oz123 commented Jan 26, 2015

@tpope

It took me a while to come back to it...

I guess I know why you could not reproduce. Your work flow would be something like this:

Open a file and do one of the following:

  1. Gstatus -> press - to add the modified file -> press cc -> edit the message and write and exit the buffer with :x. This does not crash!
  2. Gcommit %--- also does not crash ...
  3. Gwrite %-> Gcommit --- also does not crash ...

My unnecessarily complicated work flow was something like the following (which probably make gvim crash...):

  1. Make some changes
  2. save buffer
  3. Type Gcommit
  4. go to line changed and press -
  5. Now in the changes to be commited but in command mode. try:
    press a
    press :q
  6. You should be in the text buffer from before
  7. Now type Gcommit again.
  8. You should be in COMMIT_EDITMSG in the upper split and already in insert
  9. Write your message and close the buffer :close :bd or :x
  10. Your commit is done but vim crashed. .

Using your method, I found out that the crash is not happening if I return before:

    call fugitive#reload_status()

Which also explains why my commit was done.

This crash does not happen to me with vim (using the curses interface) using my work flow.
I tried my odd workflow on MacVIM and it does not happen there.

My usual desktop is mate-desktop previously GNOME2. Maybe this has to do with GTK2?
I am going to try on Ubuntu with unity desktop and see what I come up with ...

@oz123
Copy link
Author

oz123 commented Mar 2, 2016

Unfortunately, I still have not found what caused the problem. It seems to disappear with newer versions of vim.

@oz123 oz123 closed this as completed Mar 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants