You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Active Support's Object#try method with String#squeeze raises a Java ArrayIndexOutOfBoundsException:
jruby-9.0.5.0 :003 > ' '.try(:squeeze!)
Java::JavaLang::ArrayIndexOutOfBoundsException: 0
from org.jruby.RubyString.squeeze_bang19(RubyString.java:4611)
from org.jruby.RubyString$INVOKER$i$squeeze_bang19.call(RubyString$INVOKER$i$squeeze_bang19.gen)
from org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:729)
from org.jruby.RubyKernel.public_send(RubyKernel.java:1823)
from org.jruby.RubyKernel$INVOKER$s$0$0$public_send.call(RubyKernel$INVOKER$s$0$0$public_send.gen)
from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:273)
from org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79)
from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)
from org.jruby.ir.instructions.CallBase.interpret(CallBase.java:414)
from org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:348)
from org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:77)
from org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:140)
from org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:126)
from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:273)
from org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:79)
from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)
... 122 levels...
from org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:196)
from org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:197)
from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:313)
from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:163)
from Users.ah.$_dot_rvm.rubies.jruby_minus_9_dot_0_dot_5_dot_0.bin.irb.invokeOther3:start(/Users/ah/.rvm/rubies/jruby-9.0.5.0/bin/irb)
from Users.ah.$_dot_rvm.rubies.jruby_minus_9_dot_0_dot_5_dot_0.bin.irb.RUBY$script(/Users/ah/.rvm/rubies/jruby-9.0.5.0/bin/irb:13)
from java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
from org.jruby.ir.Compiler$1.load(Compiler.java:111)
from org.jruby.Ruby.runScript(Ruby.java:817)
from org.jruby.Ruby.runScript(Ruby.java:809)
from org.jruby.Ruby.runNormally(Ruby.java:747)
from org.jruby.Ruby.runFromMain(Ruby.java:569)
from org.jruby.Main.doRunFromMain(Main.java:415)
from org.jruby.Main.internalRun(Main.java:310)
from org.jruby.Main.run(Main.java:239)
from org.jruby.Main.main(Main.java:201)
To reproduce, with Active Support installed:
require'active_support'require'active_support/core_ext'# Works:# ' '.squeeze# ' '.squeeze!# ''.try(:squeeze)# ''.try(:squeeze!)## Does not work:# ' '.try(:squeeze)# ' '.try(:squeeze!)' '.try(:squeeze)
I was able reproduce this in JRuby 9.0.x.x and JRuby 1.7.x with Active Support 4.2 back to 3.2. It seems to be limited to the squeeze method.
Let me know if you need any other info.
The text was updated successfully, but these errors were encountered:
* jruby-1_7:
test that public_send correctly dispatches native Java methods (closing jruby#3668)
generic JavaMethodN call with [] args should delegate to correct arity (due overriders)
explicitly mark required arg count for RubyString squeeze impls
* master: (28 commits)
single Unsafe retrieval is enough - do not do it over again in StringSupport
[test] add and pend load module wrapping test - does not work for this case currently
make JavaMethod arity sub-classes open-closed with call overrides (for less surprises)
Add a simple issue template for contributors.
[Truffle] Strip out internal NilNodes when flattening a sequence.
[Truffle] Break down IfNode into If, IfElse and Unless so they can be simpler.
[Truffle] BreakShellException is dead code.
[Truffle] Tidy up NotNode.
[Truffle] Tidy up IfNode.
[Truffle] Tidy up OrNode.
[Truffle] Tidy up AndNode.
[Truffle] Couple of minor cosmetic fixes to the backtrace package.
[Truffle] Interleaving Java should be configured per-formatter.
[Truffle] Remove print_interleaved_backtrace, as we can do it with -Xtruffle.backtraces.interleave_java now.
[Truffle] Option to interleave Java stacktraces in Ruby backtraces.
[Truffle] Store Java exceptions in some cases.
[Truffle] Optionally store Java stack traces in Ruby backtraces.
[Truffle] Simplify long-winded comment.
[Truffle] Move check_ambiguous_arguments to allowed failures.
test that public_send correctly dispatches native Java methods (closing #3668)
...
Using Active Support's
Object#try
method withString#squeeze
raises a Java ArrayIndexOutOfBoundsException:To reproduce, with Active Support installed:
I was able reproduce this in JRuby 9.0.x.x and JRuby 1.7.x with Active Support 4.2 back to 3.2. It seems to be limited to the
squeeze
method.Let me know if you need any other info.
The text was updated successfully, but these errors were encountered: