ruby-concurrency / concurrent-ruby

Modern concurrency tools including agents, futures, promises, thread pools, supervisors, and more. Inspired by Erlang, Clojure, Scala, Go, Java, JavaScript, and classic concurrency patterns.
https://ruby-concurrency.github.io/concurrent-ruby/
Other
5.68k stars 418 forks source link

jruby-9.3.2.0 issue with using + on two Concurrent::Set objects #928

Closed AndyObtiva closed 2 years ago

AndyObtiva commented 2 years ago

I just installed the brand new jruby-9.3.2.0 today and encountered the following issue with Concurrent::Set

irb example:

jruby-9.3.2.0 :006 > require 'concurrent'
 => true 
jruby-9.3.2.0 :007 > Concurrent::Set.new([:a, :b, :c]) + Concurrent::Set.new([:d, :e, :f])
Traceback (most recent call last):
       16: from org.jruby.dist/org.jruby.ext.set.RubySet.initialize_dup(RubySet.java:308)
       15: from org.jruby.dist/org.jruby.runtime.callsite.SuperCallSite.call(SuperCallSite.java:218)
       14: from org.jruby.dist/org.jruby.ext.set.RubySet$INVOKER$i$1$0$initialize_dup.call(RubySet$INVOKER$i$1$0$initialize_dup.gen)
       13: from org.jruby.dist/org.jruby.ext.set.RubySet.initialize_dup(RubySet.java:308)
       12: from org.jruby.dist/org.jruby.runtime.callsite.SuperCallSite.call(SuperCallSite.java:218)
       11: from org.jruby.dist/org.jruby.ext.set.RubySet$INVOKER$i$1$0$initialize_dup.call(RubySet$INVOKER$i$1$0$initialize_dup.gen)
       10: from org.jruby.dist/org.jruby.ext.set.RubySet.initialize_dup(RubySet.java:308)
        9: from org.jruby.dist/org.jruby.runtime.callsite.SuperCallSite.call(SuperCallSite.java:218)
        8: from org.jruby.dist/org.jruby.ext.set.RubySet$INVOKER$i$1$0$initialize_dup.call(RubySet$INVOKER$i$1$0$initialize_dup.gen)
        7: from org.jruby.dist/org.jruby.ext.set.RubySet.initialize_dup(RubySet.java:308)
        6: from org.jruby.dist/org.jruby.runtime.callsite.SuperCallSite.call(SuperCallSite.java:218)
        5: from org.jruby.dist/org.jruby.ext.set.RubySet$INVOKER$i$1$0$initialize_dup.call(RubySet$INVOKER$i$1$0$initialize_dup.gen)
        4: from org.jruby.dist/org.jruby.ext.set.RubySet.initialize_dup(RubySet.java:308)
        3: from org.jruby.dist/org.jruby.runtime.callsite.SuperCallSite.call(SuperCallSite.java:218)
        2: from org.jruby.dist/org.jruby.ext.set.RubySet$INVOKER$i$1$0$initialize_dup.call(RubySet$INVOKER$i$1$0$initialize_dup.gen)
        1: from org.jruby.dist/org.jruby.ext.set.RubySet.initialize_dup(RubySet.java:307)
Java::JavaLang::StackOverflowError ()

It works fine with jruby-9.3.1.0:

jruby-9.3.1.0 :001 > require 'concurrent'
 => true 
jruby-9.3.1.0 :002 > Concurrent::Set.new([:a, :b, :c]) + Concurrent::Set.new([:d, :e, :f])
 => #<Concurrent::Set: {:a, :b, :c, :d, :e, :f}> 

Help is appreciated.

AndyObtiva commented 2 years ago

Just noting that @headius confirmed and fixed in https://github.com/jruby/jruby/pull/6959

I will close this issue once jruby-9.3.3.0 is released.

AndyObtiva commented 2 years ago

I tested and confirmed that this issue got fixed in the newly released JRuby 9.3.3.0.

I am closing this issue as a result.

Thanks to the JRuby team.