Skip to content

Instantly share code, notes, and snippets.

@fabiokung
Created September 9, 2008 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabiokung/9754 to your computer and use it in GitHub Desktop.
Save fabiokung/9754 to your computer and use it in GitHub Desktop.
$ jruby -J-Xss256k -d -e "require 'java'; require 'servlet-api-2.5.jar'; module A; include Java::JavaxServletHttp::HttpServletResponse; end"
/Users/fck/Development/Ruby/jruby-1.1.4/lib/ruby/site_ruby/1.8/builtin/javasupport/core_ext/module.rb:16 warning: instance variable @java_aliases not initialized
/Users/fck/Development/Ruby/jruby-1.1.4/lib/ruby/site_ruby/1.8/builtin/javasupport/core_ext/module.rb:16 warning: instance variable @java_aliases not initialized
/Users/fck/Development/Ruby/jruby-1.1.4/lib/ruby/site_ruby/1.8/builtin/javasupport/core_ext/module.rb:16 warning: instance variable @java_aliases not initialized
/Users/fck/Development/Ruby/jruby-1.1.4/lib/ruby/site_ruby/1.8/builtin/javasupport/core_ext/module.rb:16 warning: instance variable @java_aliases not initialized
Error: Your application used more stack memory than the safety cap of 256k.
Specify -J-Xss####k to increase it (#### = cap size in KB).
Exception trace follows:
java.lang.StackOverflowError
at java.util.concurrent.locks.ReentrantLock.unlock(ReentrantLock.java:431)
at java.util.concurrent.ConcurrentHashMap$Segment.put(ConcurrentHashMap.java:434)
at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:848)
at org.jruby.RubyModule.addMethod(RubyModule.java:855)
at org.jruby.java.proxies.JavaInterfaceTemplate.appendFeaturesToModule(JavaInterfaceTemplate.java:280)
at org.jruby.java.proxies.JavaInterfaceTemplate.append_features(JavaInterfaceTemplate.java:75)
at org.jruby.java.proxies.JavaInterfaceTemplate$s_method_1_0$RUBYFRAMEDINVOKER$append_features.call(org/jruby/java/proxies/JavaInterfaceTemplate$s_method_1_0$RUBYFRAMEDINVOKER$append_features.gen)
at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneBlock.call(JavaMethod.java:580)
at org.jruby.RubyClass.invoke(RubyClass.java:333)
at org.jruby.javasupport.util.RuntimeHelpers.invokeAs(RuntimeHelpers.java:366)
at org.jruby.java.proxies.JavaInterfaceTemplate.append_features(JavaInterfaceTemplate.java:80)
at org.jruby.java.proxies.JavaInterfaceTemplate$s_method_1_0$RUBYFRAMEDINVOKER$append_features.call(org/jruby/java/proxies/JavaInterfaceTemplate$s_method_1_0$RUBYFRAMEDINVOKER$append_features.gen)
at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneBlock.call(JavaMethod.java:580)
at org.jruby.RubyClass.invoke(RubyClass.java:333)
at org.jruby.javasupport.util.RuntimeHelpers.invokeAs(RuntimeHelpers.java:366)
at org.jruby.java.proxies.JavaInterfaceTemplate.append_features(JavaInterfaceTemplate.java:80)
at org.jruby.java.proxies.JavaInterfaceTemplate$s_method_1_0$RUBYFRAMEDINVOKER$append_features.call(org/jruby/java/proxies/JavaInterfaceTemplate$s_method_1_0$RUBYFRAMEDINVOKER$append_features.gen)
at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneBlock.call(JavaMethod.java:580)
at org.jruby.RubyClass.invoke(RubyClass.java:333)
at org.jruby.javasupport.util.RuntimeHelpers.invokeAs(RuntimeHelpers.java:366)
at org.jruby.java.proxies.JavaInterfaceTemplate.append_features(JavaInterfaceTemplate.java:80)
at org.jruby.java.proxies.JavaInterfaceTemplate$s_method_1_0$RUBYFRAMEDINVOKER$append_features.call(org/jruby/java/proxies/JavaInterfaceTemplate$s_method_1_0$RUBYFRAMEDINVOKER$append_features.gen)
at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneBlock.call(JavaMethod.java:580)
at org.jruby.RubyClass.invoke(RubyClass.java:333)
at org.jruby.javasupport.util.RuntimeHelpers.invokeAs(RuntimeHelpers.java:366)
at org.jruby.java.proxies.JavaInterfaceTemplate.append_features(JavaInterfaceTemplate.java:80)
at org.jruby.java.proxies.JavaInterfaceTemplate$s_method_1_0$RUBYFRAMEDINVOKER$append_features.call(org/jruby/java/proxies/JavaInterfaceTemplate$s_method_1_0$RUBYFRAMEDINVOKER$append_features.gen)
# the rest of stacktrace continues to repeat
irb(main):008:0> class A
irb(main):009:1> include Java::JavaxServletHttp::HttpServletResponse
irb(main):010:1> end
SystemStackError: stack level too deep
from /Users/fck/Development/Ruby/jruby-1.1.4/lib/ruby/1.8/irb/workspace.rb:53:in `binding'
from /Users/fck/Development/Ruby/jruby-1.1.4/lib/ruby/1.8/irb/workspace.rb:53:in `eval'
from /Users/fck/Development/Ruby/jruby-1.1.4/lib/ruby/1.8/irb/workspace.rb:81:in `evaluate'
from /Users/fck/Development/Ruby/jruby-1.1.4/lib/ruby/1.8/irb/context.rb:219:in `evaluate'
from /Users/fck/Development/Ruby/jruby-1.1.4/lib/ruby/1.8/irb.rb:150:in `eval_input'
from /Users/fck/Development/Ruby/jruby-1.1.4/lib/ruby/1.8/irb.rb:259:in `signal_status'
from /Users/fck/Development/Ruby/jruby-1.1.4/lib/ruby/1.8/irb.rb:147:in `eval_input'
from /Users/fck/Development/Ruby/jruby-1.1.4/lib/ruby/1.8/irb/ruby-lex.rb:244:in `each_top_level_statement'
from /Users/fck/Development/Ruby/jruby-1.1.4/lib/ruby/1.8/irb/ruby-lex.rb:230:in `loop'
from /Users/fck/Development/Ruby/jruby-1.1.4/lib/ruby/1.8/irb/ruby-lex.rb:230:in `each_top_level_statement'
from /Users/fck/Development/Ruby/jruby-1.1.4/lib/ruby/1.8/irb/ruby-lex.rb:229:in `catch'
from /Users/fck/Development/Ruby/jruby-1.1.4/lib/ruby/1.8/irb/ruby-lex.rb:229:in `each_top_level_statement'
from /Users/fck/Development/Ruby/jruby-1.1.4/lib/ruby/1.8/irb.rb:146:in `eval_input'
from /Users/fck/Development/Ruby/jruby-1.1.4/lib/ruby/1.8/irb.rb:70:in `start'
from /Users/fck/Development/Ruby/jruby-1.1.4/lib/ruby/1.8/irb.rb:69:in `catch'
from /Users/fck/Development/Ruby/jruby-1.1.4/lib/ruby/1.8/irb.rb:69:in `start'
from /Users/fck/Development/Ruby/jruby-1.1.4/bin/jirb:19Maybe IRB bug!!
irb(main):016:0> include Java::JavaxServletHttp::HttpServletResponse
org.jruby.javasupport.Java:1558:in `new_proxy_instance2': java.lang.ClassCastException: org.jruby.RubyNil
from org.jruby.java.proxies.JavaInterfaceTemplate:256:in `jcreateProxy'
from org.jruby.java.proxies.JavaInterfaceTemplate:23:in `access$000'
from org.jruby.java.proxies.JavaInterfaceTemplate$3:163:in `call'
from org.jruby.internal.runtime.methods.JavaMethod$JavaMethodNoBlock:62:in `call'
from org.jruby.RubyClass:343:in `finvoke'
from org.jruby.javasupport.util.RuntimeHelpers:335:in `invoke'
from org.jruby.java.proxies.JavaInterfaceTemplate$2:147:in `call'
from org.jruby.internal.runtime.methods.DynamicMethod:242:in `call'
from org.jruby.internal.runtime.methods.DynamicMethod:151:in `call'
from org.jruby.RubyClass:458:in `finvoke'
from org.jruby.javasupport.util.RuntimeHelpers:342:in `invoke'
from org.jruby.exceptions.RaiseException:69:in `<init>'
from org.jruby.Ruby:2723:in `newRaiseException'
from org.jruby.Ruby:2667:in `newSystemStackError'
from org.jruby.evaluator.ASTInterpreter:129:in `evalWithBinding'
from org.jruby.RubyKernel:862:in `eval'
from org.jruby.RubyKernel$s_method_0_3$RUBYFRAMEDINVOKER$eval:-1:in `call'
from org.jruby.internal.runtime.methods.DynamicMethod:135:in `call'
from org.jruby.runtime.CallSite$InlineCachingCallSite:289:in `call'
from org.jruby.ast.FCallManyArgsNode:60:in `interpret'
from org.jruby.ast.NewlineNode:101:in `interpret'
from org.jruby.internal.runtime.methods.DefaultMethod:163:in `interpretedCall'
from org.jruby.internal.runtime.methods.DefaultMethod:140:in `call'
from org.jruby.internal.runtime.methods.DefaultMethod:190:in `call'
from org.jruby.runtime.CallSite$InlineCachingCallSite:289:in `call'
from org.jruby.ast.CallManyArgsNode:59:in `interpret'
from org.jruby.ast.FCallOneArgNode:36:in `interpret'
from org.jruby.ast.NewlineNode:101:in `interpret'
from org.jruby.ast.BlockNode:67:in `interpret'
from org.jruby.internal.runtime.methods.DefaultMethod:163:in `interpretedCall'
from org.jruby.internal.runtime.methods.DefaultMethod:140:in `call'
from org.jruby.internal.runtime.methods.DefaultMethod:295:in `call'
from org.jruby.runtime.CallSite$InlineCachingCallSite:442:in `call'
from org.jruby.ast.CallTwoArgNode:59:in `interpret'
from org.jruby.ast.NewlineNode:101:in `interpret'
from org.jruby.ast.BlockNode:67:in `interpret'
from org.jruby.ast.RescueNode:222:in `executeBody'
from org.jruby.ast.RescueNode:144:in `interpretWithJavaExceptions'
from org.jruby.ast.RescueNode:107:in `interpret'
from org.jruby.ast.BeginNode:80:in `interpret'
from org.jruby.ast.NewlineNode:101:in `interpret'
from org.jruby.ast.BlockNode:67:in `interpret'
from org.jruby.runtime.InterpretedBlock:202:in `evalBlockBody'
from org.jruby.runtime.InterpretedBlock:190:in `yield'
from org.jruby.runtime.Block:110:in `yield'
from org.jruby.ast.YieldNode:95:in `interpret'
from org.jruby.ast.NewlineNode:101:in `interpret'
from org.jruby.ast.EnsureNode:93:in `interpret'
from org.jruby.ast.BeginNode:80:in `interpret'
from org.jruby.ast.NewlineNode:101:in `interpret'
from org.jruby.ast.BlockNode:67:in `interpret'
from org.jruby.internal.runtime.methods.DefaultMethod:163:in `interpretedCall'
from org.jruby.internal.runtime.methods.DefaultMethod:140:in `call'
from org.jruby.internal.runtime.methods.DefaultMethod:274:in `call'
from org.jruby.runtime.CallSite$InlineCachingCallSite:422:in `callIter'
from org.jruby.ast.FCallOneArgBlockNode:33:in `interpret'
from org.jruby.ast.NewlineNode:101:in `interpret'
from org.jruby.runtime.InterpretedBlock:202:in `evalBlockBody'
from org.jruby.runtime.InterpretedBlock:190:in `yield'
from org.jruby.runtime.Block:110:in `yield'
from org.jruby.ast.YieldNode:95:in `interpret'
from org.jruby.ast.NewlineNode:101:in `interpret'
from org.jruby.ast.IfNode:108:in `interpret'
from org.jruby.ast.NewlineNode:101:in `interpret'
from org.jruby.ast.BlockNode:67:in `interpret'
from org.jruby.ast.RescueNode:222:in `executeBody'
from org.jruby.ast.RescueNode:144:in `interpretWithJavaExceptions'
from org.jruby.ast.RescueNode:107:in `interpret'
from org.jruby.ast.BeginNode:80:in `interpret'
from org.jruby.ast.NewlineNode:101:in `interpret'
from org.jruby.runtime.InterpretedBlock:202:in `evalBlockBody'
from org.jruby.runtime.InterpretedBlock:153:in `yield'
from org.jruby.runtime.Block:105:in `yield'
from org.jruby.RubyKernel:1039:in `loop'
from org.jruby.RubyKernel$s_method_0_0$RUBYFRAMEDINVOKER$loop:-1:in `call'
from org.jruby.runtime.CallSite$InlineCachingCallSite:144:in `cacheAndCall'
from org.jruby.runtime.CallSite$InlineCachingCallSite:374:in `callIter'
from org.jruby.ast.FCallNoArgBlockNode:31:in `interpret'
from org.jruby.ast.NewlineNode:101:in `interpret'
from org.jruby.runtime.InterpretedBlock:202:in `evalBlockBody'
from org.jruby.runtime.InterpretedBlock:153:in `yield'
from org.jruby.runtime.Block:105:in `yield'
from org.jruby.RubyKernel:890:in `rbCatch'
from org.jruby.RubyKernel$s_method_1_0$RUBYFRAMEDINVOKER$rbCatch:-1:in `call'
from org.jruby.runtime.CallSite$InlineCachingCallSite:168:in `cacheAndCall'
from org.jruby.runtime.CallSite$InlineCachingCallSite:425:in `callIter'
from org.jruby.ast.FCallOneArgBlockNode:33:in `interpret'
from org.jruby.ast.NewlineNode:101:in `interpret'
from org.jruby.ast.BlockNode:67:in `interpret'
from org.jruby.internal.runtime.methods.DefaultMethod:163:in `interpretedCall'
from org.jruby.internal.runtime.methods.DefaultMethod:140:in `call'
from org.jruby.internal.runtime.methods.DefaultMethod:232:in `call'
from org.jruby.runtime.CallSite$InlineCachingCallSite:144:in `cacheAndCall'
from org.jruby.runtime.CallSite$InlineCachingCallSite:355:in `call'
from org.jruby.ast.CallNoArgBlockNode:63:in `interpret'
from org.jruby.ast.NewlineNode:101:in `interpret'
from org.jruby.ast.BlockNode:67:in `interpret'
from org.jruby.internal.runtime.methods.DefaultMethod:163:in `interpretedCall'
from org.jruby.internal.runtime.methods.DefaultMethod:140:in `call'
from org.jruby.internal.runtime.methods.DefaultMethod:211:in `call'
from org.jruby.runtime.CallSite$InlineCachingCallSite:132:in `cacheAndCall'
from org.jruby.runtime.CallSite$InlineCachingCallSite:343:in `call'
from org.jruby.ast.CallNoArgNode:61:in `interpret'
from org.jruby.ast.NewlineNode:101:in `interpret'
from org.jruby.runtime.InterpretedBlock:202:in `evalBlockBody'
from org.jruby.runtime.InterpretedBlock:153:in `yield'
from org.jruby.runtime.Block:105:in `yield'
from org.jruby.RubyKernel:890:in `rbCatch'
from org.jruby.RubyKernel$s_method_1_0$RUBYFRAMEDINVOKER$rbCatch:-1:in `call'
from org.jruby.runtime.CallSite$InlineCachingCallSite:168:in `cacheAndCall'
from org.jruby.runtime.CallSite$InlineCachingCallSite:425:in `callIter'
from org.jruby.ast.FCallOneArgBlockNode:33:in `interpret'
from org.jruby.ast.NewlineNode:101:in `interpret'
from org.jruby.ast.BlockNode:67:in `interpret'
from org.jruby.internal.runtime.methods.DefaultMethod:163:in `interpretedCall'
from org.jruby.internal.runtime.methods.DefaultMethod:140:in `call'
from org.jruby.internal.runtime.methods.DefaultMethod:253:in `call'
from org.jruby.runtime.CallSite$InlineCachingCallSite:156:in `cacheAndCall'
from org.jruby.runtime.CallSite$InlineCachingCallSite:394:in `call'
from Users.fck.Development.Ruby.jruby_minus_1_dot_1_dot_4.bin.jirb:19:in `__file__'
from Users.fck.Development.Ruby.jruby_minus_1_dot_1_dot_4.bin.jirb:-1:in `__file__'
from Users.fck.Development.Ruby.jruby_minus_1_dot_1_dot_4.bin.jirb:-1:in `load'
from org.jruby.Ruby:544:in `runScript'
from org.jruby.Ruby:457:in `runNormally'
from org.jruby.Ruby:330:in `runFromMain'
from org.jruby.Main:214:in `run'
from org.jruby.Main:100:in `run'
from org.jruby.Main:84:in `main'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment