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

NPE due to unhandled non-local return #5517

Closed
alaz opened this Issue Dec 13, 2018 · 11 comments

Comments

Projects
None yet
4 participants
@alaz
Copy link

alaz commented Dec 13, 2018

Environment

  • JRuby: jruby 9.2.5.0 (2.5.0) 2018-12-06 6d5a228 OpenJDK 64-Bit Server VM 25.181-b13 on 1.8.0_181-b13 +jit [linux-x86_64]
  • OS: Linux rails.r4 3.16.0-5-amd64 #1 SMP Debian 3.16.51-3+deb8u1 (2018-01-08) x86_64 Linux
  • Environment variables:
JRUBY_VERSION=9.2.5.0
JAVA_ALPINE_VERSION=8.181.13-r0
JAVA_OPTS=-Xms1G -Xmx1G -XX:ReservedCodeCacheSize=128M -XX:+UseCodeCacheFlushing -Duser.timezone=GMT -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/logs -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dorg.apache.camel.jmx.serviceUrlPath="/jmxrmi" -Dcom.sun.management.jmxremote.port=9073
JRUBY_OPTS=--server  -Xjit.threshold=5 -Xjit.max=16384

Exception:

Click to expand
Java::JavaLang::NullPointerException ():

org.jruby.ir.runtime.IRRuntimeHelpers.checkForLJE(IRRuntimeHelpers.java:125)
org.jruby.ir.instructions.CheckForLJEInstr.check(CheckForLJEInstr.java:69)
org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:171)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:104)
org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:128)
org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:151)
org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:194)
org.jruby.runtime.BlockBody.yield(BlockBody.java:125)
org.jruby.runtime.Block.yieldArray(Block.java:177)
org.jruby.RubyBasicObject.yieldUnder(RubyBasicObject.java:1762)
org.jruby.RubyBasicObject.instance_exec(RubyBasicObject.java:2666)
org.jruby.RubyBasicObject$INVOKER$i$0$3$instance_exec.call(RubyBasicObject$INVOKER$i$0$3$instance_exec.gen)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:303)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:84)
org.jruby.ir.instructions.CallBase.interpret(CallBase.java:547)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:128)
org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:151)
org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:79)
org.jruby.runtime.Block.call(Block.java:124)
org.jruby.RubyProc.call(RubyProc.java:286)
org.jruby.RubyProc.call(RubyProc.java:266)
org.jruby.RubyProc$INVOKER$i$0$0$call.call(RubyProc$INVOKER$i$0$0$call.gen)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:203)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:199)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:346)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:172)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:317)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:92)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:204)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:191)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:207)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:367)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:203)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:326)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:171)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:158)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:199)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:346)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:172)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_controller.metal.rescue.invokeOther7:rescue_with_handler(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_controller/metal/rescue.rb:25)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_controller.metal.rescue.RUBY$method$process_action$0(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_controller/metal/rescue.rb:25)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:91)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:90)
org.jruby.ir.runtime.IRRuntimeHelpers.unresolvedSuper(IRRuntimeHelpers.java:1151)
org.jruby.ir.runtime.IRRuntimeHelpers.zSuperSplatArgs(IRRuntimeHelpers.java:1159)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_controller.metal.instrumentation.invokeSuper3:-unknown-super-target-(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_controller/metal/instrumentation.rb:38)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_controller.metal.instrumentation.RUBY$block$process_action$1(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_controller/metal/instrumentation.rb:38)
org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:146)
org.jruby.runtime.BlockBody.yield(BlockBody.java:114)
org.jruby.runtime.Block.yield(Block.java:165)
org.jruby.ir.runtime.IRRuntimeHelpers.yield(IRRuntimeHelpers.java:464)
org.jruby.ir.targets.YieldSite.yield(YieldSite.java:105)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.activesupport_minus_5_dot_2_dot_1.lib.active_support.notifications.RUBY$block$instrument$1(vendor/bundle/jruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/notifications.rb:168)
org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:146)
org.jruby.runtime.BlockBody.yield(BlockBody.java:114)
org.jruby.runtime.Block.yield(Block.java:165)
org.jruby.ir.runtime.IRRuntimeHelpers.yield(IRRuntimeHelpers.java:464)
org.jruby.ir.targets.YieldSite.yield(YieldSite.java:105)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.activesupport_minus_5_dot_2_dot_1.lib.active_support.notifications.instrumenter.RUBY$method$instrument$0(vendor/bundle/jruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/notifications/instrumenter.rb:23)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:91)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:127)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:189)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:211)
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:220)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.activesupport_minus_5_dot_2_dot_1.lib.active_support.notif
ications.invokeOther5:instrument(vendor/bundle/jruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/notifications.rb:168)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.activesupport_minus_5_dot_2_dot_1.lib.active_support.notifications.RUBY$method$instrument$0(vendor/bundle/jruby/2.5.0/gems/activesupport-5.2.1/lib/active_support/notifications.rb:168)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:91)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:127)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:189)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:211)
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:220)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_controller.metal.instrumentation.invokeOther43:instrument(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_controller/metal/instrumentation.rb:32)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_controller.metal.instrumentation.RUBY$method$process_action$0(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_controller/metal/instrumentation.rb:32)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:91)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:90)
org.jruby.ir.runtime.IRRuntimeHelpers.unresolvedSuper(IRRuntimeHelpers.java:1151)
org.jruby.ir.runtime.IRRuntimeHelpers.unresolvedSuperSplatArgs(IRRuntimeHelpers.java:1133)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_controller.metal.params_wrapper.invokeSuper20:-unknown-super-target-(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_controller/metal/params_wrapper.rb:256)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_controller.metal.params_wrapper.RUBY$method$process_action$0(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_controller/metal/params_wrapper.rb:256)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:91)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:90)
org.jruby.ir.runtime.IRRuntimeHelpers.unresolvedSuper(IRRuntimeHelpers.java:1151)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.activerecord_minus_5_dot_2_dot_1.lib.active_record.railties.controller_runtime.invokeSuper1:-unknown-super-target-(vendor/bundle/jruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/railties/controller_runtime.rb:24)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.activerecord_minus_5_dot_2_dot_1.lib.active_record.railties.controller_runtime.RUBY$method$process_action$0(vendor/bundle/jruby/2.5.0/gems/activerecord-5.2.1/lib/active_record/railties/controller_runtime.rb:24)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:91)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:90)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:173)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:314)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:74)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.abstract_controller.base.invokeOther11:process_action(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/abstract_controller/base.rb:134)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.abstract_controller.base.RUBY$method$process$0(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/abstract_controller/base.rb:134)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:91)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:90)
org.jruby.ir.runtime.IRRuntimeHelpers.unresolvedSuper(IRRuntimeHelpers.java:1151)
org.jruby.ir.runtime.IRRuntimeHelpers.unresolvedSuperSplatArgs(IRRuntimeHelpers.java:1133)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionview_minus_5_dot_2_dot_1.lib.action_view.rendering.invokeSuper5:-unknown-super-target-(vendor/bundle/jruby/2.5.0/gems/actionview-5.2.1/lib/action_view/rendering.rb:32)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionview_minus_5_dot_2_dot_1.lib.action_view.rendering.RUBY$method$process$0(vendor/bundle/jruby/2.5.0/gems/actionview-5.2.1/lib/action_view/rendering.rb:32)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:91)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:114)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:156)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:199)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:346)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:172)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_controller.metal.invokeOther2:process(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_controller/metal.rb:191)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_controller.metal.RUBY$method$dispatch$0(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_controller/metal.rb:191)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:143)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:221)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:215)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:390)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:234)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_controller.metal.invokeOther10:dispatch(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_controller/metal.rb:252)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_controller.metal.RUBY$method$dispatch$0(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_controller/metal.rb:252)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:143)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:221)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:215)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:390)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:234)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_dispatch.routing.route_set.invokeOther0:dispatch(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:52)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_dispatch.routing.route_set.RUBY$method$dispatch$0(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:52)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_dispatch.routing.route_set.RUBY$method$dispatch$0$__VARARGS__(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:91)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:90)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:173)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:72)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_dispatch.routing.route_set.invokeOther6:dispatch(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:34)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_dispatch.routing.route_set.RUBY$method$serve$0(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:34)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:117)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:156)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:199)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_dispatch.journey.router.invokeOther27:serve(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_dispatch/journey/router.rb:52)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_dispatch.journey.router.RUBY$block$serve$1(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_dispatch/journey/router.rb:52)
org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:146)
org.jruby.runtime.BlockBody.yield(BlockBody.java:114)
org.jruby.runtime.Block.yield(Block.java:165)
org.jruby.RubyArray.each(RubyArray.java:1792)
org.jruby.RubyArray$INVOKER$i$0$0$each.call(RubyArray$INVOKER$i$0$0$each.gen)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:149)
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:158)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_dispatch.journey.router.invokeOther37:each(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_dispatch/journey/router.rb:35)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_dispatch.journey
.router.RUBY$method$serve$0(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_dispatch/journey/router
.rb:35)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:117)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:156)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:199)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_dispatch.routing.route_set.invokeOther5:serve(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:840)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_dispatch.routing.route_set.RUBY$method$call$0(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_dispatch/routing/route_set.rb:840)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:117)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:156)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:199)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.rack_minus_attack_minus_5_dot_4_dot_2.lib.rack.attack.invokeOther18:call(vendor/bundle/jruby/2.5.0/gems/rack-attack-5.4.2/lib/rack/attack.rb:182)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.rack_minus_attack_minus_5_dot_4_dot_2.lib.rack.attack.RUBY$method$call$0(vendor/bundle/jruby/2.5.0/gems/rack-attack-5.4.2/lib/rack/attack.rb:182)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:117)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:156)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:199)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.i18n_minus_js_minus_3_dot_2_dot_0.lib.i18n.js.middleware.invokeOther3:call(vendor/bundle/jruby/2.5.0/gems/i18n-js-3.2.0/lib/i18n/js/middleware.rb:14)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.i18n_minus_js_minus_3_dot_2_dot_0.lib.i18n.js.middleware.RUBY$method$call$0(vendor/bundle/jruby/2.5.0/gems/i18n-js-3.2.0/lib/i18n/js/middleware.rb:14)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:117)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:156)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:199)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.rack_minus_2_dot_0_dot_6.lib.rack.tempfile_reaper.invokeOther8:call(vendor/bundle/jruby/2.5.0/gems/rack-2.0.6/lib/rack/tempfile_reaper.rb:15)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.rack_minus_2_dot_0_dot_6.lib.rack.tempfile_reaper.RUBY$method$call$0(vendor/bundle/jruby/2.5.0/gems/rack-2.0.6/lib/rack/tempfile_reaper.rb:15)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:117)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:156)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:199)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.rack_minus_2_dot_0_dot_6.lib.rack.etag.invokeOther5:call(vendor/bundle/jruby/2.5.0/gems/rack-2.0.6/lib/rack/etag.rb:25)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.rack_minus_2_dot_0_dot_6.lib.rack.etag.RUBY$method$call$0(vendor/bundle/jruby/2.5.0/gems/rack-2.0.6/lib/rack/etag.rb:25)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:117)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:156)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:199)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.rack_minus_2_dot_0_dot_6.lib.rack.conditional_get.invokeOther14:call(vendor/bundle/jruby/2.5.0/gems/rack-2.0.6/lib/rack/conditional_get.rb:38)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.rack_minus_2_dot_0_dot_6.lib.rack.conditional_get.RUBY$method$call$0(vendor/bundle/jruby/2.5.0/gems/rack-2.0.6/lib/rack/conditional_get.rb:38)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:117)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:156)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:199)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.rack_minus_2_dot_0_dot_6.lib.rack.head.invokeOther5:call(vendor/bundle/jruby/2.5.0/gems/rack-2.0.6/lib/rack/head.rb:12)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.rack_minus_2_dot_0_dot_6.lib.rack.head.RUBY$method$call$0(vendor/bundle/jruby/2.5.0/gems/rack-2.0.6/lib/rack/head.rb:12)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:117)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:156)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:199)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_dispatch.http.content_security_policy.invokeOther2:call(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_dispatch/http/content_security_policy.rb:18)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_dispatch.http.content_security_policy.RUBY$method$call$0(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_dispatch/http/content_security_policy.rb:18)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:117)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:156)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:199)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.warden_minus_1_dot_2_dot_8.lib.warden.manager.invokeOther4:call(vendor/bundle/jruby/2.5.0/gems/warden-1.2.8/lib/warden/manager.rb:36)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.warden_minus_1_dot_2_dot_8.lib.warden.manager.RUBY$block$call$1(vendor/bundle/jruby/2.5.0/gems/warden-1.2.8/lib/warden/manager.rb:36)
org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:146)
org.jruby.runtime.BlockBody.yield(BlockBody.java:114)
org.jruby.runtime.Block.yield(Block.java:165)
org.jruby.RubyContinuation.enter(RubyContinuation.java:108)
org.jruby.RubyKernel.rbCatch19Common(RubyKernel.java:1188)
org.jruby.RubyKernel.rbCatch19(RubyKernel.java:1181)
org.jruby.RubyKernel$INVOKER$s$rbCatch19.call(RubyKernel$INVOKER$s$rbCatch19.gen)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:180)
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:189)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.warden_minus_1_dot_2_dot_8.lib.warden.manager.invokeOther1
7:catch(vendor/bundle/jruby/2.5.0/gems/warden-1.2.8/lib/warden/manager.rb:34)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.warden_minus_1_dot_2_dot_8.lib.warden.manager.RUBY$method$
call$0(vendor/bundle/jruby/2.5.0/gems/warden-1.2.8/lib/warden/manager.rb:34)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:117)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:156)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:199)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.rack_minus_2_dot_0_dot_6.lib.rack.session.abstract.id.invokeOther4:call(vendor/bundle/jruby/2.5.0/gems/rack-2.0.6/lib/rack/session/abstract/id.rb:232)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.rack_minus_2_dot_0_dot_6.lib.rack.session.abstract.id.RUBY$method$context$0(vendor/bundle/jruby/2.5.0/gems/rack-2.0.6/lib/rack/session/abstract/id.rb:232)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:91)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:114)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:156)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:199)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.rack_minus_2_dot_0_dot_6.lib.rack.session.abstract.id.invokeOther0:context(vendor/bundle/jruby/2.5.0/gems/rack-2.0.6/lib/rack/session/abstract/id.rb:226)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.rack_minus_2_dot_0_dot_6.lib.rack.session.abstract.id.RUBY$method$call$0(vendor/bundle/jruby/2.5.0/gems/rack-2.0.6/lib/rack/session/abstract/id.rb:226)
org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:117)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:156)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:199)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
usr.src.app.vendor.bundle.jruby.$2_dot_5_dot_0.gems.actionpack_minus_5_dot_2_dot_1.lib.action_dispatch.middleware.cookies.invokeOther2:call(vendor/bundle/jruby/2.5.0/gems/actionpack-5.2.1/lib/action_dispatch/middleware/cookies.rb:670)
...

