Bug #8203

Rinda: recycled object

Added by Yui NARUSE about 2 years ago. Updated about 2 years ago.

[ruby-dev:47212]
Status:Assigned
Priority:Normal
Assignee:Masatoshi Seki
ruby -v:ruby 2.1.0dev (2013-04-02 trunk 40047) [i686-linux] (ubuntu1004-32) Backport:

Description

test-allで以下のメッセージが出ているんですが、これってなんですか?
http://u32.rubyci.org/~chkbuild/ruby-trunk/log/20130402T010302Z.log.html.gz#test-all

Rinda::TupleSpaceProxyTest#test_take_bug_8215 = /home/chkbuild/build/20130402T010302Z/ruby/lib/drb/drb.rb:369:in _id2ref': 0xda91ca76 is recycled object (RangeError)
from /home/chkbuild/build/20130402T010302Z/ruby/lib/drb/drb.rb:369:in
to_obj'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/drb/drb.rb:1446:in to_obj'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/drb/drb.rb:1748:in
to_obj'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/drb/drb.rb:1025:in _load'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/drb/drb.rb:590:in
load'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/drb/drb.rb:590:in block in load'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/drb/drb.rb:586:in
synchronize'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/drb/drb.rb:586:in load'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/drb/drb.rb:638:in
recv_reply'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/drb/drb.rb:936:in recv_reply'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/drb/drb.rb:1222:in
send_message'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/drb/drb.rb:1110:in block (2 levels) in method_missing'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/drb/drb.rb:1197:in
open'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/drb/drb.rb:1109:in block in method_missing'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/drb/drb.rb:1132:in
with_friend'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/drb/drb.rb:1108:in method_missing'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/rinda/rinda.rb:265:in
write'
from /home/chkbuild/build/20130402T010302Z/ruby/test/rinda/test_rinda.rb:506:in block in test_take_bug_8215'
from /home/chkbuild/build/20130402T010302Z/ruby/test/rinda/test_rinda.rb:502:in
fork'
from /home/chkbuild/build/20130402T010302Z/ruby/test/rinda/test_rinda.rb:502:in test_take_bug_8215'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/test/unit.rb:858:in
run_test'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/minitest/unit.rb:1301:in run'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/test/unit/testcase.rb:17:in
run'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/minitest/unit.rb:919:in block in _run_suite'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/minitest/unit.rb:912:in
map'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/minitest/unit.rb:912:in _run_suite'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/test/unit.rb:657:in
block in run_suites'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/test/unit.rb:655:in each'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/test/unit.rb:655:in
_run_suites'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/minitest/unit.rb:867:in _run_anything'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/minitest/unit.rb:1060:in
run_tests'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/minitest/unit.rb:1047:in block in _run'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/minitest/unit.rb:1046:in
each'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/minitest/unit.rb:1046:in `
run'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/minitest/unit.rb:1035:in run'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/test/unit.rb:21:in
run'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/test/unit.rb:774:in run'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/test/unit.rb:834:in
run'
from /home/chkbuild/build/20130402T010302Z/ruby/lib/test/unit.rb:838:in run'
from ./test/runner.rb:17:in
'
1.42 s = .

History

#1 Updated by Tomoyuki Chikanaga about 2 years ago

おそらくですが、DRb.here? が誤判定していてリモートのオブジェクト(TupleEntry)の参照をカレントプロセス(子プロセス)のオブジェクトと思って object_id から ObjectSpace._id2ref でオブジェクト参照にしようとしてエラーになっているのではないかと。
DRb.here? の誤判定は一度親プロセスで DRb.start_service してから fork しているからかなって気がしますが、再現していないので確認できてないです。main thread の Thread#[] の変数の内容は fork しても引き継がれるようなのでこのせいかなぁ。

#2 Updated by Tomoyuki Chikanaga about 2 years ago

再現しないと書きましたが、実は DRb.here? の誤判定は起きていて id2ref でたまたま同じ object_id のオブジェクトがあったのでエラーにならず、また TupleSpace#write の戻り値を利用していないので問題が起きていないだけみたいでした。
やっぱり DRb.current
server で Thread.current["DRb"]["server"] に親プロセスの DRbServer が入ってしまっているようです。

Also available in: Atom PDF