Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Incomplete
-
Affects Version/s: JRuby 1.6.7
-
Fix Version/s: None
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:jruby 1.6.7 (ruby-1.8.7-p357) (2012-02-22 3e82bc8) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_26) [darwin-x86_64-java]
Bundler version 1.1.3
Rails version 3.2.3
-
Number of attachments :
Description
$ bundle exec script/rails generate migration MyMigration
gives me:
LoadError: load error: /Users/tomdz/work/app/config/application -- java.lang.StackOverflowError: null require at org/jruby/RubyKernel.java:1033 (root) at /Users/tomdz/work/app/vendor/jruby/1.8/gems/railties-3.2.3/lib/rails/commands.rb:24 require at org/jruby/RubyKernel.java:1033 (root) at script/rails:6
When run with jruby -d directly, I get this at the bottom of the output:
$ jruby -d script/rails generate migration MyMigration
java.lang.ArrayIndexOutOfBoundsException: 0
at org.jruby.RubyKernel.printExceptionSummary(RubyKernel.java:1015)
at org.jruby.RubyKernel.raise(RubyKernel.java:990)
at org.jruby.java.addons.KernelJavaAddons.rbRaise(KernelJavaAddons.java:45)
at org.jruby.java.addons.KernelJavaAddons$s$0$3$rbRaise.call(KernelJavaAddons$s$0$3$rbRaise.gen:65535)
at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:227)
at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:223)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:352)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:237)
at org.jruby.ast.FCallThreeArgNode.interpret(FCallThreeArgNode.java:40)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:233)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:215)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:332)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:203)
at org.jruby.ast.CallTwoArgNode.interpret(CallTwoArgNode.java:59)
at org.jruby.ast.ReturnNode.interpret(ReturnNode.java:92)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.RescueNode.executeBody(RescueNode.java:216)
at org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:120)
at org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:111)
at org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:374)
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:347)
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:304)
at org.jruby.runtime.Block.yield(Block.java:130)
at org.jruby.RubyArray.eachCommon(RubyArray.java:1608)
at org.jruby.RubyArray.each(RubyArray.java:1615)
at org.jruby.RubyArray$i$0$0$each.call(RubyArray$i$0$0$each.gen:65535)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:302)
at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:144)
at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:153)
at org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:64)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:190)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:199)
at org.jruby.RubyClass.finvoke(RubyClass.java:715)
at org.jruby.javasupport.util.RuntimeHelpers.invoke(RuntimeHelpers.java:548)
at org.jruby.RubyBasicObject.callMethod(RubyBasicObject.java:361)
at org.jruby.ast.ConstNode.interpret(ConstNode.java:91)
at org.jruby.ast.Colon2ConstNode.definition(Colon2ConstNode.java:45)
at org.jruby.ast.DefinedNode.interpret(DefinedNode.java:88)
at org.jruby.ast.IfNode.interpret(IfNode.java:111)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.ast.RootNode.interpret(RootNode.java:129)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_ROOT(ASTInterpreter.java:119)
at org.jruby.Ruby.runInterpreter(Ruby.java:724)
at org.jruby.Ruby.loadFile(Ruby.java:2487)
at org.jruby.runtime.load.ExternalScript.load(ExternalScript.java:66)
at org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:745)
at org.jruby.runtime.load.LoadService.smartLoad(LoadService.java:332)
at org.jruby.runtime.load.LoadService.require(LoadService.java:379)
at org.jruby.runtime.load.LoadService.lockAndRequire(LoadService.java:304)
at org.jruby.RubyKernel.requireCommon(RubyKernel.java:1050)
at org.jruby.RubyKernel.require(RubyKernel.java:1033)
at org.jruby.RubyKernel$s$1$0$require.call(RubyKernel$s$1$0$require.gen:65535)
at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:319)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:167)
at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:111)
at org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:374)
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:347)
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:304)
at org.jruby.runtime.Block.yield(Block.java:130)
at org.jruby.RubyArray.eachCommon(RubyArray.java:1608)
at org.jruby.RubyArray.each(RubyArray.java:1615)
at org.jruby.RubyArray$i$0$0$each.call(RubyArray$i$0$0$each.gen:65535)
at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:142)
at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:153)
at org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:64)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.RescueNode.executeBody(RescueNode.java:216)
at org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:120)
at org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:111)
at org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:374)
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:347)
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:304)
at org.jruby.runtime.Block.yield(Block.java:130)
at org.jruby.RubyArray.eachCommon(RubyArray.java:1608)
at org.jruby.RubyArray.each(RubyArray.java:1615)
at org.jruby.RubyArray$i$0$0$each.call(RubyArray$i$0$0$each.gen:65535)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:302)
at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:144)
at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:153)
at org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:64)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:233)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:215)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:332)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:203)
at org.jruby.ast.CallSpecialArgNode.interpret(CallSpecialArgNode.java:69)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:233)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:215)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:332)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:203)
at org.jruby.ast.CallTwoArgNode.interpret(CallTwoArgNode.java:59)
at org.jruby.ast.IfNode.interpret(IfNode.java:117)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.ast.RootNode.interpret(RootNode.java:129)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_ROOT(ASTInterpreter.java:119)
at org.jruby.Ruby.runInterpreter(Ruby.java:724)
at org.jruby.Ruby.loadFile(Ruby.java:2487)
at org.jruby.runtime.load.ExternalScript.load(ExternalScript.java:66)
at org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:745)
at org.jruby.runtime.load.LoadService.smartLoad(LoadService.java:332)
at org.jruby.runtime.load.LoadService.require(LoadService.java:379)
at org.jruby.runtime.load.LoadService.lockAndRequire(LoadService.java:304)
at org.jruby.RubyKernel.requireCommon(RubyKernel.java:1050)
at org.jruby.RubyKernel.require(RubyKernel.java:1033)
at org.jruby.RubyKernel$s$1$0$require.call(RubyKernel$s$1$0$require.gen:65535)
at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:319)
at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:61)
at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:61)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:312)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:169)
at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.ast.IfNode.interpret(IfNode.java:119)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.ast.WhenOneArgNode.whenSlowTest(WhenOneArgNode.java:36)
at org.jruby.ast.WhenOneArgNode.when(WhenOneArgNode.java:46)
at org.jruby.ast.CaseNode.interpret(CaseNode.java:133)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.ast.RootNode.interpret(RootNode.java:129)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_ROOT(ASTInterpreter.java:119)
at org.jruby.Ruby.runInterpreter(Ruby.java:724)
at org.jruby.Ruby.loadFile(Ruby.java:2487)
at org.jruby.runtime.load.ExternalScript.load(ExternalScript.java:66)
at org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:745)
at org.jruby.runtime.load.LoadService.smartLoad(LoadService.java:332)
at org.jruby.runtime.load.LoadService.require(LoadService.java:379)
at org.jruby.runtime.load.LoadService.lockAndRequire(LoadService.java:304)
at org.jruby.RubyKernel.requireCommon(RubyKernel.java:1050)
at org.jruby.RubyKernel.require(RubyKernel.java:1033)
at org.jruby.RubyKernel$s$1$0$require.call(RubyKernel$s$1$0$require.gen:65535)
at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:319)
at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:61)
at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:61)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:312)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:169)
at script.rails.__file__(script/rails:6)
at script.rails.load(script/rails)
at org.jruby.Ruby.runScript(Ruby.java:697)
at org.jruby.Ruby.runScript(Ruby.java:690)
at org.jruby.Ruby.runNormally(Ruby.java:597)
at org.jruby.Ruby.runFromMain(Ruby.java:446)
at org.jruby.Main.doRunFromMain(Main.java:369)
at org.jruby.Main.internalRun(Main.java:258)
at org.jruby.Main.run(Main.java:224)
at org.jruby.Main.run(Main.java:208)
at org.jruby.Main.main(Main.java:188)
Exception `LoadError' at org/jruby/RubyKernel.java:1033 - load error: will_paginate -- java.lang.ArrayIndexOutOfBoundsException: 0
LoadError: load error: will_paginate -- java.lang.ArrayIndexOutOfBoundsException: 0
require at org/jruby/RubyKernel.java:1033
require at /Users/tomdz/.rvm/gems/jruby-1.6.7/gems/bundler-1.1.3/lib/bundler/runtime.rb:68
each at org/jruby/RubyArray.java:1615
require at /Users/tomdz/.rvm/gems/jruby-1.6.7/gems/bundler-1.1.3/lib/bundler/runtime.rb:66
each at org/jruby/RubyArray.java:1615
require at /Users/tomdz/.rvm/gems/jruby-1.6.7/gems/bundler-1.1.3/lib/bundler/runtime.rb:55
require at /Users/tomdz/.rvm/gems/jruby-1.6.7/gems/bundler-1.1.3/lib/bundler.rb:119
(root) at /Users/tomdz/work/app/config/application.rb:9
require at org/jruby/RubyKernel.java:1033
(root) at /Users/tomdz/work/app/config/application.rb:24
require at org/jruby/RubyKernel.java:1033
(root) at script/rails:6
Activity
Hiro Asari
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Assignee | Hiro Asari [ asari ] | |
| Resolution | Incomplete [ 4 ] |
Charles Oliver Nutter
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
The problem seems to be this method in RubyKernel:
private static void printExceptionSummary(ThreadContext context, Ruby runtime, RubyException rEx) { RubyStackTraceElement[] elements = rEx.getBacktraceElements(); RubyStackTraceElement firstElement = elements[0]; String msg = String.format("Exception `%s' at %s:%s - %s\n", rEx.getMetaClass(), firstElement.getFileName(), firstElement.getLineNumber(), runtime.is1_9() ? TypeConverter.convertToType(rEx, runtime.getString(), "to_s") : rEx.convertToString().toString()); runtime.getErrorStream().print(msg); }which does not check whether elements has any elements. Fwiw this is fixed in master, but I'm unsure how to work around this.