Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block cannot be cast to class RubyBasicObject #5637

Open
ahorek opened this Issue Feb 28, 2019 · 1 comment

Comments

Projects
None yet
3 participants
@ahorek
Copy link
Contributor

ahorek commented Feb 28, 2019

Environment

jruby 9.2.7.0-SNAPSHOT (2.5.3) 2019-02-28 b1a0d8c Java HotSpot(TM) 64-Bit Server VM 11.0.2+7-LTS on 11.0.2+7-LTS +jit [linux-x86_64]

Expected Behavior

test.rb

require "bundler/inline"

gemfile(true) do
  source "https://rubygems.org"

  gem "mail"
  gem "benchmark-ips"
end
jruby -Xir.inliner.threshold=5 -Xir.inliner=true -Xjit.threshold=0 -S test.rb

the script runs fine without ir options

Actual Behavior

Fetching gem metadata from https://rubygems.org/...
Retrying fetcher due to error (2/4): Java::JavaLang::ClassCastException class org.jruby.runtime.Block cannot be cast to class org.jruby.RubyBasicObject (org.jruby.runtime.Block and org.jruby.RubyBasicObject are in unnamed module of loader 'bootstrap')
.
Retrying fetcher due to error (3/4): Java::JavaLang::ClassCastException class org.jruby.runtime.Block cannot be cast to class org.jruby.RubyBasicObject (org.jruby.runtime.Block and org.jruby.RubyBasicObject are in unnamed module of loader 'bootstrap')
.
Retrying fetcher due to error (4/4): Java::JavaLang::ClassCastException class org.jruby.runtime.Block cannot be cast to class org.jruby.RubyBasicObject (org.jruby.runtime.Block and org.jruby.RubyBasicObject are in unnamed module of loader 'bootstrap')
.
Unhandled Java exception: java.lang.ClassCastException: class org.jruby.runtime.Block cannot be cast to class org.jruby.RubyBasicObject (org.jruby.runtime.Block and org.jruby.RubyBasicObject are in unnamed module of loader 'bootstrap')
java.lang.ClassCastException: class org.jruby.runtime.Block cannot be cast to class org.jruby.RubyBasicObject (org.jruby.runtime.Block and org.jruby.RubyBasicObject are in unnamed module of loader 'bootstrap')
                     getMetaClass at org/jruby/RubyBasicObject.java:525
                             call at org/jruby/runtime/callsite/CachingCallSite.java:166
               invokeOther13:call at home/ahorek/$_dot_rvm/rubies/jruby_minus_head/lib/ruby/gems/shared/gems/bundler_minus_2_dot_0_dot_1/lib/bundler/compact_index_client//home/ahorek/.rvm/rubies/jruby-head/lib/ruby/gems/shared/gems/bundler-2.0.1/lib/bundler/compact_index_client/updater.rb:118
                checksum_for_file at /home/ahorek/.rvm/rubies/jruby-head/lib/ruby/gems/shared/gems/bundler-2.0.1/lib/bundler/compact_index_client/updater.rb:118
                             call at org/jruby/internal/runtime/methods/CompiledIRMethod.java:117
                             call at org/jruby/internal/runtime/methods/MixedModeIRMethod.java:156
                             call at org/jruby/internal/runtime/methods/DynamicMethod.java:200
                             call at org/jruby/runtime/callsite/CachingCallSite.java:170
  invokeOther18:checksum_for_file at home/ahorek/$_dot_rvm/rubies/jruby_minus_head/lib/ruby/gems/shared/gems/bundler_minus_2_dot_0_dot_1/lib/bundler//home/ahorek/.rvm/rubies/jruby-head/lib/ruby/gems/shared/gems/bundler-2.0.1/lib/bundler/compact_index_client.rb:88
                      update_info at /home/ahorek/.rvm/rubies/jruby-head/lib/ruby/gems/shared/gems/bundler-2.0.1/lib/bundler/compact_index_client.rb:88
                             call at org/jruby/internal/runtime/methods/CompiledIRMethod.java:117
                             call at org/jruby/internal/runtime/methods/MixedModeIRMethod.java:156
                             call at org/jruby/internal/runtime/methods/DynamicMethod.java:200
                             call at org/jruby/runtime/callsite/CachingCallSite.java:170
         invokeOther4:update_info at home/ahorek/$_dot_rvm/rubies/jruby_minus_head/lib/ruby/gems/shared/gems/bundler_minus_2_dot_0_dot_1/lib/bundler//home/ahorek/.rvm/rubies/jruby-head/lib/ruby/gems/shared/gems/bundler-2.0.1/lib/bundler/compact_index_client.rb:55
                     dependencies at /home/ahorek/.rvm/rubies/jruby-head/lib/ruby/gems/shared/gems/bundler-2.0.1/lib/bundler/compact_index_client.rb:55
                       callDirect at org/jruby/runtime/CompiledIRBlockBody.java:136
                             call at org/jruby/runtime/IRBlockBody.java:77
                             call at org/jruby/runtime/Block.java:124
                             call at org/jruby/RubyProc.java:295
                             call at org/jruby/RubyProc.java:274
                             call at org/jruby/RubyProc.java:266
                             call at org/jruby/RubyProc$INVOKER$i$0$0$call.gen:-1
                             call at org/jruby/internal/runtime/methods/DynamicMethod.java:204
                             call at org/jruby/internal/runtime/methods/DynamicMethod.java:200
                             call at org/jruby/runtime/callsite/CachingCallSite.java:170
                invokeOther3:call at home/ahorek/$_dot_rvm/rubies/jruby_minus_head/lib/ruby/gems/shared/gems/bundler_minus_2_dot_0_dot_1/lib/bundler/fetcher//home/ahorek/.rvm/rubies/jruby-head/lib/ruby/gems/shared/gems/bundler-2.0.1/lib/bundler/fetcher/compact_index.rb:88
             compact_index_client at /home/ahorek/.rvm/rubies/jruby-head/lib/ruby/gems/shared/gems/bundler-2.0.1/lib/bundler/fetcher/compact_index.rb:88
                       callDirect at org/jruby/runtime/CompiledIRBlockBody.java:136
                             call at org/jruby/runtime/IRBlockBody.java:77
                             call at org/jruby/runtime/Block.java:124
                             call at org/jruby/RubyProc.java:295
                             call at org/jruby/RubyProc.java:274
                             call at org/jruby/RubyProc.java:266
                             call at org/jruby/RubyProc$INVOKER$i$0$0$call.gen:-1
                             call at org/jruby/internal/runtime/methods/DynamicMethod.java:212
                             call at org/jruby/internal/runtime/methods/DynamicMethod.java:208
                             call at org/jruby/runtime/callsite/CachingCallSite.java:201
                invokeOther1:call at home/ahorek/$_dot_rvm/rubies/jruby_minus_head/lib/ruby/gems/shared/gems/bundler_minus_2_dot_0_dot_1/lib/bundler//home/ahorek/.rvm/rubies/jruby-head/lib/ruby/gems/shared/gems/bundler-2.0.1/lib/bundler/worker.rb:64
                       apply_func at /home/ahorek/.rvm/rubies/jruby-head/lib/ruby/gems/shared/gems/bundler-2.0.1/lib/bundler/worker.rb:64
                             call at org/jruby/internal/runtime/methods/CompiledIRMethod.java:130
                             call at org/jruby/internal/runtime/methods/MixedModeIRMethod.java:189
                             call at org/jruby/internal/runtime/methods/DynamicMethod.java:208
                             call at org/jruby/runtime/callsite/CachingCallSite.java:201
          invokeOther4:apply_func at home/ahorek/$_dot_rvm/rubies/jruby_minus_head/lib/ruby/gems/shared/gems/bundler_minus_2_dot_0_dot_1/lib/bundler//home/ahorek/.rvm/rubies/jruby-head/lib/ruby/gems/shared/gems/bundler-2.0.1/lib/bundler/worker.rb:59
                    process_queue at /home/ahorek/.rvm/rubies/jruby-head/lib/ruby/gems/shared/gems/bundler-2.0.1/lib/bundler/worker.rb:59
                      yieldDirect at org/jruby/runtime/CompiledIRBlockBody.java:146
                    yieldSpecific at org/jruby/runtime/IRBlockBody.java:85
                    yieldSpecific at org/jruby/runtime/Block.java:134
                             loop at org/jruby/RubyKernel.java:1425
                             call at org/jruby/RubyKernel$INVOKER$s$0$0$loop.gen:-1
                             call at org/jruby/runtime/callsite/CachingCallSite.java:149
                         callIter at org/jruby/runtime/callsite/CachingCallSite.java:158
                invokeOther7:loop at home/ahorek/$_dot_rvm/rubies/jruby_minus_head/lib/ruby/gems/shared/gems/bundler_minus_2_dot_0_dot_1/lib/bundler//home/ahorek/.rvm/rubies/jruby-head/lib/ruby/gems/shared/gems/bundler-2.0.1/lib/bundler/worker.rb:56
                    process_queue at /home/ahorek/.rvm/rubies/jruby-head/lib/ruby/gems/shared/gems/bundler-2.0.1/lib/bundler/worker.rb:56
                             call at org/jruby/internal/runtime/methods/CompiledIRMethod.java:117
                             call at org/jruby/internal/runtime/methods/MixedModeIRMethod.java:156
                             call at org/jruby/internal/runtime/methods/DynamicMethod.java:200
                             call at org/jruby/runtime/callsite/CachingCallSite.java:170
       invokeOther0:process_queue at home/ahorek/$_dot_rvm/rubies/jruby_minus_head/lib/ruby/gems/shared/gems/bundler_minus_2_dot_0_dot_1/lib/bundler//home/ahorek/.rvm/rubies/jruby-head/lib/ruby/gems/shared/gems/bundler-2.0.1/lib/bundler/worker.rb:90
                   create_threads at /home/ahorek/.rvm/rubies/jruby-head/lib/ruby/gems/shared/gems/bundler-2.0.1/lib/bundler/worker.rb:90
                       callDirect at org/jruby/runtime/CompiledIRBlockBody.java:136
                             call at org/jruby/runtime/IRBlockBody.java:77
                             call at org/jruby/runtime/Block.java:124
                             call at org/jruby/RubyProc.java:295
                             call at org/jruby/RubyProc.java:274
                             call at org/jruby/RubyProc.java:270
                              run at org/jruby/internal/runtime/RubyRunnable.java:105
                              run at java/lang/Thread.java:834

@kares kares added jit ir labels Mar 21, 2019

@enebo

This comment has been minimized.

Copy link
Member

enebo commented Apr 8, 2019

@ahorek sorry I should have commented on this when it was reported. After Railsconf is over I will circle back to these inliner bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.