In article <200409140459.i8E4xUI1015616 / sharui.nakada.niregi.kanuma.tochigi.jp>,
  nobu / ruby-lang.org writes:

> yieldした結果にしたがって書き換えるのは、reject!もありますね。
>
>
> * array.c (rb_ary_collect_bang, rb_ary_reject_bang): end if shortened.
>   [ruby-dev:24261]
>
> * array.c (rb_ary_equal, rb_ary_eql, rb_ary_cmp): get rid of
>   overrunning peer array.  [ruby-dev:24254]

これらのうち、collect!, reject!, eql? は今のところ直っていないようです。

% ./ruby -e 'a = (1..100000).to_a
a.collect! {|v| if v == 5000 then a.clear; a.compact!; end; v + 1 }
'                     
-e:2: [BUG] Segmentation fault
ruby 1.8.2 (2004-09-17) [i686-linux]

zsh: abort      ./ruby -e 
% ./ruby -e 'a = (1..100000).to_a
a.reject! {|v| if v == 50000 then a.clear; a.compact!; end; v % 2 == 0 }
p a
'
-e:3: [BUG] Segmentation fault
ruby 1.8.2 (2004-09-17) [i686-linux]

zsh: abort      ./ruby -e 
% ./ruby -e '
len = 100000
$arr1 = Array.new(len)
$arr2 = Array.new(len)
o = Object.new
def o.eql?(o2)
  $arr2.compact!
  true
end
$arr1[100] = o
p $arr1.eql?($arr2)
'
-e:11: [BUG] Segmentation fault
ruby 1.8.2 (2004-09-17) [i686-linux]

zsh: abort      ./ruby -e 
-- 
[田中 哲][たなか あきら][Tanaka Akira]