[TxMt] [TM2] Ruby bundle, strange behavior -> seg fault

Anton Troyanov anton at troyanov.net
Tue Jan 17 19:21:05 UTC 2012


Hey all.

Was playing with TM2 Ruby bundle lately, and found one interesting thing.
I had code:

	require 'rubygems'
	require 'mysql'

	conn=Mysql.new('localhost', 'user', 'user')
	puts conn.server_info


When I run this code in irb, or with ruby command line interpreter from Terminal.app I'm getting server version back (thats what I expect to see)
I have Mac OS Lion, rvm installed and TM_RUBY variable points to /Users/troyanov/.rvm/bin/textmate_ruby what is correct.

If I hit cmd+R in TM2, I'm getting: 
(tried to edit catch_exception.rb, commented all cgi stuff... but no success, had a strange call to Mysql.new() with error like it should run with no args.)

/Users/troyanov/Library/Application Support/TextMate/Managed/Bundles/Ruby.tmbundle/Support/RubyMate/catch_exception.rb:15: [BUG] Segmentation fault
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]

-- Control frame information -----------------------------------------------
c:0004 p:---- s:0018 b:0018 l:000017 d:000017 CFUNC  :sub
c:0003 p:0170 s:0013 b:0008 l:000718 d:000007 BLOCK  /Users/troyanov/Library/Application Support/TextMate/Managed/Bundles/Ruby.tmbundle/Support/RubyMate/catch_exception.rb:15
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:000308 d:000308 TOP   

-- Ruby level backtrace information ----------------------------------------
/Users/troyanov/Library/Application Support/TextMate/Managed/Bundles/Ruby.tmbundle/Support/RubyMate/catch_exception.rb:15:in `block in <top (required)>'
/Users/troyanov/Library/Application Support/TextMate/Managed/Bundles/Ruby.tmbundle/Support/RubyMate/catch_exception.rb:15:in `sub'

-- C level backtrace information -------------------------------------------

   See Crash Report log file under ~/Library/Logs/CrashReporter or
   /Library/Logs/CrashReporter, for the more detail of.

-- Other runtime information -----------------------------------------------

* Loaded script: /Users/troyanov/Desktop/untitled.rb

* Loaded features:

    0 enumerator.so
    1 /Users/troyanov/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin11.2.0/enc/encdb.bundle
    2 /Users/troyanov/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin11.2.0/enc/trans/transdb.bundle
    3 /Users/troyanov/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/defaults.rb
    4 /Users/troyanov/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin11.2.0/rbconfig.rb
    5 /Users/troyanov/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/deprecate.rb
    6 /Users/troyanov/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/exceptions.rb
    7 /Users/troyanov/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb
    8 /Users/troyanov/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems.rb
    9 /Users/troyanov/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin11.2.0/pathname.bundle
   10 /Users/troyanov/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/pathname.rb
   11 /Users/troyanov/Library/Application Support/TextMate/Managed/Bundles/Ruby.tmbundle/Support/RubyMate/catch_exception.rb
   12 /Users/troyanov/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/version.rb
   13 /Users/troyanov/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/requirement.rb
   14 /Users/troyanov/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/platform.rb
   15 /Users/troyanov/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb
   16 /Users/troyanov/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/path_support.rb
   17 /Users/troyanov/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb
   18 /Users/troyanov/.rvm/gems/ruby-1.9.3-p0 at general/gems/mysql-2.8.1/lib/mysql.rb
   19 /Users/troyanov/Library/Application Support/TextMate/Managed/Bundles/Bundle Support.tmbundle/Support/shared/lib/escape.rb
   20 /Users/troyanov/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/cgi/core.rb
   21 /Users/troyanov/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/cgi/cookie.rb
   22 /Users/troyanov/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/cgi/util.rb
   23 /Users/troyanov/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/cgi.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html


More information about the textmate mailing list