New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need help reporting Ruby 1.9.3 segmentation fault on bundle update #1596

Closed
alexeymuranov opened this Issue Dec 20, 2011 · 20 comments

Comments

Projects
None yet
8 participants
@alexeymuranov

alexeymuranov commented Dec 20, 2011

Hello, i've run into a segmentation fault in ruby 1.9.3-p0 when running bundle update on rails master branch with bundler-1.0.21. I've explained how to reproduce the issue here, but it is not a rails issue: rails/rails#4050. Here is the Gemfile that causes the problem: https://gist.github.com/1502675.

I will appreciate some help because i do not know how to make a ruby bug report out of this.

@jeremy

This comment has been minimized.

Show comment
Hide comment
@jeremy

jeremy Dec 20, 2011

Contributor

Can you narrow down the failure to a simpler Gemfile? Then submit a bug with reproduction instructions to http://bugs.ruby-lang.org/projects/ruby-trunk

Contributor

jeremy commented Dec 20, 2011

Can you narrow down the failure to a simpler Gemfile? Then submit a bug with reproduction instructions to http://bugs.ruby-lang.org/projects/ruby-trunk

@alexeymuranov

This comment has been minimized.

Show comment
Hide comment
@alexeymuranov

alexeymuranov Dec 20, 2011

I may try when i have time, but i am not very familiar with bundler to see how to make a minimal example out of this.

alexeymuranov commented Dec 20, 2011

I may try when i have time, but i am not very familiar with bundler to see how to make a minimal example out of this.

@jeremy

This comment has been minimized.

Show comment
Hide comment
@jeremy

jeremy Dec 20, 2011

Contributor

Try removing gems from Gemfile until it starts working. Get the minimal case that reproduces the error.

Contributor

jeremy commented Dec 20, 2011

Try removing gems from Gemfile until it starts working. Get the minimal case that reproduces the error.

@alexeymuranov

This comment has been minimized.

Show comment
Hide comment
@alexeymuranov

alexeymuranov Dec 20, 2011

Ok, thanks, i'll try.

alexeymuranov commented Dec 20, 2011

Ok, thanks, i'll try.

@alexeymuranov

This comment has been minimized.

Show comment
Hide comment
@alexeymuranov

alexeymuranov Dec 21, 2011

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'

Could you help me reproduce the segmentation fault in pure Ruby out of this?

alexeymuranov commented Dec 21, 2011

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'

Could you help me reproduce the segmentation fault in pure Ruby out of this?

@skade

This comment has been minimized.

Show comment
Hide comment
@skade

skade Dec 21, 2011

@alexeymuranov

You haven't posted the error report. There is a common error with HTTPS that begins like this:

c:0065 p:---- s:0330 b:0330 l:000329 d:000329 CFUNC :connect
c:0064 p:0011 s:0327 b:0327 l:001c30 d:000326 BLOCK 
/Users/Falcon/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/net/http.rb:678
c:0063 p:0111 s:0325 b:0325 l:001460 d:001460 METHOD 

If yes, this is probably related to an outdated version of openssl. See:

http://www.christopherirish.com/2011/09/02/ruby-1-9-2-segmentation-fault-and-openssl/

and

http://www.ruby-forum.com/topic/3077566

AFAIK, you should use OpenSSL 1.0 with any recent version of Ruby 1.9 .

skade commented Dec 21, 2011

@alexeymuranov

You haven't posted the error report. There is a common error with HTTPS that begins like this:

c:0065 p:---- s:0330 b:0330 l:000329 d:000329 CFUNC :connect
c:0064 p:0011 s:0327 b:0327 l:001c30 d:000326 BLOCK 
/Users/Falcon/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/net/http.rb:678
c:0063 p:0111 s:0325 b:0325 l:001460 d:001460 METHOD 

If yes, this is probably related to an outdated version of openssl. See:

http://www.christopherirish.com/2011/09/02/ruby-1-9-2-segmentation-fault-and-openssl/

and

http://www.ruby-forum.com/topic/3077566

AFAIK, you should use OpenSSL 1.0 with any recent version of Ruby 1.9 .

@alexeymuranov

This comment has been minimized.

Show comment
Hide comment
@alexeymuranov

alexeymuranov Dec 21, 2011

Yes, sorry, here: https://gist.github.com/1501168. I will read about openssl.

alexeymuranov commented Dec 21, 2011

Yes, sorry, here: https://gist.github.com/1501168. I will read about openssl.

@jeremy

This comment has been minimized.

Show comment
Hide comment
@jeremy

jeremy Dec 21, 2011

Contributor

This is enough to post a minimal reproduction to http://bugs.ruby-lang.org - good job!

Contributor

jeremy commented Dec 21, 2011

This is enough to post a minimal reproduction to http://bugs.ruby-lang.org - good job!

@jeremy jeremy closed this Dec 21, 2011

@skade

This comment has been minimized.

Show comment
Hide comment
@skade

skade Dec 21, 2011

Please don't. It will be marked as dupe. As I said before, recent ruby 1.9 must be used with openssl 1.0 and this is the occuring error.

Wait until the OP has checked his ruby installation.

Am 21.12.2011 um 18:37 schrieb Jeremy Kemper reply@reply.github.com:

This is enough to post a minimal reproduction to http://bugs.ruby-lang.org - good job!


Reply to this email directly or view it on GitHub:
#1596 (comment)

skade commented Dec 21, 2011

Please don't. It will be marked as dupe. As I said before, recent ruby 1.9 must be used with openssl 1.0 and this is the occuring error.

Wait until the OP has checked his ruby installation.

Am 21.12.2011 um 18:37 schrieb Jeremy Kemper reply@reply.github.com:

This is enough to post a minimal reproduction to http://bugs.ruby-lang.org - good job!


Reply to this email directly or view it on GitHub:
#1596 (comment)

@jeremy

This comment has been minimized.

Show comment
Hide comment
@jeremy

jeremy Dec 21, 2011

Contributor

Even better, the issue is probably solved. (Why does Ruby compile with pre-1.0 openssl, then?)

Contributor

jeremy commented Dec 21, 2011

Even better, the issue is probably solved. (Why does Ruby compile with pre-1.0 openssl, then?)

@alexeymuranov

This comment has been minimized.

Show comment
Hide comment
@alexeymuranov

alexeymuranov Dec 21, 2011

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 fine, thanks, skade. There is already a report at http://bugs.ruby-lang.org/issues/5655. My Mac OS openssl version is 0.9.8r.

alexeymuranov commented Dec 21, 2011

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 fine, thanks, skade. There is already a report at http://bugs.ruby-lang.org/issues/5655. My Mac OS openssl version is 0.9.8r.

@eddroid

This comment has been minimized.

Show comment
Hide comment
@eddroid

eddroid Mar 13, 2012

$: cat .rbenv-version
1.9.3-p125

$: bundle --version
Bundler version 1.1.0

$: ruby -v
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin10.8.0]

$: bundle exec ruby -v
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin10.8.0]

$: bundle install

Segmentation Fault in 1.9.3-p125/lib/ruby/1.9.1/net/http.rb:799 trying to access https://rubygems.org

Using default Gemfile from bundle init

$: irb


> > require 'openssl'
> > http = Net::HTTP.new('rubygems.org', 443)
> > http.use_ssl = true
> > http.head("/")
> > exit```
> > # This snippet didn't segfault.

$: `bundle exec irb`
```>> require 'net/http'

> > require 'openssl'
> > http = Net::HTTP.new('rubygems.org', 443)
> > http.use_ssl = true
> > http.head("/")```
> > # This snippet segfaults. Wat?

# Ruby was compiled with the MacPorts OpenSSL in /opt/local/ (via `rbenv install 1.9.3-p125`)
$: `otool -L ~/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin10.8.0/openssl.bundle`
~/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin10.8.0/openssl.bundle:
/opt/local/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/opt/local/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.6)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)

# fix: recompile Ruby without MacPorts OpenSSL (which is actually the opposite of the advice everyone seems to be recommending)
# Remove MacPorts /opt/local paths from PATH
$: `export PATH=~/.rbenv/bin:/usr/local/mysql/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/local/bin/`
$: `rbenv install 1.9.3-p125`
Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz...
Installing yaml-0.1.4...
Installed yaml-0.1.4 to ~/.rbenv/versions/1.9.3-p125
Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz...
Installing ruby-1.9.3-p125...
Installed ruby-1.9.3-p125 to ~/.rbenv/versions/1.9.3-p125

# confirm Ruby is now compiled with the old OpenSSL
$: `otool -L ~/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin10.8.0/openssl.bundle`
~/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin10.8.0/openssl.bundle:
    /usr/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
    /usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)

$: `bundle install`
Fetching gem metadata from https://rubygems.org/.........
Using rake (0.9.2.2) 
# ...snip...

$: `bundle exec irb`
```>> require 'net/http'
=> true

> > require 'openssl'
> > => true
> > http = Net::HTTP.new('rubygems.org', 443)
> > => #<Net::HTTP rubygems.org:443 open=false>
> > http.use_ssl = true
> > => true
> > http.head("/")
> > => #<Net::HTTPOK 200 OK readbody=true>```