@enebo enebo added this to the JRuby 9.2.6.0 milestone Dec 13, 2018

@enebo

This comment has been minimized.

Copy link
Member

enebo commented Dec 13, 2018

Unfortunately this backtrace does not give me enough to know the exact case why this crashes but reviewing the method where it explodes I can see we have same bad logic. I will try and analyze this method to figure which scenarios this happens where we do not find a dynamic scope.

@alaz if you can easily reproduce can you do a one time -X+C which will force compile everything? This should give us a backtrace with more ruby method names in the stack (this may take a lot longer to get started).

@alaz

This comment has been minimized.

Copy link
Author

alaz commented Dec 13, 2018

Yes, I understand the difficulties. I'm not able to reproduce it unfortunately. This happened only once in production approximately 5 hours after the deployment of 9.2.5, which means the rate of crashes is relatively low. At the moment I have already rolled back to 9.2.4.1 which was running fine before for days.

@headius

This comment has been minimized.

Copy link
Member

headius commented Dec 13, 2018

@alaz Ok @enebo has a reproduction now and he's looking into a fix. We are still curious about how this happened. The simplest repro looks like this:

module Foo
  proc { return }.call
end

The problem here is that when we search for a place for the return to go to (e.g. a method body), we accidentally walk right off the script and end up in null space. That null gets dereferenced into an NPE.

This proc can also be saved off, relocated to some other place in the app, and called later for the same effect; its set of scopes remains constant, so it's a little time bomb.

It's hard to tell from your trace, since the top few Ruby frames are still in the intepreter, but this is likely related to the handle_exceptions/rescue_handler stuff from the Rescuable module in ActiveSupport. That appears higher up in the stack.

One theory is that there's an error handler being registered somewhere using a proc/block within a class body. If that proc contains a return, it could cause this exception. It may just have been pilot error that return was used instead of break (which returns from the block).

So without more to go on we'll fix what we know and ask you to look for this pattern in your app, or possibly in the libraries your app calls: A proc, in a class body, with a return in it; probably being used in concert with the Rescuable subsystem of ActiveSupport.

@headius

This comment has been minimized.

Copy link
Member

headius commented Dec 13, 2018

Oh if you want to attempt to reproduce it, you could bring jit.threshold all the way down to 0 so we get those top few interpreter frames.

@enebo

This comment has been minimized.

Copy link
Member

enebo commented Dec 13, 2018

@alaz I have found a class of errors where we should be returning but we crash instead...but the first case is:

module Foo
  proc { return 1  }.call
end

With that said I am somewhat concerned what I fix may still end up somehow not fixing your issue. I will tell you that this code is only hit when you make a closure {proc/lambda} that has an explicit return or break within it. Not sure how common that is but it appears in your backtrace in ActionController::Rescue::process_action. This in turn calls ActiveSupport::Rescueable.rescue_with_handler. I can make an educated guess from here that it calls handler_for_rescue and skips down to when Proc since I see proc call (lambda ends up converting to proc call at some point) which contains an instance_exec towards the top of the stack. It is the &rescuer I suspect which is the thing crashing.

@enebo

This comment has been minimized.

Copy link
Member

enebo commented Dec 13, 2018

@alaz if you can you could print out the procs and their locations from rescue_handlers from rescueable.rb. That should then be possible to look at each one for a break/return in them.

@AlexEzzeddine

This comment has been minimized.

Copy link

AlexEzzeddine commented Dec 14, 2018

Don't know if this helps but I accidentally found this error when I was running our rspec tests on jruby-9.2.5.0

RSpec version:

rspec (3.5.0)
rspec-core (3.5.4)

test.rb:

puts "JRUBY_VERSION: #{JRUBY_VERSION}" if defined?(JRUBY_VERSION)
puts "RUBY_VERSION: #{RUBY_VERSION}" if defined?(RUBY_VERSION)
puts "RUBY_ENGINE: #{RUBY_ENGINE}" if defined?(RUBY_ENGINE)

module MyTest
  RSpec.describe 'me' do

    it 'test' do
      return
    end
  
  end
end
Output:
vagrant@vagrant-ubuntu-trusty-64:~$ rspec test.rb
JRUBY_VERSION: 9.2.5.0
RUBY_VERSION: 2.5.0
RUBY_ENGINE: jruby
F

Failures:

  1) me test
     Failure/Error: Unable to find org.jruby.ir.runtime.IRRuntimeHelpers.checkForLJE(IRRuntimeHelpers.java to read failed line
     Java::JavaLang::NullPointerException:
     # org.jruby.ir.runtime.IRRuntimeHelpers.checkForLJE(IRRuntimeHelpers.java:125)
     # org.jruby.ir.instructions.CheckForLJEInstr.check(CheckForLJEInstr.java:69)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:171)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:104)
     # org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:128)
     # org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:151)
     # org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:194)
     # org.jruby.runtime.BlockBody.yield(BlockBody.java:125)
     # org.jruby.runtime.Block.yieldNonArray(Block.java:169)
     # org.jruby.RubyBasicObject.yieldUnder(RubyBasicObject.java:1759)
     # org.jruby.RubyBasicObject.instance_exec(RubyBasicObject.java:2666)
     # org.jruby.RubyBasicObject$INVOKER$i$0$3$instance_exec.call(RubyBasicObject$INVOKER$i$0$3$instance_exec.gen)
     # org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:203)
     # org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:357)
     # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:182)
     # org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:339)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
     # org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:128)
     # org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:151)
     # org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:89)
     # org.jruby.runtime.Block.yieldSpecific(Block.java:134)
     # org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:468)
     # org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:76)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:178)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:104)
     # org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:128)
     # org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:151)
     # org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:89)
     # org.jruby.runtime.Block.yieldSpecific(Block.java:134)
     # org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:468)
     # org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:76)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:178)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:104)
     # org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:128)
     # org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:151)
     # org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:89)
     # org.jruby.runtime.Block.yieldSpecific(Block.java:134)
     # org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:468)
     # org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:76)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:178)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:104)
     # org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:128)
     # org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:151)
     # org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:89)
     # org.jruby.runtime.Block.yieldSpecific(Block.java:134)
     # org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:468)
     # org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:76)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:178)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:104)
     # org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:171)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:158)
     # org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:357)
     # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:182)
     # org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:189)
     # org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:338)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:105)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:92)
     # org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:303)
     # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:84)
     # org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:91)
     # org.jruby.ir.instructions.CallBase.interpret(CallBase.java:544)
     # org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:105)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:92)
     # org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:303)
     # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:84)
     # org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:91)
     # org.jruby.ir.instructions.CallBase.interpret(CallBase.java:544)
     # org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:105)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:92)
     # org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:303)
     # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:84)
     # org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:91)
     # org.jruby.ir.instructions.CallBase.interpret(CallBase.java:544)
     # org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
     # org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:92)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:204)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:191)
     # org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:207)
     # org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:367)
     # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:203)
     # org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:326)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
     # org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:128)
     # org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:151)
     # org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:187)
     # org.jruby.runtime.BlockBody.yield(BlockBody.java:116)
     # org.jruby.runtime.Block.yield(Block.java:165)
     # org.jruby.RubyArray.collect(RubyArray.java:2563)
     # org.jruby.RubyArray.map19(RubyArray.java:2577)
     # org.jruby.RubyArray$INVOKER$i$0$0$map19.call(RubyArray$INVOKER$i$0$0$map19.gen)
     # org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroBlock.call(JavaMethod.java:537)
     # org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:303)
     # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:84)
     # org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:91)
     # org.jruby.ir.instructions.CallBase.interpret(CallBase.java:544)
     # org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
     # org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:171)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:158)
     # org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:199)
     # org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:346)
     # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:172)
     # org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:317)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
     # org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:171)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:158)
     # org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:199)
     # org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:346)
     # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:172)
     # org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:317)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
     # org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:128)
     # org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:151)
     # org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:187)
     # org.jruby.runtime.BlockBody.yield(BlockBody.java:116)
     # org.jruby.runtime.Block.yield(Block.java:165)
     # org.jruby.RubyArray.collect(RubyArray.java:2563)
     # org.jruby.RubyArray.map19(RubyArray.java:2577)
     # org.jruby.RubyArray$INVOKER$i$0$0$map19.call(RubyArray$INVOKER$i$0$0$map19.gen)
     # org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroBlock.call(JavaMethod.java:537)
     # org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:303)
     # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:84)
     # org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:91)
     # org.jruby.ir.instructions.CallBase.interpret(CallBase.java:544)
     # org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
     # org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:128)
     # org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:151)
     # org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:89)
     # org.jruby.runtime.Block.yieldSpecific(Block.java:134)
     # org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:468)
     # org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:76)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:178)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:104)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:105)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:92)
     # org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:303)
     # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:84)
     # org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:91)
     # org.jruby.ir.instructions.CallBase.interpret(CallBase.java:544)
     # org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
     # org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:128)
     # org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:151)
     # org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:187)
     # org.jruby.runtime.BlockBody.yield(BlockBody.java:116)
     # org.jruby.runtime.Block.yield(Block.java:165)
     # org.jruby.ir.runtime.IRRuntimeHelpers.yield(IRRuntimeHelpers.java:464)
     # org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:85)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:178)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:104)
     # org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:171)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:158)
     # org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:357)
     # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:182)
     # org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:189)
     # org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:338)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
     # org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:171)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:158)
     # org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:199)
     # org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:346)
     # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:172)
     # org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:317)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
     # org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:92)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:204)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:191)
     # org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:207)
     # org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:367)
     # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:203)
     # org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:326)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:105)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:92)
     # org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:303)
     # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:84)
     # org.jruby.ir.instructions.CallBase.interpret(CallBase.java:547)
     # org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
     # org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:80)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:138)
     # org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:125)
     # org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:191)
     # org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:325)
     # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:141)
     # org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:346)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
     # org.jruby.ir.interpreter.Interpreter.INTERPRET_ROOT(Interpreter.java:108)
     # org.jruby.ir.interpreter.Interpreter.execute(Interpreter.java:95)
     # org.jruby.ir.interpreter.Interpreter.execute(Interpreter.java:34)
     # org.jruby.ir.IRTranslator.execute(IRTranslator.java:42)
     # org.jruby.Ruby.runInterpreter(Ruby.java:861)
     # org.jruby.Ruby.loadFile(Ruby.java:2953)
     # org.jruby.runtime.load.LibrarySearcher$ResourceLibrary.load(LibrarySearcher.java:251)
     # org.jruby.runtime.load.LibrarySearcher$FoundLibrary.load(LibrarySearcher.java:34)
     # org.jruby.runtime.load.LoadService.load(LoadService.java:346)
     # org.jruby.RubyKernel.loadCommon(RubyKernel.java:1037)
     # org.jruby.RubyKernel.load(RubyKernel.java:1007)
     # org.jruby.RubyKernel$INVOKER$s$load.call(RubyKernel$INVOKER$s$load.gen)
     # org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:399)
     # org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:346)
     # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:172)
     # org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:317)
     # org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
     # org.jruby.ir.interpreter.Interpreter.INTERPRET_EVAL(Interpreter.java:118)
     # org.jruby.ir.interpreter.Interpreter.evalCommon(Interpreter.java:172)
     # org.jruby.ir.interpreter.Interpreter.evalWithBinding(Interpreter.java:196)
     # org.jruby.RubyKernel.evalCommon(RubyKernel.java:1084)
     # org.jruby.RubyKernel.eval(RubyKernel.java:1046)
     # org.jruby.RubyKernel$INVOKER$s$0$3$eval.call(RubyKernel$INVOKER$s$0$3$eval.gen)
     # org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:219)
     # org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:215)
     # org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:390)
     # org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:234)
     # java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
     # org.jruby.ir.Compiler$1.load(Compiler.java:94)
     # org.jruby.Ruby.runScript(Ruby.java:849)
     # org.jruby.Ruby.runNormally(Ruby.java:772)
     # org.jruby.Ruby.runNormally(Ruby.java:790)
     # org.jruby.Ruby.runFromMain(Ruby.java:602)
     # org.jruby.Main.doRunFromMain(Main.java:415)
     # org.jruby.Main.internalRun(Main.java:307)
     # org.jruby.Main.run(Main.java:234)
     # org.jruby.Main.main(Main.java:206)

Finished in 0.04154 seconds (files took 0.47868 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./test.rb:8 # me test
@alaz

This comment has been minimized.

Copy link
Author

alaz commented Dec 14, 2018

@enebo oops, turns out it's my code in the application is the guilty –

  rescue_from ActionController::InvalidAuthenticityToken do
    return logout if ...
    ...
  end

CSRF errors are rare indeed, this may explain 5 hours (multiply by 2 servers) of happy work.

@enebo

This comment has been minimized.

Copy link
Member

enebo commented Dec 14, 2018

@alaz yeah we wondered if this would be the case! It is happier that you made a mistake than it being some intermittent JIT bug which only happens after hours of running.

Nonetheless this issue pointed out some problems we have (e.g. NPE) and I am still working to fix them. So I will followup and resolve this bug with somes fixes and specs. If you happen to make this mistake again in the future you willl likely get a proper local jump error or the return will exit early out of a file (depending on when it is called).

@headius

This comment has been minimized.

Copy link
Member

headius commented Dec 14, 2018

@AlexEzzeddine Well, that's good timing! @enebo is working on fixes now. Perhaps you and @alaz could put together some specs for our spec/ruby directory? That will get merged into the standard ruby/spec suite.

@enebo

This comment has been minimized.

Copy link
Member

enebo commented Dec 17, 2018

[Note: I wrote this on Friday and hit 'Comment' now :) ]

@alaz yeah we wondered if this would be the case! It is happier that you made a mistake than it being some intermittent JIT bug which only happens after hours of running.

Nonetheless this issue pointed out some problems we have (e.g. NPE) and I am still working to fix them. So I will followup and resolve this bug with somes fixes and specs. If you happen to make this mistake again in the future you willl likely get a proper local jump error or the return will exit early out of a file (depending on when it is called).

enebo added a commit that referenced this issue Dec 17, 2018

@headius headius changed the title NPE in 9.2.5 NPE due to unhandled non-local return Dec 18, 2018

@enebo enebo closed this in a55e357 Dec 19, 2018

enebo added a commit that referenced this issue Dec 19, 2018

Merge pull request #5527 from jruby/gh5517
Fixes #5517 (returns in unexpected place)
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.