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

RubyUDPSocket ArrayIndexOutOfBounds with v9.1.[01].0. #3916

Closed
clonezone opened this Issue May 23, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@clonezone

Environment

  • Fails with JRuby v9.1.0.0 and v9.1.1.0. Works fine with JRuby v9.0.5.0.
  • Ubuntu 14.04.
  • Celluloid & Celluloid-IO v0.17.3

Expected Behavior

Sockets get connected.

Actual Behavior

Java::JavaLang::ArrayIndexOutOfBoundsException: 2
    org.jruby.ext.socket.RubyUDPSocket.recvfrom_nonblock(RubyUDPSocket.java:223)
    org.jruby.ext.socket.RubyUDPSocket$INVOKER$i$recvfrom_nonblock.call(RubyUDPSocket$INVOKER$i$recvfrom_nonblock.gen)
    org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:724)
    org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:205)
    org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:740)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:273)
    org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)
    org.jruby.ir.instructions.CallBase.interpret(CallBase.java:423)
    org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:348)
    org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:77)
    org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)
    org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
    org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
    org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:197)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:313)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:163)
    org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:316)
    org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:77)
    org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)
    org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
    org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
    org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:197)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:313)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:163)
    org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:316)
    org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:77)
    org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
    org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:273)
    org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)
    org.jruby.ir.instructions.CallBase.interpret(CallBase.java:423)
    org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:348)
    org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:77)
    org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
    org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:273)
    org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)
    org.jruby.RubyClass.newInstance(RubyClass.java:904)
    org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)
    org.jruby.ir.runtime.IRRuntimeHelpers.classSuper(IRRuntimeHelpers.java:975)
    org.jruby.ir.instructions.ClassSuperInstr.interpret(ClassSuperInstr.java:65)
    org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:348)
    org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:77)
    org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
    org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:273)
    org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)
    org.jruby.ir.instructions.CallBase.interpret(CallBase.java:423)
    org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:348)
    org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:77)
    org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:80)
    org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)
    org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)
    org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:189)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:293)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:131)
    org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:332)
    org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:77)
    org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:80)
    org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)
    org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)
    org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:189)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:293)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:131)
    org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:332)
    org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:77)
    org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
    org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
    org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:77)
    org.jruby.runtime.Block.yieldSpecific(Block.java:136)
    org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:480)
    org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:74)
    org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:191)
    org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:115)
    org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:86)
    org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
    org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:323)
    org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:173)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:177)
    org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:325)
    org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:77)
    org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
    org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
    org.jruby.RubyClass.finvoke(RubyClass.java:543)
    org.jruby.RubyBasicObject.send19(RubyBasicObject.java:1640)
    org.jruby.RubyBasicObject$INVOKER$i$send19.call(RubyBasicObject$INVOKER$i$send19.gen)
    org.jruby.RubyKernel.public_send(RubyKernel.java:1812)
    org.jruby.RubyKernel$INVOKER$s$0$0$public_send.call(RubyKernel$INVOKER$s$0$0$public_send.gen)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:273)
    org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)
    install.path.gems.celluloid_minus_0_dot_17_dot_3.lib.celluloid.calls.invokeOther6:public_send(/install/path/gems/celluloid-0.17.3/lib/celluloid/calls.rb)
    install.path.gems.celluloid_minus_0_dot_17_dot_3.lib.celluloid.calls.RUBY$method$dispatch$0(/install/path/gems/celluloid-0.17.3/lib/celluloid/calls.rb:28)
    org.jruby.internal.runtime.methods.CompiledIRMethod.invokeExact(CompiledIRMethod.java:219)
    org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:92)
    org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:93)
    org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuper(IRRuntimeHelpers.java:960)
    org.jruby.ir.runtime.IRRuntimeHelpers.instanceSuperSplatArgs(IRRuntimeHelpers.java:951)
    install.path.gems.celluloid_minus_0_dot_17_dot_3.lib.celluloid.call.sync.invokeSuper14:dispatch(/install/path/gems/celluloid-0.17.3/lib/celluloid/call/sync.rb)
    install.path.gems.celluloid_minus_0_dot_17_dot_3.lib.celluloid.call.sync.RUBY$method$dispatch$0(/install/path/gems/celluloid-0.17.3/lib/celluloid/call/sync.rb:16)
    org.jruby.internal.runtime.methods.CompiledIRMethod.invokeExact(CompiledIRMethod.java:245)
    org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:110)
    org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:163)
    org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:197)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:161)
    install.path.gems.celluloid_minus_0_dot_17_dot_3.lib.celluloid.cell.invokeOther13:dispatch(/install/path/gems/celluloid-0.17.3/lib/celluloid/cell.rb)
    install.path.gems.celluloid_minus_0_dot_17_dot_3.lib.celluloid.cell.RUBY$block$dispatch$2(/install/path/gems/celluloid-0.17.3/lib/celluloid/cell.rb:50)
    org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:156)
    org.jruby.runtime.BlockBody.yield(BlockBody.java:110)
    org.jruby.runtime.Block.yield(Block.java:167)
    org.jruby.ir.runtime.IRRuntimeHelpers.yield(IRRuntimeHelpers.java:476)
    org.jruby.ir.targets.YieldSite.yield(YieldSite.java:87)
    install.path.gems.celluloid_minus_0_dot_17_dot_3.lib.celluloid.cell.RUBY$block$task$1(/install/path/gems/celluloid-0.17.3/lib/celluloid/cell.rb:76)
    org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:156)
    org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:73)
    org.jruby.runtime.Block.yieldSpecific(Block.java:136)
    org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:480)
    org.jruby.ir.targets.YieldSite.yieldSpecific(YieldSite.java:114)
    install.path.gems.celluloid_minus_0_dot_17_dot_3.lib.celluloid.actor.RUBY$block$task$1(/install/path/gems/celluloid-0.17.3/lib/celluloid/actor.rb:339)
    org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:156)
    org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:73)
    org.jruby.runtime.Block.yieldSpecific(Block.java:136)
    org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:480)
    org.jruby.ir.targets.YieldSite.yieldSpecific(YieldSite.java:114)
    install.path.gems.celluloid_minus_0_dot_17_dot_3.lib.celluloid.task.RUBY$block$initialize$2(/install/path/gems/celluloid-0.17.3/lib/celluloid/task.rb:44)
    org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:156)
    org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:73)
    org.jruby.runtime.Block.yieldSpecific(Block.java:136)
    org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:480)
    org.jruby.ir.targets.YieldSite.yieldSpecific(YieldSite.java:114)
    install.path.gems.celluloid_minus_0_dot_17_dot_3.lib.celluloid.task.fibered.RUBY$block$create$2(/install/path/gems/celluloid-0.17.3/lib/celluloid/task/fibered.rb:14)
    org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:156)
    org.jruby.runtime.BlockBody.yield(BlockBody.java:118)
    org.jruby.runtime.Block.yieldArray(Block.java:179)
    org.jruby.ext.fiber.ThreadFiber$1.run(ThreadFiber.java:262)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    java.lang.Thread.run(Thread.java:745)

@enebo enebo added this to the JRuby 9.1.2.0 milestone May 24, 2016

@enebo

This comment has been minimized.

Show comment
Hide comment
@enebo

enebo May 24, 2016

Member

I think this looks like a simple mistake on our part where the math is off by one.

Member

enebo commented May 24, 2016

I think this looks like a simple mistake on our part where the math is off by one.

@enebo enebo closed this in bd741ac May 24, 2016

@enebo

This comment has been minimized.

Show comment
Hide comment
@enebo

enebo May 24, 2016

Member

@clonezone if you could test this by grabbing a nightly (which will be published tonight at ci.jruby.org) or build it and test that this error is fixed I would appreciate it. The fact that this front-end processing of incoming arguments just did not work makes me worry that perhaps something else won't work too. So kicking the tires or providing us with a simple reproduction would be helpful.

Member

enebo commented May 24, 2016

@clonezone if you could test this by grabbing a nightly (which will be published tonight at ci.jruby.org) or build it and test that this error is fixed I would appreciate it. The fact that this front-end processing of incoming arguments just did not work makes me worry that perhaps something else won't work too. So kicking the tires or providing us with a simple reproduction would be helpful.

@clonezone

This comment has been minimized.

Show comment
Hide comment
@clonezone

clonezone May 24, 2016

Sure. I'll let you know tomorrow.

Sure. I'll let you know tomorrow.

@clonezone

This comment has been minimized.

Show comment
Hide comment
@clonezone

clonezone May 25, 2016

Success!

Thank you.

Success!

Thank you.

enebo added a commit that referenced this issue May 25, 2016

Fixes #3916. RubyUDPSocket ArrayIndexOutOfBounds with v9.1.[01].0.
Apparently we had two off-by-one arg processing mistakes which got
introduced in December o_O.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment