-
-
Notifications
You must be signed in to change notification settings - Fork 921
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
profiler crashes with java.lang.RuntimeException: BUG: refined marker called as method
#6038
Comments
Reproduction is actually a bit simpler; calling the refined name from anywhere is enough to trigger it. Here I use
|
includes updated jruby to avoid bug that was frequently encountered in CI: jruby/jruby#6038
includes updated jruby to avoid bug that was frequently encountered in CI: jruby/jruby#6038
* ci: bump to last 7.x logstash before core ecs support was added includes updated jruby to avoid bug that was frequently encountered in CI: jruby/jruby#6038 * add support for aliases in version-constrained implementations
….14.0 and ruby-i18n >= 1.8.8 Not sure if this should stay. There is a secondary problem with JRuby `9.2.9.0` with use of refinements in certain modes noted at jruby/jruby#6038 This was causing `admin/configuration` tests to fail when using `time_ago_in_words` and then crashing with a nonsensical error rather than the root cause error from the JRuby/i18n problem. This appears to be fixed in JRuby `9.2.10.0` however this version of JRuby involves RubyGems 3 which has some scripting issues on Windows currently. Groan. Believe refinements in this way shouldn't really be used anywhere we are relying on based on a global search.
….14.0 and ruby-i18n >= 1.8.8 Not sure if this should stay. There is a secondary problem with JRuby `9.2.9.0` with use of refinements in certain modes noted at jruby/jruby#6038 This was causing `admin/configuration` tests to fail when using `time_ago_in_words` and then crashing with a nonsensical error rather than the root cause error from the JRuby/i18n problem. This appears to be fixed in JRuby `9.2.10.0` however this version of JRuby involves RubyGems 3 which has some scripting issues on Windows currently. Groan. Believe refinements in this way shouldn't really be used anywhere we are relying on based on a global search.
Not sure if using a closed issue is considered a good practice, but I'm commenting it here as the problem seems similar. Setting `JRUBY_OPTS="--profile.api", and running the spec files throws the following error. This is the refinement in activesupport-7.0.8/lib/active_support/core_ext/enumerable.rb using Module.new {
refine Array do
alias :orig_sum :sum
end
} This is the relevant backtrace,
|
@rajaravivarma-r More information is never wrong, it just might be the wrong place 😀 Your trace appears to have cut off the actual error message, so it's hard for me to tell if it's the same issue or not. If the error message is the same, please add it to your trace. If it is different, I think you should open a new bug. |
@headius Apologies for not posting the actual error message. I'll make a minimal reproducible example and post it here. |
@headius Here is the error with full backtrace of the spec.
The expectation that triggered the error,
async_job.rb class AsyncJob < ApplicationRecord
belongs_to :item
end async_job_spec.rb require 'rails_helper'
RSpec.describe AsyncJob, type: :model do
describe 'associations' do
it { should belong_to(:item) }
end
end
end Please let me know if you need more details. Please feel free to ignore my attempt at producing a minimal example with the following code - it just works fine. minimal_example.rb using Module.new {
refine Array do
alias :orig_sum :sum
end
}
class Array # :nodoc:
def sum(init = nil, &block)
if init.is_a?(Numeric) || first.is_a?(Numeric)
init ||= 0
orig_sum(init, &block)
else
super
end
end
end
def main
a = [1, 2, 3, 4, 5]
puts a.sum
puts a.orig_sum
end
main |
Are you able to reproduce using your minimal example on JRuby 9.4.7.0? I could not with this simple command line:
|
@headius My message was not clear. I could not reproduce the error using the minimal example. I did more digging and found that it happens only when using Thanks for checking this out. |
Environment
Provide at least:
jruby 9.2.9.0 (2.5.7) 2019-10-30 458ad3e OpenJDK 64-Bit Server VM 25.232-b09 on 1.8.0_232-b09 +jit [darwin-x86_64]
Darwin 19.2.0 Darwin Kernel Version 19.2.0: Sat Nov 9 03:47:04 PST 2019; root:xnu-6153.61.1~20/RELEASE_X86_64 x86_64
Other relevant info you may wish to add:
profile
Expected Behavior
Not crash.
Actual Behavior
Jruby crashes when loading the graphql gem which uses Refinements.
Full stack trace, excerpt:
Reproduce
The text was updated successfully, but these errors were encountered: