Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Have you had this Ruby 1.9.3 segmentation fault bug? #4050

Closed
alexeymuranov opened this Issue · 17 comments
@alexeymuranov

I am trying to work on rails master branch, and two days ago i started getting strange errors, sometimes they were about missing journey gem (Could not find gem 'journey (~> 1.0.0) ruby, which is required by gem 'rails (>= 0) ruby', in any of the sources.'), sometimes there were the message that You may have encountered a bug in the Ruby interpreter or extension libraries. I couldn't run tests anymore. I tried to checkout my branch where they were still running, but this didn't help. I was very confused, and finally i managed to reproduce a bug like this:

[alexey:rails(master)]$ rvm -v

rvm 1.10.0 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]

[alexey:rails(master)]$ rvm use 1.9.3@tmp
Using /Volumes/Data/Users/alexey/.rvm/gems/ruby-1.9.3-p0 with gemset tmp
[alexey:rails(master)]$ gem list

*** LOCAL GEMS ***


[alexey:rails(master)]$ gem install bundler
Successfully installed bundler-1.0.21
1 gem installed
Installing ri documentation for bundler-1.0.21...
Installing RDoc documentation for bundler-1.0.21...
[alexey:rails(master)]$ bundle update
Updating git://github.com/fxn/sdoc.git
Fetching source index for https://rubygems.org/
/Volumes/Data/Users/alexey/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799: [BUG] Segmentation fault
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin10.8.0]

...

[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

Abort trap

Here is a gist of complete output: https://gist.github.com/1501168.

If i use ruby 1.9.2-p290 instead, then bundle update works fine. I guess i'll have to stay with ruby 1.9.2.

I probably should report this for ruby, but i do not know how to reproduce this without cloning the whole rails repository.

@drogus
Collaborator

The segmentation fault is rather ruby bug and the thing with Journey is lack of one of the master dependencies in Gemfile. Lately @tenderlove rewrote rails router and it's in rails/journey repo. To avoid this you can do:

gem 'journey',   :git => 'git://github.com/rails/journey.git'
gem 'arel',      :git => 'git://github.com/rails/arel.git'

As 3.2.0 is out, journey is released and in the gemspec, so probably it's no more needed (it may be better to keep using it from git if you use master though).

@drogus drogus closed this
@alexeymuranov

Ok, thanks for the explanation, but i still do not know how to formulate the bug to submit a ruby bug report. I thought that if we leave it open, somebody with similar problems could contribute.

@drogus
Collaborator

I think that you should post the Gemfile which causes such behavior to either bundler issues or ruby issues, I doubt that such issue here can help anyone. Segmentation fault during running bundler is not a rails issue.

@alexeymuranov

Ok, i've created a bundler issue here: bundler/bundler#1596.

@alexeymuranov

I've found out that the segmentation fault happens whenever i use

source 'https://rubygems.org'

in the Gemfile, and does not happen with

source 'http://rubygems.org'
@alexeymuranov

Apparently this is a known issue with ruby compiling with Mac OS openssl which in my case is version 0.9.8r. I followed instructions at http://www.christopherirish.com/2011/09/02/ruby-1-9-2-segmentation-fault-and-openssl/ to reinstall ruby-1.9.3-p0 with MacPorts openssl, and now it works. There is a report about this at http://bugs.ruby-lang.org/issues/5655.

@lightyrs

Thank you @alexeymuranov. Using http:// worked for me as well.

@athlite

A simple advice for rvm users:

rvm pkg install openssl

then:

rvm install ruby-1.9.3-p0 --force -C --with-openssl-dir=~/.rvm/usr

It is the latest version of openssl that makes ruby crash.

@neoneye

Where do I find that gemfile on Mac OS X?

@alexeymuranov

@neoneye what do you mean? It is the Gemfile in your ruby/rails application folder.

@alexeymuranov

Here are instructions for using MacPorts binaries with RVM: https://rvm.beginrescueend.com/integration/macports/

@ibanez270dx

Thanks, @alexeymuranov. Your suggestion worked perfectly. I was afraid I wasn't going to be able to play around with 1.9.3!

EDIT: After getting bundler working by just changing HTTPS to HTTP, I ran into several other problems when running tests and certain other rake tasks. The final solution was to uninstall 1.3.9-p125, and re-install with a different OpenSSL:

rvm pkg install openssl
rvm remove 1.9.3-p125
rvm install 1.9.3-p125 --with-openssl-dir=$rvm_path/usr

Thanks again!

@thehungrycoder

@alexeymuranov thanks a lot for your tip. it works for me :).

@fractaloop

Many thanks @athlite! This also works for ruby 1.9.3-p125 (which was also crashing for me)

@gothic1234

rvm install ruby-1.9.3 --with-openssl-dir=/opt/local --with-iconv-dir=/opt/local

This is what worked for me after installing openssh

@jmuheim

Thank you, athlite, this really saved my day! Finally Ruby 1.9.3 on my Mac!

@rubytastic

Had the same Issue, Just found out when I wanted to create a new rails project to test something. Didn't even knew I had this issue before ;) All fixed with @athlite suggestion. thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.