From: knu@... Date: 2017-07-14T08:21:19+00:00 Subject: [ruby-core:82053] [Ruby trunk Bug#13735][Assigned] Initialization-error of sortedset Issue #13735 has been updated by knu (Akinori MUSHA). Status changed from Open to Assigned Assignee set to knu (Akinori MUSHA) ---------------------------------------- Bug #13735: Initialization-error of sortedset https://bugs.ruby-lang.org/issues/13735#change-65781 * Author: junjihashimoto (Junji Hashimoto) * Status: Assigned * Priority: Normal * Assignee: knu (Akinori MUSHA) * Target version: * ruby -v: ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]ca * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- When we use multithreading environment, sortedset-initialization always fails. Reproducible programs and the logs are below. ~~~ ruby $ cat sortedset-test.rb require "set" def func1 set = SortedSet.new([2, 1, 5, 6, 4, 5, 3, 3, 3]) ary = [] set.each do |obj| ary << obj p ary end end def func2 set = SortedSet.new([2, 1, 5, 6, 4, 5, 3, 3, 3]) ary = [] set.each do |obj| ary << obj p ary end end puts "Started At #{Time.now}" t1 = Thread.new{func1()} t2 = Thread.new{func2()} t1.join t2.join puts "End at #{Time.now}" ~~~ ~~~ text $ ruby sortedset-test.rb Started At 2017-07-10 10:08:14 +0900 [1] [1, 2] [1, 2, 3] [1, 2, 3, 4] [1, 2, 3, 4, 5] [1, 2, 3, 4, 5, 6] /home/hogeuser/.rbenv/versions/2.4.1/lib/ruby/2.4.0/set.rb:711:in `remove_method': method `old_init' not defined in SortedSet (NameError) from /home/hogeuser/.rbenv/versions/2.4.1/lib/ruby/2.4.0/set.rb:711:in `block in setup' from /home/hogeuser/.rbenv/versions/2.4.1/lib/ruby/2.4.0/set.rb:709:in `module_eval' from /home/hogeuser/.rbenv/versions/2.4.1/lib/ruby/2.4.0/set.rb:709:in `setup' from /home/hogeuser/.rbenv/versions/2.4.1/lib/ruby/2.4.0/set.rb:719:in `initialize' from sortedset-test.rb:15:in `new' from sortedset-test.rb:15:in `func2' from sortedset-test.rb:26:in `block in
' ~~~ Following tickets may have a same problem. https://github.com/jubos/fake-s3/pull/55 https://github.com/synthetichealth/synthea/issues/156 Following link has initialization error of sortedset, too. But it does not use multithreading. https://stackoverflow.com/questions/41815930/ruby-marshal-load-doesnt-keep-order-of-sorted-set -- https://bugs.ruby-lang.org/ Unsubscribe: