ClosestStorm / macvim

Automatically exported from code.google.com/p/macvim
0 stars 0 forks source link

Crash on Lion #370

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Since upgrading to Lion, MacVim has gone from never crashing to crashing almost 
daily.

My two colleagues that use MacVim have both also had frequent crashes since 
upgrading to Lion.

I got crashes both on my old MacBook that was upgraded to Lion from a Snow 
Leopard installation that already had MacVim 7.3 (55) installed, and on my new 
MacBook Air that came with Lion (now at 10.7.1), and where I installed MacVim 
7.3 (61).

MacVim was installed through homebrew in both cases.

I'm afraid I haven't yet figured out what steps reproduce it, and it's 
infrequent enough (0 to 3 times a day or so) that I can't realistically try 
turning parts of my dotfiles/plugins off and see when it stops.

I'll update this ticket with the output from any future crashes if you don't 
mind. This is the one that happened just now. Crash log attached.

And the below was the terminal output. saveScreenState is from NERDTree, but I 
assume these are errors that are due to the crash, not the cause of it. I tried 
toggling the NERDTree several times to trigger those functions and that did not 
replicate the crash.

    Vim(9846,0x7fff74877960) malloc: *** error for object 0x7fa1ea812c08: incorrect checksum for freed object - object was probably modified after being freed.
    *** set a breakpoint in malloc_error_break to debug
    Vim: Caught deadly signal ABRT
    Vim: preserving files...
    Error detected while processing function <SNR>26_saveScreenState..<SNR>26_putCursorInTreeWin..<SNR>26_exec:Vim: Finished.

    line    3:
    E523: Not allowed here: 1wincmd w
    Press ENTER or type command to continue

I understand this might not be enough to go by to do anything. Please let me 
know if you can think of anything I can do to help track this down.

Original issue reported on code.google.com by hen...@nyh.se on 11 Sep 2011 at 7:09

Attachments:

GoogleCodeExporter commented 9 years ago
On my old computer, MacVim rarely if ever crashed on Snow Leopard, but the same 
installation of MacVim sometimes crashed several times on the same day after 
updating to Lion.

I didn't however start seeing the crashes until after a month or so with Lion, 
when I started using it for full-time work and not just infrequent side 
projects. Not sure if that means the problem was introduced with 10.7.1, some 
changes in my dotfiles (my colleagues use very similar dotfiles), or just by 
using MacVim a lot more.

Original comment by hen...@nyh.se on 11 Sep 2011 at 7:14

GoogleCodeExporter commented 9 years ago
Found a crash log from two days ago that looks near identical.

Original comment by hen...@nyh.se on 11 Sep 2011 at 7:17

Attachments:

GoogleCodeExporter commented 9 years ago
Again. This time EXC_BAD_ACCESS (SIGSEGV) instead of EXC_CRASH (SIGABRT).

Original comment by hen...@nyh.se on 11 Sep 2011 at 7:32

Attachments:

GoogleCodeExporter commented 9 years ago
It looks like it is core Vim that is crashing.  This could be one of two 
reasons: 1) something changed in Lion to cause this, or 2) some new patch to 
Vim is causing this.  (At this point in time I would guess it is the second 
option.)

