New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #30275 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

ruby: ruby gem installation causes segfaults

Reported by: dj_mook@… Owned by: kimuraw@…
Priority: Normal Milestone:
Component: ports Version: 2.0.99
Keywords: lion haspatch Cc: snc@…
Port: ruby

Description

If you install the ruby macport on lion and then install rubygems from source, any attempt to install a gem results in a segfault.

sudo gem install sinatra
ruby-1.8.7-p352/lib/ruby/1.8/timeout.rb:60: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin11.0.0]

According to http://www.frymanet.com/2011/07/rvm-ruby-1-8-7-and-osx-lion/ ruby does not work well with the default llvm compiler in lion.

Using the solution from the article I patched the Portfile to set CC=/usr/bin/gcc-4.2 as a configure argument.

After rebuilding ruby with the new portfile and then installing rubygems from source, I can now install gems without problem.

Macports version 2.0 rc1.

Attachments

Portfile.ruby.patch (495 bytes) - added by dj_mook@… 3 years ago.
ruby-snc.diff (511 bytes) - added by snc@… 3 years ago.
change configure.compiler to gcc-4.2 when defaulted to llvm-gcc-4.2 or clang

Change History

Changed 3 years ago by dj_mook@…

comment:1 Changed 3 years ago by macsforever2000@…

  • Keywords haspatch added
  • Owner changed from macports-tickets@… to kimuraw@…

comment:2 Changed 3 years ago by jmr@…

Does it work with clang? It's probably better to use it if it does.

comment:3 Changed 3 years ago by snc@…

  • Cc snc@… added

I'm seeing this problem in snow leopard with llvm-gcc as well.

comment:4 Changed 3 years ago by snc@…

Using the configure.compiler clang macro suffices: ./configure correctly switches to clang.

comment:5 Changed 3 years ago by snc@…

Clang continues to result in segfaults.

comment:6 Changed 3 years ago by snc@…

This port builds successfully with configure.compilter gcc-4.2.

Should we test for the OS version to decide between gcc-4.2 and gcc-4.0? or just detect llvm/clang and switch it back if set?

comment:7 Changed 3 years ago by snc@…

Behold the hierarchy for picking default compilers.

Changed 3 years ago by snc@…

change configure.compiler to gcc-4.2 when defaulted to llvm-gcc-4.2 or clang

comment:8 Changed 3 years ago by snc@…

I've attached a patch to detect default compilers of llvm-gcc-4.2 or clang, and change it to gcc-4.2.

comment:9 Changed 3 years ago by kimuraw@…

  • Status changed from new to closed
  • Resolution set to fixed

this problem was fixed at r81110. thanks!

Note: See TracTickets for help on using tickets.