Labels

administration (2) advocacy (1) arm (1) artist (1) author (1) bash (1) biology (1) birthday (2) book (1) caleb (2) comedy (1) computer (1) configuration (3) convention (1) cooking (1) customer service (1) debugging (1) desktop (1) emotion (1) equality (2) essay (1) exercise (1) family (1) fedora (13) festival (1) food (3) free software (1) ftl (1) gaming (7) gay (2) git (5) gnome (1) google (3) gripes (1) hacking (1) hardware (3) health (1) hiking (1) holiday (2) homosexuality (3) humor (1) kde (1) kernel (2) keyboard (1) kindle (4) laptop (2) linux (23) marriage (1) movie (2) music (3) mutt (1) news (1) online (1) open source (1) opinions (2) packaging (2) perl (1) philosophy (1) phishing (1) phone (2) physics (1) podcasting (3) politics (1) present (1) problem (2) programming (19) rachel (2) rails (1) RIchard Feynman (1) rights (1) rpm (1) ruby (8) rumor (1) school (2) science (4) search (1) seasons (1) security (1) space (1) subversion (3) super heroes (2) systemd (1) technology (1) television (1) test driven development (1) university (2) update (1) upgrade (1) utility (1) video (1) virtual machine manager (1) virtualization (2) weekend (1) work (1) zombies (1)

Monday, June 11, 2012

Ruby: Fix for "timeout.rb:60: [BUG] Segmentation fault"

After upgrading my laptop from Fedora 16 to Fedora 17, I hit a big problem while working in Ruby. Since Fedora changed from Ruby 1.8.7 to Ruby 1.9.3 I've decided to work more with RVM so that I can continue to develop across versions.

Problem

One of the tasks I'm working on requires developing native extensions. So for Ruby 1.8.7 I needed to install the various rake, rake-compiler, rspec and other gems for use under RVM. But when I tried to install them I had this error come up consistently:


mcpierce@mcpierce-laptop:ruby (Different-Runner-model) $ gem install rake
/home/mcpierce/.rvm/rubies/ruby-1.8.7-head/lib/ruby/1.8/timeout.rb:60: [BUG] Segmentation fault
ruby 1.8.7 (2012-06-10 patchlevel 368) [x86_64-linux]

Solution

I needed to reinstall Ruby 1.8.7 under RVM with the following compiler flags:

mcpierce@mcpierce-laptop:ruby (Different-Runner-model) $ CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls" rvm install 1.8.7
Installing Ruby from source to: /home/mcpierce/.rvm/rubies/ruby-1.8.7-p358, this may take a while depending on your cpu(s)...

ruby-1.8.7-p358 - #fetching 
ruby-1.8.7-p358 - #extracting ruby-1.8.7-p358 to /home/mcpierce/.rvm/src/ruby-1.8.7-p358
ruby-1.8.7-p358 - #extracted to /home/mcpierce/.rvm/src/ruby-1.8.7-p358
Applying patch 'stdout-rouge-fix' (located at /home/mcpierce/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch)
Applying patch 'no_sslv2' (located at /home/mcpierce/.rvm/patches/ruby/1.8.7/no_sslv2.diff)
ruby-1.8.7-p358 - #configuring 
ruby-1.8.7-p358 - #compiling 
ruby-1.8.7-p358 - #installing 
Removing old Rubygems files...
Installing rubygems-1.8.24 for ruby-1.8.7-p358 ...
Installation of rubygems completed successfully.
ruby-1.8.7-p358 - adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.8.7-p358 - #importing default gemsets (/home/mcpierce/.rvm/gemsets/)
Install of ruby-1.8.7-p358 - #complete 
Please be aware that you just installed a ruby that requires 2 patches just to be compiled on up to date linux system.
This may have known and unaccounted for security vulnerabilities.
Please consider upgrading to Ruby 1.9.3-125 which will have all of the latest security patches.

Once I did this then install gems installs worked as expected.