Skip to content

Instantly share code, notes, and snippets.

@localshred
Created September 27, 2013 17:15
Show Gist options
  • Save localshred/6731892 to your computer and use it in GitHub Desktop.
Save localshred/6731892 to your computer and use it in GitHub Desktop.
Mavericks jruby 1.7.2 issues using jdk 7u40.
Fetching gem metadata from http://rubygems.org/.........
Fetching gem metadata from http://gems.moneydesktop.com/....
Fetching gem metadata from http://rubygems.org/.........
Fetching gem metadata from http://gems.moneydesktop.com/..
Resolving dependencies..........................................................................................................................................................................................................................................................................................................................................ManyVarsDynamicScope.java:147:in `setValueDepthZero': java.lang.ArrayIndexOutOfBoundsException: 0
from ManyVarsDynamicScope.java:140:in `setValue'
from NoVarsDynamicScope.java:87:in `setValue'
from LocalAsgnNode.java:123:in `interpret'
from BlockNode.java:71:in `interpret'
from RescueBodyNode.java:108:in `interpret'
from RescueNode.java:177:in `handleException'
from RescueNode.java:123:in `interpret'
from ASTInterpreter.java:75:in `INTERPRET_METHOD'
from InterpretedMethod.java:161:in `call'
from DefaultMethod.java:180:in `call'
from CachingCallSite.java:316:in `cacheAndCall'
from CachingCallSite.java:145:in `callBlock'
from CachingCallSite.java:154:in `callIter'
from CallNoArgBlockNode.java:64:in `interpret'
from NewlineNode.java:105:in `interpret'
from BlockNode.java:71:in `interpret'
from RootNode.java:129:in `interpret'
from ASTInterpreter.java:120:in `INTERPRET_ROOT'
from Ruby.java:837:in `runInterpreter'
from Ruby.java:2629:in `loadFile'
from ExternalScript.java:66:in `load'
from LoadService.java:351:in `load'
from RubyKernel.java:1054:in `loadCommon'
from RubyKernel.java:1046:in `load19'
from RubyKernel$INVOKER$s$0$1$load19.gen:-1:in `call'
from DynamicMethod.java:208:in `call'
from DynamicMethod.java:204:in `call'
from MethodHandle.java:599:in `invokeWithArguments'
from InvocationLinker.java:151:in `invocationFallback'
from /Users/bj/.rbenv/versions/jruby-1.7.2/bin/bundle:23:in `__file__'
from /Users/bj/.rbenv/versions/jruby-1.7.2/bin/bundle:-1:in `load'
from Ruby.java:810:in `runScript'
from Ruby.java:803:in `runScript'
from Ruby.java:674:in `runNormally'
from Ruby.java:523:in `runFromMain'
from Main.java:390:in `doRunFromMain'
from Main.java:279:in `internalRun'
from Main.java:221:in `run'
from Main.java:201:in `main'
Java::JavaLang::InternalError: collect=Lambda(a0:L,a1:L,a2:L,a3:L)=>{
t4:L=MethodHandle()MethodHandle();
t5:I=MethodHandle(MethodHandle)boolean(t4:L);t5:I} at java.lang.invoke.MethodHandleStatics.newInternalError(MethodHandleStatics.java:97)
Java::JavaLang::InternalError: guard=Lambda(a0:L,a1:L,a2:L,a3:L)=>{
t4:I=MethodHandle(ThreadContext,IRubyObject,IRubyObject)boolean(a1:L,a2:L,a3:L);
t5:L=MethodHandleImpl.selectAlternative(t4:I,(MethodHandle(ThreadContext,IRubyObject,IRubyObject)IRubyObject),(MethodHandle(ThreadContext,IRubyObject,IRubyObject)IRubyObject));
t6:L=MethodHandle.invokeBasic(t5:L,a1:L,a2:L,a3:L);t6:L} at java.lang.invoke.MethodHandleStatics.newInternalError(MethodHandleStatics.java:97)
Exception in thread "RubyThread-4: /Users/bj/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/protobuf-2.8.6/lib/protobuf/rpc/service_directory.rb:113"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "RubyThread-4: /Users/bj/.rbenv/versions/jruby-1.7.2/lib/ruby/gems/shared/gems/protobuf-2.8.6/lib/protobuf/rpc/service_directory.rb:113"
@localshred
Copy link
Author

@headius still get the lambda guard errors on 1.7.4. I get rid of the permgen by my heavy handed -J-Xmx2048m, I recognize that's probably not jruby but something consuming far too much mem in my app.

An error occurred
  Java::JavaLang::InternalError: guard=Lambda(a0:L,a1:L)=>{
    t2:I=MethodHandle(IRubyObject)boolean(a1:L);
    t3:L=MethodHandleImpl.selectAlternative(t2:I,(MethodHandle(IRubyObject)IRubyObject),(MethodHandle(IRubyObject)IRubyObject));
    t4:L=MethodHandle.invokeBasic(t3:L,a1:L);t4:L}
  occurred at java.lang.invoke.MethodHandleStatics.newInternalError(MethodHandleStatics.java:97)

@localshred
Copy link
Author

@headius turning off invokedynamic as you suggested stops the lambda guard warnings.

@localshred
Copy link
Author

I should be clear, it fixes the issue in 1.7.4, 1.7.2 still fails the guard errors and permgen as well.

@localshred
Copy link
Author

Hmm, one final lambda warning on 1.7.4 with invokedynamic off (while running specs on a rails 3.2.14 app):

  Java::JavaLang::InternalError: BMH.reinvoke=Lambda(a0:L,a1:L,a2:L)=>{
    t3:I=BoundMethodHandle$Species_LI.argI1(a0:L);
    t4:L=MethodHandle.reinvokerTarget(a0:L);
    t5:I=MethodHandle.invokeBasic(t4:L,t3:I,a1:L);t5:I}
  occurred at java.lang.invoke.MethodHandleStatics.newInternalError(MethodHandleStatics.java:97)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment