Skip to content

Instantly share code, notes, and snippets.

@csanz
Created September 7, 2010 18:14
Show Gist options
  • Save csanz/568765 to your computer and use it in GitHub Desktop.
Save csanz/568765 to your computer and use it in GitHub Desktop.
/opt/local/lib/ruby/1.8/net/http.rb:586: [BUG] Segmentation fault
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10]
Abort trap
@jurisgalang
Copy link

Hey, Did you ever figured out why you were getting this segfault?

@csanz
Copy link
Author

csanz commented Apr 27, 2011

I can't remember... but it fixed it.... sorry, cant' remember

@jurisgalang
Copy link

no worries. i think i'm just going to reinstall rvm and rubies...

@popdevelop
Copy link

Just got a similar problem with openssl and http.rb, anyone figured out how to solve this?

@jurisgalang
Copy link

Here's the post-mortem I sent out after I resolved the issue:

I tracked this down further into an issue with the MacPorts version of
openssl; @1.0.0d; I was using rvm + ruby 1.8.7p174 compiled
with the openssl

It turns out there were two versions/flavors installed - the stock openssl
for OS X, and the one that got installed by MacPorts as a dependency from
another MacPorts package (eg: curl)

From what I could tell, even though I've compiled ruby to be configured
with a specific openssl package (eg: MacPorts or the one that's provided
as a package via rvm, see:
http://beginrescueend.com/packages/openssl/, when the code in rubycas-client
executes, it ends up using another (possibly incompatible version that was
installed on the system) -
this is probably true for any gem that requires openssl running within
Rails.

Uninstalling MacPorts completely and re-installing ruby fixed the issue.
This time around ruby was compiled using the openssl package from rvm:

rvm package install openssl
rvm install 1.8.7-p174 --with-openssl-dir=$HOME/.rvm/usr 

The package that comes from rvm has a newer version (0.9.8n) of the
library than the one that comes with OS X ( vs 0.9.8l) - these two
appear to be compatible with each other.

Reinstalling ruby configured with openssl the comes with OS X alone also
works.

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