Bug #8203

Rinda: recycled object

Added by Yui NARUSE about 1 year ago. Updated about 1 year ago.

[ruby-dev:47212]
Status:Assigned
Priority:Normal
Assignee:Masatoshi Seki
Category:lib
Target version:-
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#testtakebug8215 = /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
toobj'
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
sendmessage'
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/testrinda.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
runtest'
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
runsuites'
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 1 year ago

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

#2 Updated by Tomoyuki Chikanaga about 1 year ago

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

Also available in: Atom PDF