Some of the output is faked because I'm not re-breaking my environment to get back into that state. I don't have any guess as to why Ruby OpenSSL was only broken in the context of `bundle exec`. Nothing I've read indicated that downgrading OpenSSL was the way to go. Nothing I've found refers to fixing this with rbenv and ruby-build (rather than rvm). I might have picked up the MacPorts OpenSSL recently, which might explain why I didn't have this problem with 1.9.3-p0. Rebuilding 1.9.3-p0 with MacPorts OpenSSL breaks the same way.

eddroid commented Mar 13, 2012

$: cat .rbenv-version
1.9.3-p125

$: bundle --version
Bundler version 1.1.0

$: ruby -v
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin10.8.0]

$: bundle exec ruby -v
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin10.8.0]

$: bundle install

Segmentation Fault in 1.9.3-p125/lib/ruby/1.9.1/net/http.rb:799 trying to access https://rubygems.org

Using default Gemfile from bundle init

$: irb


> > require 'openssl'
> > http = Net::HTTP.new('rubygems.org', 443)
> > http.use_ssl = true
> > http.head("/")
> > exit```
> > # This snippet didn't segfault.

$: `bundle exec irb`
```>> require 'net/http'

> > require 'openssl'
> > http = Net::HTTP.new('rubygems.org', 443)
> > http.use_ssl = true
> > http.head("/")```
> > # This snippet segfaults. Wat?

# Ruby was compiled with the MacPorts OpenSSL in /opt/local/ (via `rbenv install 1.9.3-p125`)
$: `otool -L ~/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin10.8.0/openssl.bundle`
~/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin10.8.0/openssl.bundle:
/opt/local/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/opt/local/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.6)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)

# fix: recompile Ruby without MacPorts OpenSSL (which is actually the opposite of the advice everyone seems to be recommending)
# Remove MacPorts /opt/local paths from PATH
$: `export PATH=~/.rbenv/bin:/usr/local/mysql/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/local/bin/`
$: `rbenv install 1.9.3-p125`
Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz...
Installing yaml-0.1.4...
Installed yaml-0.1.4 to ~/.rbenv/versions/1.9.3-p125
Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz...
Installing ruby-1.9.3-p125...
Installed ruby-1.9.3-p125 to ~/.rbenv/versions/1.9.3-p125

# confirm Ruby is now compiled with the old OpenSSL
$: `otool -L ~/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin10.8.0/openssl.bundle`
~/.rbenv/versions/1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin10.8.0/openssl.bundle:
    /usr/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
    /usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 0.9.8)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)

$: `bundle install`
Fetching gem metadata from https://rubygems.org/.........
Using rake (0.9.2.2) 
# ...snip...

$: `bundle exec irb`
```>> require 'net/http'
=> true

> > require 'openssl'
> > => true
> > http = Net::HTTP.new('rubygems.org', 443)
> > => #<Net::HTTP rubygems.org:443 open=false>
> > http.use_ssl = true
> > => true
> > http.head("/")
> > => #<Net::HTTPOK 200 OK readbody=true>```

Some of the output is faked because I'm not re-breaking my environment to get back into that state. I don't have any guess as to why Ruby OpenSSL was only broken in the context of `bundle exec`. Nothing I've read indicated that downgrading OpenSSL was the way to go. Nothing I've found refers to fixing this with rbenv and ruby-build (rather than rvm). I might have picked up the MacPorts OpenSSL recently, which might explain why I didn't have this problem with 1.9.3-p0. Rebuilding 1.9.3-p0 with MacPorts OpenSSL breaks the same way.
@kliuless

This comment has been minimized.

Show comment
Hide comment
@kliuless

kliuless Mar 18, 2012

Apparently eddroid is correct. I was getting the segfault only with bundler. My "otool" showed that the Macports openssl 1.0.0 was being used. Without rebuilding ruby, I could avoid the segfault if I forced the built-in 0.9.8 to be loaded like this:

DYLD_LIBRARY_PATH=/usr/lib bundle install

Edit: well, it seems the issue isn't as simple as I thought. The cause seems to be related to the order that bundles or dylibs are loaded. eddroid's irb example doesn't seem representative because irb isn't acting the same way as in pure ruby. Here's a minimal example to illustrate:

This segfaults:

bundle exec ruby -r net/http -e 'warn $$; Net::HTTP.new("rubygems.org", 443).tap{|h| h.use_ssl = true; p h.head("/") }'

This doesn't:

bundle exec ruby -r net/http -r openssl -e 'warn $$; Net::HTTP.new("rubygems.org", 443).tap{|h| h.use_ssl = true; p h.head("/") }'

The only difference was the explicit require of openssl.

I added a sleep right before the "head" call so I could run lsof on both. They had the same libs loaded but in a different order.
Segfault order:

COMMAND   PID      USER   FD   TYPE     DEVICE  SIZE/OFF    NODE NAME
ruby    10953 kl  cwd    DIR       14,2       918 2627735 /Users/kl/projects/rails/test_app
ruby    10953 kl  txt    REG       14,2      9248 2336122 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
ruby    10953 kl  txt    REG       14,2   2854432 2336124 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/libruby.1.9.1.dylib
ruby    10953 kl  txt    REG       14,2     13080 2336788 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/enc/encdb.bundle
ruby    10953 kl  txt    REG       14,2     12856 2336830 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/enc/trans/transdb.bundle
ruby    10953 kl  txt    REG       14,2    188392 2336865 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/socket.bundle
ruby    10953 kl  txt    REG       14,2     78640 2336872 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/zlib.bundle
ruby    10953 kl  txt    REG       14,2     40184 2336866 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/stringio.bundle
ruby    10953 kl  txt    REG       14,2     55096 2336857 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/pathname.bundle
ruby    10953 kl  txt    REG       14,2     17808 2336838 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/etc.bundle
ruby    10953 kl  txt    REG       14,2     33272 2336858 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/psych.bundle
ruby    10953 kl  txt    REG       14,2    150784 2326564 /Users/kl/.rvm/usr/lib/libyaml-0.2.dylib
ruby    10953 kl  txt    REG       14,2     30312 2336867 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/strscan.bundle
ruby    10953 kl  txt    REG       14,2    317912 2336772 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/date_core.bundle
ruby    10953 kl  txt    REG       14,2      9640 2336778 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/digest/sha1.bundle
ruby    10953 kl  txt    REG       14,2     24248 2336780 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/digest.bundle
ruby    10953 kl  txt    REG       14,2     10496 2336795 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/enc/iso_8859_1.bundle
ruby    10953 kl  txt    REG       14,2     96280  899966 /opt/local/lib/libz.1.2.5.dylib
ruby    10953 kl  txt    REG       14,2      8776 2336839 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/fcntl.bundle
ruby    10953 kl  txt    REG       14,2    429712 2336856 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/openssl.bundle
ruby    10953 kl  txt    REG       14,2    400536  919064 /opt/local/lib/libssl.1.0.0.dylib
ruby    10953 kl  txt    REG       14,2   1798608  919061 /opt/local/lib/libcrypto.1.0.0.dylib
ruby    10953 kl  txt    REG       14,2   1054960 1073004 /usr/lib/dyld
ruby    10953 kl  txt    REG       14,2 235020288 2448278 /private/var/db/dyld/dyld_shared_cache_x86_64
ruby    10953 kl    0u   CHR       16,2     0t506    1059 /dev/ttys002
ruby    10953 kl    1u   CHR       16,2     0t506    1059 /dev/ttys002
ruby    10953 kl    2u   CHR       16,2     0t506    1059 /dev/ttys002
ruby    10953 kl    3   PIPE 0x08bbbc80     16384         ->0x121bf004
ruby    10953 kl    4   PIPE 0x121bf004     16384         ->0x08bbbc80
ruby    10953 kl    5r   CHR        3,2       0t0     297 /dev/null
ruby    10953 kl    6w   CHR        3,2       0t0     297 /dev/null

Successful order:

COMMAND   PID      USER   FD   TYPE     DEVICE  SIZE/OFF    NODE NAME
ruby    10920 kl  cwd    DIR       14,2       884 2627735 /Users/kl/projects/rails/test_app
ruby    10920 kl  txt    REG       14,2      9248 2336122 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
ruby    10920 kl  txt    REG       14,2   2854432 2336124 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/libruby.1.9.1.dylib
ruby    10920 kl  txt    REG       14,2     13080 2336788 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/enc/encdb.bundle
ruby    10920 kl  txt    REG       14,2     12856 2336830 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/enc/trans/transdb.bundle
ruby    10920 kl  txt    REG       14,2    188392 2336865 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/socket.bundle
ruby    10920 kl  txt    REG       14,2     78640 2336872 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/zlib.bundle
ruby    10920 kl  txt    REG       14,2     40184 2336866 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/stringio.bundle
ruby    10920 kl  txt    REG       14,2     96280  899966 /opt/local/lib/libz.1.2.5.dylib
ruby    10920 kl  txt    REG       14,2     24248 2336780 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/digest.bundle
ruby    10920 kl  txt    REG       14,2    429712 2336856 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/openssl.bundle
ruby    10920 kl  txt    REG       14,2    400536  919064 /opt/local/lib/libssl.1.0.0.dylib
ruby    10920 kl  txt    REG       14,2      8776 2336839 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/fcntl.bundle
ruby    10920 kl  txt    REG       14,2     55096 2336857 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/pathname.bundle
ruby    10920 kl  txt    REG       14,2     17808 2336838 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/etc.bundle
ruby    10920 kl  txt    REG       14,2     33272 2336858 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/psych.bundle
ruby    10920 kl  txt    REG       14,2     30312 2336867 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/strscan.bundle
ruby    10920 kl  txt    REG       14,2      9640 2336778 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/digest/sha1.bundle
ruby    10920 kl  txt    REG       14,2     10496 2336795 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/enc/iso_8859_1.bundle
ruby    10920 kl  txt    REG       14,2   1798608  919061 /opt/local/lib/libcrypto.1.0.0.dylib
ruby    10920 kl  txt    REG       14,2    150784 2326564 /Users/kl/.rvm/usr/lib/libyaml-0.2.dylib
ruby    10920 kl  txt    REG       14,2    317912 2336772 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/date_core.bundle
ruby    10920 kl  txt    REG       14,2   1054960 1073004 /usr/lib/dyld
ruby    10920 kl  txt    REG       14,2 235020288 2448278 /private/var/db/dyld/dyld_shared_cache_x86_64
ruby    10920 kl    0u   CHR       16,2   0t85128    1059 /dev/ttys002
ruby    10920 kl    1u   CHR       16,2   0t85128    1059 /dev/ttys002
ruby    10920 kl    2u   CHR       16,2   0t85128    1059 /dev/ttys002
ruby    10920 kl    3   PIPE 0x121befa0     16384         ->0x08bbbc1c
ruby    10920 kl    4   PIPE 0x08bbbc1c     16384         ->0x121befa0
ruby    10920 kl    5r   CHR        3,2       0t0     297 /dev/null
ruby    10920 kl    6w   CHR        3,2       0t0     297 /dev/null

Both were run against the macports openssl.
However, there seems to be version discrepancy. Running "/opt/local/bin/openssl version" gives me 1.0.0d, but "port list openssl" gives me 1.0.0e. Not sure if that makes any difference.

I was also able to patch bundler to stop the segfault.
Type "which bundle" (or "rbenv which bundle" on rbenv) to locate the executable. Make sure the file comment contains "This file was generated by RubyGems." Add a require 'openssl' before or after require 'rubygems'.

kliuless commented Mar 18, 2012

Apparently eddroid is correct. I was getting the segfault only with bundler. My "otool" showed that the Macports openssl 1.0.0 was being used. Without rebuilding ruby, I could avoid the segfault if I forced the built-in 0.9.8 to be loaded like this:

DYLD_LIBRARY_PATH=/usr/lib bundle install

Edit: well, it seems the issue isn't as simple as I thought. The cause seems to be related to the order that bundles or dylibs are loaded. eddroid's irb example doesn't seem representative because irb isn't acting the same way as in pure ruby. Here's a minimal example to illustrate:

This segfaults:

bundle exec ruby -r net/http -e 'warn $$; Net::HTTP.new("rubygems.org", 443).tap{|h| h.use_ssl = true; p h.head("/") }'

This doesn't:

bundle exec ruby -r net/http -r openssl -e 'warn $$; Net::HTTP.new("rubygems.org", 443).tap{|h| h.use_ssl = true; p h.head("/") }'

The only difference was the explicit require of openssl.

I added a sleep right before the "head" call so I could run lsof on both. They had the same libs loaded but in a different order.
Segfault order:

COMMAND   PID      USER   FD   TYPE     DEVICE  SIZE/OFF    NODE NAME
ruby    10953 kl  cwd    DIR       14,2       918 2627735 /Users/kl/projects/rails/test_app
ruby    10953 kl  txt    REG       14,2      9248 2336122 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
ruby    10953 kl  txt    REG       14,2   2854432 2336124 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/libruby.1.9.1.dylib
ruby    10953 kl  txt    REG       14,2     13080 2336788 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/enc/encdb.bundle
ruby    10953 kl  txt    REG       14,2     12856 2336830 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/enc/trans/transdb.bundle
ruby    10953 kl  txt    REG       14,2    188392 2336865 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/socket.bundle
ruby    10953 kl  txt    REG       14,2     78640 2336872 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/zlib.bundle
ruby    10953 kl  txt    REG       14,2     40184 2336866 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/stringio.bundle
ruby    10953 kl  txt    REG       14,2     55096 2336857 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/pathname.bundle
ruby    10953 kl  txt    REG       14,2     17808 2336838 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/etc.bundle
ruby    10953 kl  txt    REG       14,2     33272 2336858 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/psych.bundle
ruby    10953 kl  txt    REG       14,2    150784 2326564 /Users/kl/.rvm/usr/lib/libyaml-0.2.dylib
ruby    10953 kl  txt    REG       14,2     30312 2336867 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/strscan.bundle
ruby    10953 kl  txt    REG       14,2    317912 2336772 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/date_core.bundle
ruby    10953 kl  txt    REG       14,2      9640 2336778 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/digest/sha1.bundle
ruby    10953 kl  txt    REG       14,2     24248 2336780 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/digest.bundle
ruby    10953 kl  txt    REG       14,2     10496 2336795 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/enc/iso_8859_1.bundle
ruby    10953 kl  txt    REG       14,2     96280  899966 /opt/local/lib/libz.1.2.5.dylib
ruby    10953 kl  txt    REG       14,2      8776 2336839 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/fcntl.bundle
ruby    10953 kl  txt    REG       14,2    429712 2336856 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/openssl.bundle
ruby    10953 kl  txt    REG       14,2    400536  919064 /opt/local/lib/libssl.1.0.0.dylib
ruby    10953 kl  txt    REG       14,2   1798608  919061 /opt/local/lib/libcrypto.1.0.0.dylib
ruby    10953 kl  txt    REG       14,2   1054960 1073004 /usr/lib/dyld
ruby    10953 kl  txt    REG       14,2 235020288 2448278 /private/var/db/dyld/dyld_shared_cache_x86_64
ruby    10953 kl    0u   CHR       16,2     0t506    1059 /dev/ttys002
ruby    10953 kl    1u   CHR       16,2     0t506    1059 /dev/ttys002
ruby    10953 kl    2u   CHR       16,2     0t506    1059 /dev/ttys002
ruby    10953 kl    3   PIPE 0x08bbbc80     16384         ->0x121bf004
ruby    10953 kl    4   PIPE 0x121bf004     16384         ->0x08bbbc80
ruby    10953 kl    5r   CHR        3,2       0t0     297 /dev/null
ruby    10953 kl    6w   CHR        3,2       0t0     297 /dev/null

Successful order:

COMMAND   PID      USER   FD   TYPE     DEVICE  SIZE/OFF    NODE NAME
ruby    10920 kl  cwd    DIR       14,2       884 2627735 /Users/kl/projects/rails/test_app
ruby    10920 kl  txt    REG       14,2      9248 2336122 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
ruby    10920 kl  txt    REG       14,2   2854432 2336124 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/libruby.1.9.1.dylib
ruby    10920 kl  txt    REG       14,2     13080 2336788 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/enc/encdb.bundle
ruby    10920 kl  txt    REG       14,2     12856 2336830 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/enc/trans/transdb.bundle
ruby    10920 kl  txt    REG       14,2    188392 2336865 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/socket.bundle
ruby    10920 kl  txt    REG       14,2     78640 2336872 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/zlib.bundle
ruby    10920 kl  txt    REG       14,2     40184 2336866 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/stringio.bundle
ruby    10920 kl  txt    REG       14,2     96280  899966 /opt/local/lib/libz.1.2.5.dylib
ruby    10920 kl  txt    REG       14,2     24248 2336780 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/digest.bundle
ruby    10920 kl  txt    REG       14,2    429712 2336856 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/openssl.bundle
ruby    10920 kl  txt    REG       14,2    400536  919064 /opt/local/lib/libssl.1.0.0.dylib
ruby    10920 kl  txt    REG       14,2      8776 2336839 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/fcntl.bundle
ruby    10920 kl  txt    REG       14,2     55096 2336857 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/pathname.bundle
ruby    10920 kl  txt    REG       14,2     17808 2336838 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/etc.bundle
ruby    10920 kl  txt    REG       14,2     33272 2336858 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/psych.bundle
ruby    10920 kl  txt    REG       14,2     30312 2336867 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/strscan.bundle
ruby    10920 kl  txt    REG       14,2      9640 2336778 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/digest/sha1.bundle
ruby    10920 kl  txt    REG       14,2     10496 2336795 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/enc/iso_8859_1.bundle
ruby    10920 kl  txt    REG       14,2   1798608  919061 /opt/local/lib/libcrypto.1.0.0.dylib
ruby    10920 kl  txt    REG       14,2    150784 2326564 /Users/kl/.rvm/usr/lib/libyaml-0.2.dylib
ruby    10920 kl  txt    REG       14,2    317912 2336772 /Users/kl/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin10.8.0/date_core.bundle
ruby    10920 kl  txt    REG       14,2   1054960 1073004 /usr/lib/dyld
ruby    10920 kl  txt    REG       14,2 235020288 2448278 /private/var/db/dyld/dyld_shared_cache_x86_64
ruby    10920 kl    0u   CHR       16,2   0t85128    1059 /dev/ttys002
ruby    10920 kl    1u   CHR       16,2   0t85128    1059 /dev/ttys002
ruby    10920 kl    2u   CHR       16,2   0t85128    1059 /dev/ttys002
ruby    10920 kl    3   PIPE 0x121befa0     16384         ->0x08bbbc1c
ruby    10920 kl    4   PIPE 0x08bbbc1c     16384         ->0x121befa0
ruby    10920 kl    5r   CHR        3,2       0t0     297 /dev/null
ruby    10920 kl    6w   CHR        3,2       0t0     297 /dev/null

