From: Yukihiro Matsumoto Date: 2009-10-30T08:09:02+09:00 Subject: [ruby-core:26420] Re: [Bug #1901] Segfault for Enumerable#count When Aliased to #size Hi, In message "Re: [ruby-core:24794] [Bug #1901] Segfault for Enumerable#count When Aliased to #size" on Thu, 6 Aug 2009 23:24:18 +0900, Run Paint Run Run writes: | class E | include Enumerable | alias :size :count | def each | yield 1 | end | end | | p E.new.count | | $ ruby -v /tmp/enum-size.rb | ruby 1.9.2dev (2009-08-05 trunk 24397) [i686-linux] | Segmentation fault | |1.8.7 gives a SystemStackError. It would be nice if #count recognized #size was an alias and didn't try to invoke it. I fixed this by r25560, but I still consider the fix is implementation dependent, so that some implementation might (and can) cause infinite recursion. matz.