Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Macvim abort trap 6 with brew python #20075

Closed
oryband opened this issue May 25, 2013 · 23 comments
Closed

Macvim abort trap 6 with brew python #20075

oryband opened this issue May 25, 2013 · 23 comments

Comments

@oryband
Copy link

oryband commented May 25, 2013

I get the same as #19933 for current MacVim, v. stable 7.3-66 (latest version as of today). Opening up mvim results in abort trap 6 and crashes.

I'm using python 2.7.5, and I have to brew unlink python in order to get macvim to start up properly.

Also, see this issue for a certain Vim plugin for more info on the cause of this.

Any ideas?

@oryband
Copy link
Author

oryband commented Jun 5, 2013

This is related to #18588

@samueljohn
Copy link
Contributor

Can you please gist the output of brew install macvim -v and brew --config and brew doctor?

@samueljohn
Copy link
Contributor

Yes the issue 18588, you mention is related but only indirectly, since other software builds nicely, I guess MacVim has some hardcoded paths or something. Still investigating ...

@samueljohn
Copy link
Contributor

#17908 related?

@oryband
Copy link
Author

oryband commented Jun 5, 2013

@samueljohn That's the issue I was talking about (#17908), forgot to link it here. Thanks for reminding me. :)

Here's the output you asked for, please note I did brew unlink python as I mentioned earlier:

~$ brew install macvim -v
Warning: macvim-7.3-66 already installed
~$ brew --config
HOMEBREW_VERSION: 0.9.4
ORIGIN: http://github.com/mxcl/homebrew.git
HEAD: ee85be5c6f5ff45ddaa936aa6ff5f44b0da43e47
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: dual-core 64-bit penryn
OS X: 10.8.3-x86_64
Xcode: 4.6.2
CLT: 4.6.0.0.1.1365549073
LLVM-GCC: build 2336
Clang: 4.2 build 425
X11: 2.7.4 => /opt/X11
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/local/opt/rbenv/shims/ruby => /usr/local/Cellar/rbenv/0.4.0/shims/ruby
~$ brew doctor
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:

    python

@oryband
Copy link
Author

oryband commented Jun 5, 2013

In addition, I installed macvim with custom icons and override system vim if that makes any difference.
Here's mvim --version output:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jun  5 2013 16:29:54)
MacOS X (unix) version
Included patches: 1-754
Compiled by Homebrew
Huge version with MacVim GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent 
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments 
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff 
+digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi 
+file_in_path +find_in_path +float +folding -footer +fork() +fullscreen 
-gettext -hangul_input +iconv +insert_expand +jumplist +keymap +langmap 
+libcall +linebreak +lispindent +listcmds +localmap -lua +menu +mksession 
+modify_fname +mouse +mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm 
+mouse_netterm +mouse_sgr -mouse_sysmouse +mouse_urxvt +mouse_xterm +multi_byte
 +multi_lang -mzscheme +netbeans_intg +odbeditor +path_extra +perl 
+persistent_undo +postscript +printer +profile +python/dyn -python3 +quickfix 
+reltime +rightleft +ruby +scrollbind +signs +smartindent -sniff +startuptime 
+statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white 
+tcl +terminfo +termresponse +textobjects +title +toolbar +transparency 
+user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace 
+wildignore +wildmenu +windows +writebackup -X11 -xfontset +xim -xsmp 
-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: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe  -DMACOS_X_UNIX -no-cpp-precomp  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1     -I/System/Library/Frameworks/Tcl.framework/Headers  -D_REENTRANT=1  -D_THREAD_SAFE=1  -D_DARWIN_C_SOURCE=1  
Linking: clang   -L.   -L.        -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon      -lncurses -liconv -framework Cocoa    -fstack-protector -L/usr/local/lib  -L/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc   -F/System/Library/Frameworks -framework Tcl -framework CoreFoundation -framework Ruby   

@ssbanerje
Copy link

I have the same problem. The weird thing is that Macvim starts up correctly when you use the GUI icon (from launcher or the Applications folder). But crashes when started from the terminal.

@samueljohn
Copy link
Contributor

Only work-around right now seems to be to leave the brewed python unlinked. Sorry.

  • I really don't know why MacVim dynamically uses any python in PATH if we told it NOT to link dynamically. So just unlinking python during install is not sufficient, and you have to unlink completely as @oryband wrote above.
  • Further, if linked dynamically, I don't know why MacVim does not remember the path to the Python used during compile. xcrun otool -L does not show libpython, so MacVim uses some other mechanism to find and load the library.
  • Last, why is MacVim reporting the correct python during configure but not actually using it. Instead it hard-codes to system python.

If any of these three points would be solved/answered, we could do something. Can anyone, ask a MacVim dev for help. Perhaps we are doing something wrong in the macvim.rb formula. A patch would also be welcome.
I know too little about vim to do this myself.

@oryband
Copy link
Author

oryband commented Jun 6, 2013

@samueljohn I didn't mean to unlink during install, I meant to unlink completely, regardless of install.

@oryband
Copy link
Author

oryband commented Jun 6, 2013

I've opened an issue on Macvim's development page.

@samueljohn
Copy link
Contributor

Thanks. I updated my text, to make it more clear what you told.

@b4winckler
Copy link

MacVim dev here. This is most likely something that has to be fixed in MacVim's configure script. Sorry guys, but I only use the system Python version (and I have a strong aversion to autotools) so somebody else will have to take a look at this. All I can say is that MacVim passes -framework Python which will pick up the system Python version when linking and this is most likely what needs to change. However, I want that flag to be used when not building against a custom Python version. (I'll consider patches sent to the vim_mac Google group.)

@tareqak
Copy link
Contributor

tareqak commented Jun 7, 2013

I'm not sure if I am hijacking this issue or not, but it seems closely related.

I have been using Homebrew's Vim using brew install vim --HEAD (not macvim), and while it compiles successfully, it seems to not use Homebrew's Python or any Python for that matter. Specifically, vim --version returns -with-python instead of +with-python, which I understand to mean that Vim is not compiling with any Python support. I was getting a warning stating that I should export PYTHONPATH= with the recommended site packages directory, but doing that did not help either.

Here the some relevant output:

~ $ brew install vim --HEAD
... (2000+ lines later) ...
2432 files updated, 0 files merged, 0 files removed, 0 files unresolved
==> ./configure --prefix=/usr/local --mandir=/usr/local/Cellar/vim/HEAD/share/man --enable-gui=no --without-x --enable
==> make
==> make install prefix=/usr/local/Cellar/vim/HEAD STRIP=/usr/bin/true
  /usr/local/Cellar/vim/HEAD: 1543 files, 25M, built in 2.0 minutes
~ $ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jun  7 2013 03:21:30)
MacOS X (unix) version
Included patches: 1-1136
Compiled by -@-
Huge version without GUI.  Features included (+) or not (-):
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           +mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         -gettext         -mzscheme        +textobjects
-clientserver    -hangul_input    +netbeans_intg   +title
+clipboard       +iconv           +path_extra      -toolbar
+cmdline_compl   +insert_expand   -perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       -python          +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             +rightleft       +windows
+diff            +menu            +ruby/dyn        +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
+emacs_tags      -mouseshape      -sniff           -xsmp
+eval            +mouse_dec       +startuptime     -xterm_clipboard
+ex_extra        -mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop
+farsi           +mouse_netterm   +syntax
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: cc -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX -no-cpp-precomp  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: cc   -L.     -L/usr/local/lib -o vim        -lm  -lncurses -liconv -framework Cocoa
~ $ brew doctor
Your system is ready to brew.
~ $ brew --config
HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew.git
HEAD: 28e36574495188d215d9dd4e0a2ba03e3cbbf397
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit sandybridge
OS X: 10.8.3-x86_64
Xcode: 4.6.2
CLT: 4.6.0.0.1.1365549073
LLVM-GCC: build 2336
Clang: 4.2 build 425
X11: 2.7.4 => /opt/X11
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

Thanks in advance,

@tareqak
Copy link
Contributor

tareqak commented Jun 7, 2013

I did a brew install vim -vd --HEAD and I found the following as part of the output for ./configure:

checking if compile and link flags for Python are sane... no: PYTHON DISABLED

@oryband
Copy link
Author

oryband commented Jun 8, 2013

@b4winckler If I understood you correctly, -framework Python should be used when not linking against homebrew's Python. So, is there another alternative / parameter to do use a custom-made (homebrew) python instead?

@samueljohn
Copy link
Contributor

Then if python.brewed? we should add -F#{python.framework} to CPPFLAGS and LDFLAGS, I guess. This should add the dir where homebrew has got the python framework.

@samueljohn
Copy link
Contributor

Please not: Don't use HOMEBREW_PREFIX/Frameworks because some symlinks are not working correctly. It's a homebrew bug (or more precise a strange behavior of ruby's File.find)

@b4winckler
Copy link

@oryband Yes, -framework Python should be used when compiling against the Python version that ships with OS X. When linking against a custom Python I'm not sure what to do, but the clues should be inside Vim's src/configure.in file. I think I may have broken the logic in that file when I added the -framework Python flag.

The patch should be submitted to MacVim -- it should not be Homewbrew specific.

@oryband
Copy link
Author

oryband commented Jun 8, 2013

@b4winckler So who's working on it? :) I'm just trying to speed things up here, since I can't use homebrew's Python at the moment.

@samueljohn
Copy link
Contributor

Should be fixed by now. Please brew update, brew rm macvim and brew install macvim.
Thanks for reporting!

@ghost ghost assigned samueljohn Jun 11, 2013
@MichaelRevell
Copy link

Glad this is fixed. :-)

@oryband
Copy link
Author

oryband commented Feb 6, 2014

This bug reappeared as of today. Please see #20392, #17908

@MikeMcQuaid
Copy link
Member

@oryband Please brew update, uninstall python, uninstall macvim, reinstall python and macvim and if it's still an issue please create a new one.

@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants