Skip to content

Conversation

@tek
Copy link
Contributor

@tek tek commented Aug 6, 2013

hey there, I didn't see a way to complete gems that are pulled in via Bundler.require, so I made this.

@tek
Copy link
Contributor Author

tek commented Aug 6, 2013

there you go, @segfault .

@tek
Copy link
Contributor Author

tek commented Aug 8, 2013

is this still visible? merge, anyone?

@jeidsath
Copy link

jeidsath commented Sep 8, 2013

I get segfaults when I enable this.

segfault added a commit that referenced this pull request Sep 9, 2013
allow Gemfile gems to be parsed and required
@segfault segfault merged commit eafac86 into vim-ruby:master Sep 9, 2013
@segfault
Copy link
Member

segfault commented Sep 9, 2013

no segfaults here, offhand I'm guessing that it'll depend on what Gems end up being loaded into the ruby interpreter within vim.

@jeidsath
Copy link

jeidsath commented Sep 9, 2013

I'm getting the segfault at the "Bundler.require" line. Tips on how to track that down further in Vim would be appreciated.

Here's my Gemfile (you probably need to 'bundle install' after creating this):

source 'https://rubygems.org'
gem "savon", "~> 1.2.0"

And here is a test program to demo the segfault:

#!/usr/bin/env ruby

require 'savon'
client = Savon:Client.new()
#Try to tab complete after the period on the next line
client.

@jeidsath
Copy link

jeidsath commented Sep 9, 2013

And here's another with a completely different gem.

.vimrc:
let g:rubycomplete_load_gemfile = 1

Gemfile:
source 'https://rubygems.org'
gem 'sqlite3'

test_crash.rb:
require 'sqlite3'
db = SQLite3::Database.new( "test.db" )
db.

@segfault
Copy link
Member

segfault commented Sep 9, 2013

I just recreated your crash, but I get it without the changes from this pull req.

@jeidsath
Copy link

jeidsath commented Sep 9, 2013

Are you sure? The crash goes away for me when I comment out the Bundler.require line.

@segfault
Copy link
Member

segfault commented Sep 9, 2013

Yup. I just reset on the previous commit and checked the file to be a bit more certain.
It's worth noting that I don't get this behavior at all on my linux boxes (gentoo, arch) or my windows box.

Are you also seeing it on a OSX box?

@jeidsath
Copy link

jeidsath commented Sep 9, 2013

Yes, this is OS X. But I'm afraid that I cannot replicate the crash before including the merge. I just tested the following:

  1. (Set up as above)
  2. Replicated the crash
  3. git reset --hard eafac86
  4. Stopped/started vim
  5. Could not replicate the crash
  6. git pull
  7. Stopped/started vim
  8. Was able to replicate

@segfault
Copy link
Member

segfault commented Sep 9, 2013

Offhand I'm guessing that I have more of the settings enabled that cause buffer loading. I'll have a go at bisecting and debugging this further tomorrow. Crashes like these are nasty since they are sometimes due to limitations on the embedded ruby vm.

@tek
Copy link
Contributor Author

tek commented Sep 9, 2013

everything that's happening asynchronous can lead to vim crashes, maybe it's in the Bundler.require call. Do you use an async autocompletion plugin like YCM?

@jeidsath
Copy link

jeidsath commented Sep 9, 2013

@tek Just supertab. I've tested and repeated the crash after removing everything except pathogen, vim-ruby, and stripping down my .vimrc to this:

call pathogen#infect()
call pathogen#helptags()

filetype plugin indent on

let g:rubycomplete_load_gemfile = 1
let g:rubycomplete_use_bundler = 1

Bundler.require works fine when invoked from my scripts (outside of vim). Maybe Mark is correct about an embedded ruby issue?

@tek
Copy link
Contributor Author

tek commented Sep 10, 2013

Probably. Which vim version are you running?

@jeidsath
Copy link

joel@pds-macbook-air:~$ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jan 28 2013 21:02:22)
Compiled by [email protected]
Normal version without 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 +diff +digraphs
-dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path
+find_in_path +float +folding -footer +fork() -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_sysmouse
+mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype
+path_extra -perl +persistent_undo +postscript +printer -profile +python/dyn
-python3 +quickfix +reltime -rightleft +ruby/dyn +scrollbind +signs
+smartindent -sniff +startuptime +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
-xterm_clipboard -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -D_FORTIFY_SOURCE=0 -Iproto -DHAVE_CONFIG_H -arch i386 -arch x86_64 -g -Os -pipe
Linking: gcc -arch i386 -arch x86_64 -o vim -lncurses

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

Successfully merging this pull request may close these issues.

3 participants