I just merged the very latest Vim patches to master, so before we do anything 
else please clone the MacVim repo on GitHub and build from that [1] (Homebrew 
won't have the latest patches).  It is possible that the bug has already been 
fixed so lets rule out that possibility before taking this up with the Vim devs.

[1] https://github.com/b4winckler/macvim/wiki/Building

Original comment by bjorn.winckler@gmail.com on 11 Sep 2011 at 8:46

GoogleCodeExporter commented 9 years ago
Björn, thanks.

"** BUILD SUCCEEDED **" but crashes on launch. See log. I built with the exact 
commands and flags from https://github.com/b4winckler/macvim/wiki/Building.

Original comment by hen...@nyh.se on 11 Sep 2011 at 9:49

Attachments:

GoogleCodeExporter commented 9 years ago
It has linked against a different Ruby version than what your plugins use.  Try 
supplying the --with-ruby-command flag to the configure script.  E.g.

./configure --with-ruby-command=/usr/local/bin/ruby

(substitute with the path to your custom Ruby, wherever that is, "which ruby" 
may be the one to use, I'm not sure).

Original comment by bjorn.winckler@gmail.com on 11 Sep 2011 at 10:23

GoogleCodeExporter commented 9 years ago
Björn, thanks again. I use RVM (http://beginrescueend.com/), so I had to do 
"rvm use system" to use system Ruby before building. Or I could have passed it 
in with "--with-ruby-command" I suppose.

It built successfully, so I'll report back if it crashes or goes a few days 
without crashing.

Original comment by hen...@nyh.se on 11 Sep 2011 at 11:23

GoogleCodeExporter commented 9 years ago
Just saw a crash, see log. This time it was EXC_CRASH (SIGABRT).

Original comment by hen...@nyh.se on 15 Sep 2011 at 2:30

Attachments:

GoogleCodeExporter commented 9 years ago
Hmmm...it looks suspiciously like there is still some problem with the Ruby 
support on Lion. I patched a critical Ruby bug a while ago thinking I had fixed 
all problems, but maybe there are still problems.

For the moment all I can say is try running without any plugins that use Ruby. 
It would be interesting to see if Vim stops crashing then.

Which Ruby plugins are you using? I might have to install them myself and see 
if I can reproduce.

What were you doing when this last crash happened? Looks like you were opening 
a file in a split view or something?

Original comment by bjorn.winckler@gmail.com on 15 Sep 2011 at 3:42

GoogleCodeExporter commented 9 years ago
Thanks. I compiled it against system Ruby (1.8.7), but I use another Ruby 
(1.9.3) usually, and ":!which ruby" in MacVim will say 1.9.3. Not sure if that 
plays into it.

The plugins I use are listed here: 
https://github.com/henrik/dotfiles/tree/master/vim/bundle That repo has the 
rest of my vim config, too.

Wonder if it might be Syntastic - I've heard something about it being buggy, 
though not specifically about crashes. It runs on every save. Not sure what I 
was doing just when it crashed, I'm afraid.

Original comment by hen...@nyh.se on 15 Sep 2011 at 10:01

GoogleCodeExporter commented 9 years ago
Can you please report this problem to the vim_dev Google Group?  Include e.g. 
the latest crash log and link to this issue report, then ask if anybody can 
give any hints on how to track down the cause of this crash.  Oh, and also 
mention which patch level you are at (type :ver).

I had a look at your plugins and it is not really feasible for me to try them 
all out to try and track down this bug.

It would be helpful if you could compile MacVim without Ruby support (leave out 
the --enable-rubyinterp flag to configure) and see if that suffers from any 
problems.  (Of course this means you won't be able to use plugins that rely on 
the Ruby interface.)

Original comment by bjorn.winckler@gmail.com on 20 Sep 2011 at 7:42

GoogleCodeExporter commented 9 years ago
I'll see about reporting the problem to them.

I just had another crash (" Vim: Caught deadly signal SEGV", don't see a full 
crash log), and I could tell from the restored swap file that I was probably 
autocompleting using the tab key. Tried the very same autocompletion after 
restoring, and I got the same crash again. But after restarting again I don't 
get it.

I'll try removing any customizations/plugins around tab completion and see if 
that helps.

Original comment by hen...@nyh.se on 21 Sep 2011 at 7:59

GoogleCodeExporter commented 9 years ago
OK.  Please try and keep reproducing the bug and let me know what was going on 
when it crashed -- I may be able to provide some insight.

Original comment by bjorn.winckler@gmail.com on 21 Sep 2011 at 8:56

GoogleCodeExporter commented 9 years ago
Not sure if these are related, but got this barfed all over my terminal:

:Vim: Caught deadly signal SEGV
2011-09-22 13:51:53.658 MacVim[29672:507] *** -[__NSArrayM 
replaceObjectAtIndex:withObject:]: index 9223372036854775807 beyond bounds [0 
.. 6]
2011-09-22 13:51:53.679 MacVim[29672:507] (
        0   CoreFoundation                      0x00007fff8d803986 __exceptionPreprocess + 198
        1   libobjc.A.dylib                     0x00007fff91e1ad5e objc_exception_throw + 43
        2   CoreFoundation                      0x00007fff8d7ae9f7 -[__NSArrayM replaceObjectAtIndex:withObject:] + 279
        3   PSMTabBarControl                    0x0000000102b95e64 -[PSMTabDragAssistant performDragOperation] + 160
        4   PSMTabBarControl                    0x0000000102b8a23c -[PSMTabBarControl performDragOperation:] + 135
        5   AppKit                              0x00007fff92428802 NSCoreDragReceiveMessageProc + 1462
        6   HIServices                          0x00007fff8c76c88f CallReceiveMessageCollectionWithMessage + 70
        7   HIServices                          0x00007fff8c76c994 DoMultipartDropMessage + 126
        8   HIServices                          0x00007fff8c76cb9d DoDropMessage + 55
        9   HIServices                          0x00007fff8c76d075 SendDropMessage + 39
        10  HIServices                          0x00007fff8c76fd3e DragInApplication + 717
        11  HIServices                          0x00007fff8c76ffe0 CoreDragStartDragging + 517
        12  AppKit                              0x00007fff924266e4 -[NSCoreDragManager _dragUntilMouseUp:accepted:] + 885
        13  AppKit                              0x00007fff92425db0 -[NSCoreDragManager dragImage:fromWindow:at:offset:event:pasteboard:source:slideBack:] + 1455
        14  AppKit                              0x00007fff92719a2e -[NSWindow(NSDrag) dragImage:at:offset:event:pasteboard:source:slideBack:] + 132
        15  PSMTabBarControl                    0x0000000102b96eaa -[PSMTabDragAssistant startDraggingCell:fromTabBar:withMouseDownEvent:] + 1008
        16  PSMTabBarControl                    0x0000000102b8da40 -[PSMTabBarControl mouseDragged:] + 540
        17  AppKit                              0x00007fff9211f906 -[NSWindow sendEvent:] + 7404
        18  AppKit                              0x00007fff920b7d4d -[NSApplication sendEvent:] + 5665
        19  MacVim                              0x0000000102b3ae2a -[MMApplication sendEvent:] + 438
        20  AppKit                              0x00007fff9204e25f -[NSApplication run] + 548
        21  AppKit                              0x00007fff922cc35e NSApplicationMain + 867
        22  MacVim                              0x0000000102b23198 start + 52

Original comment by hen...@nyh.se on 22 Sep 2011 at 11:53

GoogleCodeExporter commented 9 years ago
Hmm.  That is a crash inside the PSMTabBarControl framework and has 
(presumably) nothing to do with the other issue.

Original comment by bjorn.winckler@gmail.com on 22 Sep 2011 at 3:31

GoogleCodeExporter commented 9 years ago
This bug was introduced with Lion and occurs with the command line vim that 
comes with Lion.   What ever plugin/vim component is causing the crash is 
installed by default by Apple.

https://discussions.apple.com/message/16264244#16264244

Original comment by dlari...@gmail.com on 1 Oct 2011 at 1:44

GoogleCodeExporter commented 9 years ago
A friend said MacVim stopped crashing, possibly with OS X 10.7.2 or with 
MacVim. 7.3 (62).  I'm still on 7.3 (61) and I don't believe I've had crashes 
since OS X 10.7.2, and neither has my colleague. Should give it a few more 
days, but it might have been resolved.

Original comment by hen...@nyh.se on 15 Oct 2011 at 8:50

GoogleCodeExporter commented 9 years ago
OK, please let me know in a couple of days how it goes.  I still have no real 
idea as to what this problem is (since I've had zero crashes myself).

Original comment by bjorn.winckler@gmail.com on 15 Oct 2011 at 11:36

GoogleCodeExporter commented 9 years ago
Hadn't had crashes since I wrote that comment, but had one today. Don't know if 
it's related to the earlier crashes. Things are definitely much, much better, 
either way.

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)

See attached log.

Original comment by hen...@nyh.se on 21 Oct 2011 at 10:43

Attachments:

GoogleCodeExporter commented 9 years ago
Every crash log (bar one) that you post have been crashes in core Vim.  I can 
only fix MacVim problems so please report this to the core Vim developers.  
That is, post to the vim_dev Google group.  Thanks.

Original comment by bjorn.winckler@gmail.com on 21 Oct 2011 at 5:11

GoogleCodeExporter commented 9 years ago
I'm seeing a SEGV as well building with homebrew:
brew install macvim --HEAD

The problem appears to be happen with python plugins like VimRepress and 
UltraBlog.  That said I can do :python print 'hi' no problem.

Original comment by chnic...@gmail.com on 4 Nov 2011 at 4:24

GoogleCodeExporter commented 9 years ago
Determined that running this command can reproduce the crash:
:python import sys; sys.stdout.write("Anything");

or 

:python import sys; sys.stderr.write("Anything");

Original comment by chnic...@gmail.com on 4 Nov 2011 at 4:57

GoogleCodeExporter commented 9 years ago
Excellent! I can reproduce with the lines from comment 22.  I will try to debug 
this within the next couple of days.  Thank you.

Original comment by bjorn.winckler@gmail.com on 4 Nov 2011 at 5:27

GoogleCodeExporter commented 9 years ago
Well, the Python issue is a 64 bit issue.  Adding "--with-macarchs=i386" as a 
flag to "configure" makes the problem go away (this flag causes MacVim to build 
as 32 bit, as opposed to 64 bit which is the Lion default).

Everybody who has stability issues should try compiling 32 bit and see if that 
fixes their issue.  I'll continue debugging to see if I can get a working 64 
bit version to compile.

Original comment by bjorn.winckler@gmail.com on 5 Nov 2011 at 11:38

GoogleCodeExporter commented 9 years ago
Was finally able to get this working with homebrew:

1. brew edit macvim and set the 'arch' variable to i386 (line 33)
2. Ensure you are using the system ruby (I had a 1.9.2 x64 version set with rvm 
and that would not build with i386 set) if you use RVM just do "rvm system"
3. brew install macvim --HEAD

That did it.  Python plugins are working.  I did have to recompile command-T 
using the system ruby as well (there may be other plugins that need this too)..

Original comment by chnic...@gmail.com on 5 Nov 2011 at 6:46

GoogleCodeExporter commented 9 years ago
Thanks for the confirmation.  I've asked on vim_dev if anybody has any ideas 
why Python and 64 bit don't match.  If anybody reading this has any ideas, 
please let me know.

Original comment by bjorn.winckler@gmail.com on 5 Nov 2011 at 7:11

GoogleCodeExporter commented 9 years ago
I experienced trouble with MacVim (snapshot-64) installed with home brew.  In 
particular, all open windows would be closed upon:

1) running ":python print 2+2"
2) opening certain python file from my site-packages folder

My fix, after reading issue 370 and issue 392 was the following:

brew unlink python;
brew unlink macvim; 
brew install -v --force macvim; 
brew link macvim; 
brew link python

My problems have disappeared.  Also, it appears to be 64-bit.   E.g.:

:python import sys; print sys.maxint
> 9223372036854775807

Thanks,
- S.

Original comment by stu.andrews on 13 Jan 2012 at 11:08