Both were run against the macports openssl.
However, there seems to be version discrepancy. Running "/opt/local/bin/openssl version" gives me 1.0.0d, but "port list openssl" gives me 1.0.0e. Not sure if that makes any difference.

I was also able to patch bundler to stop the segfault.
Type "which bundle" (or "rbenv which bundle" on rbenv) to locate the executable. Make sure the file comment contains "This file was generated by RubyGems." Add a require 'openssl' before or after require 'rubygems'.

@eddroid

This comment has been minimized.

Show comment
Hide comment
@eddroid

eddroid Mar 18, 2012

Thanks for the response.

port list openssl is the currently available version

openssl @1.0.0g devel/openssl

port installed openssl is the currently installed version

The following ports are currently installed:
openssl @1.0.0g_0 (active)

In my example, the return result of require 'openssl' changed. In the working example it returns true. In the segfault example it may not. That wasn't clear in my original post because I don't remember if it was returning false or nil. Did you notice that difference?

Are these the current hypotheses?

  • Ruby has a bug where it segfaults if OpenSSL libs are loaded in some particular orders, but not in others
  • Bundler changes the lib load order, so it may trigger the segfault, even when bundler-less Ruby does not, and may get blamed for the Ruby bug
  • Doing something that shuffles the lib load order, like adding a require 'openssl' somewhere or recompiling, helps to prevent the segfault

The disproven hypothesis is that this segfault has something to do with the version of OpenSSL (0.9 vs. 1.0), which is the conclusion of http://bugs.ruby-lang.org/issues/5655. I've demonstrated a working OpenSSL 0.9.8 example and @kliuless and I have both demonstrated broken OpenSSL 1.0.0 examples.

If this is a lib ordering bug and not a version bug, that may explain the tendency of devs to reject this issue once they find a positive test case. They don't realize that all they've done is shuffled lib load order.

eddroid commented Mar 18, 2012

Thanks for the response.

port list openssl is the currently available version

openssl @1.0.0g devel/openssl

port installed openssl is the currently installed version

The following ports are currently installed:
openssl @1.0.0g_0 (active)

In my example, the return result of require 'openssl' changed. In the working example it returns true. In the segfault example it may not. That wasn't clear in my original post because I don't remember if it was returning false or nil. Did you notice that difference?

Are these the current hypotheses?

  • Ruby has a bug where it segfaults if OpenSSL libs are loaded in some particular orders, but not in others
  • Bundler changes the lib load order, so it may trigger the segfault, even when bundler-less Ruby does not, and may get blamed for the Ruby bug
  • Doing something that shuffles the lib load order, like adding a require 'openssl' somewhere or recompiling, helps to prevent the segfault

The disproven hypothesis is that this segfault has something to do with the version of OpenSSL (0.9 vs. 1.0), which is the conclusion of http://bugs.ruby-lang.org/issues/5655. I've demonstrated a working OpenSSL 0.9.8 example and @kliuless and I have both demonstrated broken OpenSSL 1.0.0 examples.

If this is a lib ordering bug and not a version bug, that may explain the tendency of devs to reject this issue once they find a positive test case. They don't realize that all they've done is shuffled lib load order.

@kliuless

This comment has been minimized.

Show comment
Hide comment
@kliuless

kliuless Mar 19, 2012

@eddroid
In irb, both with & without "bundle exec", I get true for both require statements.

Thanks for the note about "port list" vs "port installed". I knew it but I chronically type the wrong command. I do have 1.0.0d installed, so there wasn't any discrepancy.

I wonder whether this issue only afflicts OS X.

As for solutions, it seems like others have also found that loading openssl early will resolve the segfault:
https://github.com/drewblas/aws-ses#readme (says to load it in RUBYOPT, which might be easier than editing the bundle executable)

Related: http://bugs.ruby-lang.org/issues/4373

I have a feeling we won't ever get to the root cause of the issue; which is ok because the workaround isn't too painful.

kliuless commented Mar 19, 2012

