From: nobu@... Date: 2014-06-04T06:35:05+00:00 Subject: [ruby-dev:48274] [ruby-trunk - Bug #9109] extend したモジュールメソッドと RSpec の let で 2 つ同名を使ったときに segmentation fault になる Issue #9109 has been updated by Nobuyoshi Nakada. Duplicated by Bug #9900: Segmentation fault with recursive reference of a hash added ---------------------------------------- Bug #9109: extend したモジュールメソッドと RSpec の let で 2 つ同名を使ったときに segmentation fault になる https://bugs.ruby-lang.org/issues/9109#change-47034 * Author: sunao tanabe * Status: Assigned * Priority: Low * Assignee: Nobuyoshi Nakada * Category: * Target version: * ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin11.4.2] * Backport: 1.9.3: REQUIRED, 2.0.0: REQUIRED ---------------------------------------- =begin 以下のコードで segmentation fault を起こします。 require 'rspec' module ExtendModule def foo 'foo' end def bar 'bar' end end describe 'foo' do extend ExtendModule let(:foo) { foo } let(:bar) { bar } it { foo.should be 'foo' } it { bar.should be 'bar' } end 実行結果 $ bundle exec rspec FSegmentation fault: 11 RSpec version 2.14.7 (現時点の最新安定板) 期待する挙動 segmentation fault せず SystemStackError となる (同名が 1 つの場合の挙動から推測) =end -- https://bugs.ruby-lang.org/