From: wanabe <s.wanabe@...> Date: 2009-10-15T06:34:21+09:00 Subject: [ruby-dev:39484] Re: [BUG: trunk] GC mark bug ワナベと申します。 redmine でうまくコメントできなかったようなのでメール致しします。 もし二重に送られたら申し訳ありません。 2009年10月10日22:59 SASADA Koichi <ko1@atdot.net>: > 以下のように,GC.stress = true として fileutils を require すると SEGV > します.多分,mark ミスなんじゃないかと思います.よくわからないので,と > りあえず登録しておきます. eval された ISeq が破棄されるとき、現在の iseq_free では 子 ISeq のマーク状態に関わらず先頭の iseq->iseq からすべて 破棄しているからではないでしょうか。 以下のように、親 ISeq がマークされる場合は落ちませんでした。 $ cat test.rb GC.stress = true a = [] ("A".."Z").each do |mod| print mod ("a".."k").each do |meth| iseq = RubyVM::InstructionSequence.compile(<<-EOS) module #{mod} def #{meth} end end EOS a.push iseq if ARGV[0] iseq.eval end o = Object.new o.extend(Kernel.const_get(mod)) ("a".."k").each do |meth| o.send(meth) end end $ ./ruby -v test.rb 1 ruby 1.9.2dev (2009-10-14 trunk 25335) [i386-mingw32] ABCDEFGHIJKLMNOPQRSTUVWXYZ $ ./ruby test.rb ABCDEFGtest.rb:19: [BUG] Segmentation fault ruby 1.9.2dev (2009-10-14 trunk 25335) [i386-mingw32] -- control frame ---------- c:td p:td s:td b:td l:tx d:td BLOCK test.rb:19 c:td p:---- s:td b:td l:td d:td FINISH c:td p:---- s:td b:td l:td d:td IFUNC :respond_to_missing? c:td p:---- s:td b:td l:td d:td CFUNC :upto c:td p:---- s:td b:td l:td d:td CFUNC :each c:td p:td s:td b:td l:tx d:td BLOCK test.rb:18 c:td p:---- s:td b:td l:td d:td FINISH c:td p:---- s:td b:td l:td d:td IFUNC :== c:td p:---- s:td b:td l:td d:td CFUNC :upto c:td p:---- s:td b:td l:td d:td CFUNC :each c:td p:td s:td b:td l:tx d:tx EVAL test.rb:4 c:td p:---- s:td b:td l:td d:td FINISH c:td p:td s:td b:td l:tx d:tx TOP --------------------------- test.rb:4:in `<main>' test.rb:4:in `each' test.rb:4:in `upto' test.rb:18:in `block in <main>' test.rb:18:in `each' test.rb:18:in `upto' test.rb:19:in `block (2 levels) in <main>' [NOTE] You may have encountered a bug in the Ruby interpreter or extension libraries. Bug reports are welcome. For details: http://www.ruby-lang.org/bugreport.html This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. -- ワナベ