@eddroid
In irb, both with & without "bundle exec", I get true for both require statements.

Thanks for the note about "port list" vs "port installed". I knew it but I chronically type the wrong command. I do have 1.0.0d installed, so there wasn't any discrepancy.

I wonder whether this issue only afflicts OS X.

As for solutions, it seems like others have also found that loading openssl early will resolve the segfault:
https://github.com/drewblas/aws-ses#readme (says to load it in RUBYOPT, which might be easier than editing the bundle executable)

Related: http://bugs.ruby-lang.org/issues/4373

I have a feeling we won't ever get to the root cause of the issue; which is ok because the workaround isn't too painful.

@halorgium

This comment has been minimized.

Show comment
Hide comment
@halorgium

halorgium Mar 26, 2012

I spent some time tracking down the root cause.
I got to a small reproducible script which segfaults.
Using the RUBYOPT trick doesn't work as Bundler prepends itself to RUBYOPT.

require "digest/sha1"
require "openssl"
key = OpenSSL::PKey::RSA.new
key.e = 65537

The issue seems to be that my digest/sha1.bundle is built against a different libcrypto.*.dylib than my openssl.bundle.
Is Ruby at fault here?

$ otool -L $HOME/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin11.3.0/openssl.bundle 
$HOME/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin11.3.0/openssl.bundle:
    /opt/local/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /opt/local/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.6)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
$ otool -L $HOME/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin11.3.0/digest/sha1.bundle
$HOME/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin11.3.0/digest/sha1.bundle:
    /usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 44.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)

halorgium commented Mar 26, 2012

I spent some time tracking down the root cause.
I got to a small reproducible script which segfaults.
Using the RUBYOPT trick doesn't work as Bundler prepends itself to RUBYOPT.

require "digest/sha1"
require "openssl"
key = OpenSSL::PKey::RSA.new
key.e = 65537

The issue seems to be that my digest/sha1.bundle is built against a different libcrypto.*.dylib than my openssl.bundle.
Is Ruby at fault here?

$ otool -L $HOME/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin11.3.0/openssl.bundle 
$HOME/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin11.3.0/openssl.bundle:
    /opt/local/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /opt/local/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.6)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
$ otool -L $HOME/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin11.3.0/digest/sha1.bundle
$HOME/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/x86_64-darwin11.3.0/digest/sha1.bundle:
    /usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 44.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
@eddroid

This comment has been minimized.

Show comment
Hide comment
@eddroid

eddroid Mar 26, 2012

@halorgium If you're unable to rebuild Ruby in a way that produces consistent loaded libraries, then there might be a bug in the Ruby compiler. Some parts of the build process may use /opt/local/lib/ and some may ignore it. This thread has some tricks for forcing Ruby to use /usr/lib/ all the time.

eddroid commented Mar 26, 2012

@halorgium If you're unable to rebuild Ruby in a way that produces consistent loaded libraries, then there might be a bug in the Ruby compiler. Some parts of the build process may use /opt/local/lib/ and some may ignore it. This thread has some tricks for forcing Ruby to use /usr/lib/ all the time.

@halorgium

This comment has been minimized.

Show comment
Hide comment
@halorgium

halorgium May 4, 2012

Good news.
It turns out this was fixed recently on MRI trunk, but had not been backported to 1.9.3.
I worked with @evanphx and he made a fix for this.

ruby/ruby@26e258c
http://bugs.ruby-lang.org/issues/6379

halorgium commented May 4, 2012

Good news.
It turns out this was fixed recently on MRI trunk, but had not been backported to 1.9.3.
I worked with @evanphx and he made a fix for this.

ruby/ruby@26e258c
http://bugs.ruby-lang.org/issues/6379

@sanichi

This comment has been minimized.

Show comment
Hide comment
@sanichi

sanichi Jun 23, 2012

This is what fixed a similar problem (with capistrano, not bundler) for me:

CONFIGURE_OPTS=--with-openssl-dir=/opt/local rbenv install 1.9.3-p194

sanichi commented Jun 23, 2012

This is what fixed a similar problem (with capistrano, not bundler) for me:

CONFIGURE_OPTS=--with-openssl-dir=/opt/local rbenv install 1.9.3-p194

@jensb

This comment has been minimized.

Show comment
Hide comment
@jensb

jensb Sep 10, 2012

See also http://apple.stackexchange.com/questions/63478. The fix might be much more trivial, no need to recompile ruby or install a completely different package manager (RVM, rbenv, etc).

jensb commented Sep 10, 2012

See also http://apple.stackexchange.com/questions/63478. The fix might be much more trivial, no need to recompile ruby or install a completely different package manager (RVM, rbenv, etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment