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

profiler crashes with java.lang.RuntimeException: BUG: refined marker called as method #6038

Closed
ilikeorangutans opened this issue Jan 14, 2020 · 1 comment

Comments

@ilikeorangutans
Copy link
Contributor

@ilikeorangutans ilikeorangutans commented Jan 14, 2020

Environment

Provide at least:

  • JRuby version: 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]
  • Operating system and platform 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:

  • Installed or activated gems: graphql
  • Enabled profiler via profile

Expected Behavior

Not crash.

Actual Behavior

Jruby crashes when loading the graphql gem which uses Refinements.

Full stack trace, excerpt:

java.lang.RuntimeException: BUG: refined marker called as method
        at org.jruby.internal.runtime.methods.RefinedWrapper.call(RefinedWrapper.java:68)
        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:196)
        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)
        at org.jruby.internal.runtime.methods.ProfilingDynamicMethod.call(ProfilingDynamicMethod.java:54)
        at org.jruby.runtime.callsite.RefinedCachingCallSite.call(RefinedCachingCallSite.java:59)
        at Users.jakob.$_dot_gem.jruby.$2_dot_5_dot_7.gems.graphql_minus_1_dot_9_dot_13.lib.graphql.schema.field.invokeOther16:-@(/Users/jakob/.gem/jruby/2.5.7/gems/graphql-1.9.13/lib/graphql/schema/field.rb:177)
        at Users.jakob.$_dot_gem.jruby.$2_dot_5_dot_7.gems.graphql_minus_1_dot_9_dot_13.lib.graphql.schema.field.RUBY$method$initialize$0(/Users/jakob/.gem/jruby/2.5.7/gems/graphql-1.9.13/lib/graphql/schema/field.rb:177)
        at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:84)
        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:70)

Reproduce

jruby --profile -e 'module X; refine(String) { def blah; end }; end; using X; "foo".blah'
@headius
Copy link
Member

@headius headius commented Jan 14, 2020

Reproduction is actually a bit simpler; calling the refined name from anywhere is enough to trigger it. Here I use to_s so I don't have to using the refinement, and I'll do the same in an upcoming spec:

jruby --profile -e 'module X; refine(String) { def to_s; super; end }; end; "foo".to_s'

headius added a commit that referenced this issue Jan 14, 2020
@headius headius added this to the JRuby 9.2.10.0 milestone Jan 14, 2020
yaauie added a commit to yaauie/logstash-mixin-ecs_compatibility_support that referenced this issue Apr 28, 2021
includes updated jruby to avoid bug that was frequently encountered
in CI: jruby/jruby#6038
yaauie added a commit to yaauie/logstash-mixin-ecs_compatibility_support that referenced this issue Apr 30, 2021
includes updated jruby to avoid bug that was frequently encountered
in CI: jruby/jruby#6038
yaauie added a commit to logstash-plugins/logstash-mixin-ecs_compatibility_support that referenced this issue May 4, 2021
* 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
chadlwilson added a commit to chadlwilson/gocd that referenced this issue Nov 1, 2021
….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.
chadlwilson added a commit to chadlwilson/gocd that referenced this issue Nov 1, 2021
….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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants