Issue Type: Bug Bug
Affects Versions: JRuby 1.7.0
Assignee: Unassigned
Components: Core Classes/Modules, Ruby 1.9.3
Created: 02/Dec/12 6:07 AM
Description:

While testing some code that used singleton_class.method_defined?, I noticed it would cause a Java backtrace, but only in the ripl (0.7.0) with the ripl-auto_indent (0.2.0) plugin loaded.

$ ripl -rripl/auto_indent
>> module Test; def self.foo; end; end
=> Test
>> Test.singleton_class.method_defined?(:foo)
Java::JavaLang::ArrayIndexOutOfBoundsException: 16
org.jruby.RubyArray.eltInternal(RubyArray.java:766)
org.jruby.evaluator.AssignmentVisitor.multiAssign(AssignmentVisitor.java:64)
org.jruby.ast.MultipleAsgn19Node.assign(MultipleAsgn19Node.java:119)
org.jruby.ast.ArgsNode.masgnAwareArgAssign(ArgsNode.java:261)
org.jruby.ast.ArgsNode.prepare(ArgsNode.java:246)
org.jruby.runtime.Interpreted19Block.setupBlockArgs(Interpreted19Block.java:242)
org.jruby.runtime.Interpreted19Block.setupBlockArg(Interpreted19Block.java:231)
org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:158)
org.jruby.runtime.Block.yield(Block.java:130)
org.jruby.RubyEnumerator$RubyEnumeratorEnumerable$2.call(RubyEnumerator.java:338)
org.jruby.runtime.CallBlock.yield(CallBlock.java:90)
org.jruby.runtime.Block.yield(Block.java:130)
org.jruby.RubyArray.eachCommon(RubyArray.java:1605)
org.jruby.RubyArray.each(RubyArray.java:1612)
org.jruby.RubyArray$INVOKER$i$0$0$each.call(RubyArray$INVOKER$i$0$0$each.gen)
org.jruby.RubyClass.finvoke(RubyClass.java:590)
org.jruby.javasupport.util.RuntimeHelpers.invoke(RuntimeHelpers.java:504)
org.jruby.RubyEnumerable.callEach(RubyEnumerable.java:96)
org.jruby.RubyEnumerator$RubyEnumeratorEnumerable.each_cons(RubyEnumerator.java:334)
org.jruby.RubyEnumerator$RubyEnumeratorEnumerable.each_cons19(RubyEnumerator.java:348)
org.jruby.RubyEnumerator$RubyEnumeratorEnumerable$INVOKER$s$1$0$each_cons19.call(RubyEnumerator$RubyEnumeratorEnumerable$INVOKER$s$1$0$each_cons19.gen)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:177)
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:188)
org.jruby.ast.CallOneArgBlockNode.interpret(CallOneArgBlockNode.java:60)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:182)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:192)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
org.jruby.ast.InstAsgnNode.interpret(InstAsgnNode.java:95)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:182)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:192)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
org.jruby.ast.InstAsgnNode.interpret(InstAsgnNode.java:95)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.ast.RescueNode.executeBody(RescueNode.java:228)
org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:123)
org.jruby.ast.RescueNode.interpret(RescueNode.java:113)
org.jruby.ast.EnsureNode.interpret(EnsureNode.java:96)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:204)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:200)
org.jruby.runtime.callsite.SuperCallSite.callBlock(SuperCallSite.java:190)
org.jruby.runtime.callsite.SuperCallSite.call(SuperCallSite.java:197)
org.jruby.runtime.callsite.SuperCallSite.callVarargs(SuperCallSite.java:108)
org.jruby.ast.ZSuperNode.interpret(ZSuperNode.java:104)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.ast.IfNode.interpret(IfNode.java:116)
org.jruby.ast.IfNode.interpret(IfNode.java:118)
org.jruby.ast.IfNode.interpret(IfNode.java:118)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:182)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:192)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.ast.RescueNode.executeBody(RescueNode.java:228)
org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:123)
org.jruby.ast.RescueNode.interpret(RescueNode.java:113)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:161)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:184)
org.jruby.runtime.callsite.SuperCallSite.callBlock(SuperCallSite.java:144)
org.jruby.runtime.callsite.SuperCallSite.call(SuperCallSite.java:151)
org.jruby.runtime.callsite.SuperCallSite.callVarargs(SuperCallSite.java:107)
org.jruby.ast.ZSuperNode.interpret(ZSuperNode.java:104)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:209)
org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:160)
org.jruby.runtime.Block.yield(Block.java:130)
org.jruby.RubyContinuation.enter(RubyContinuation.java:107)
org.jruby.RubyKernel.rbCatch19Common(RubyKernel.java:1180)
org.jruby.RubyKernel.rbCatch19(RubyKernel.java:1173)
org.jruby.RubyKernel$INVOKER$s$rbCatch19.call(RubyKernel$INVOKER$s$rbCatch19.gen)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:177)
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:188)
org.jruby.ast.FCallOneArgBlockNode.interpret(FCallOneArgBlockNode.java:34)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:176)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:134)
org.jruby.ast.VCallNode.interpret(VCallNode.java:88)
org.jruby.ast.WhileNode.interpret(WhileNode.java:131)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:209)
org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:160)
org.jruby.runtime.Block.yield(Block.java:130)
org.jruby.RubyContinuation.enter(RubyContinuation.java:107)
org.jruby.RubyKernel.rbCatch19Common(RubyKernel.java:1180)
org.jruby.RubyKernel.rbCatch19(RubyKernel.java:1173)
org.jruby.RubyKernel$INVOKER$s$rbCatch19.call(RubyKernel$INVOKER$s$rbCatch19.gen)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:336)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:179)
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:188)
org.jruby.ast.FCallOneArgBlockNode.interpret(FCallOneArgBlockNode.java:34)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:176)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
org.jruby.ast.VCallNode.interpret(VCallNode.java:88)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:176)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:64)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:182)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:192)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
org.jruby.ast.IfNode.interpret(IfNode.java:118)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:176)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:64)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.ast.RootNode.interpret(RootNode.java:129)
org.jruby.evaluator.ASTInterpreter.INTERPRET_ROOT(ASTInterpreter.java:120)
org.jruby.Ruby.runInterpreter(Ruby.java:797)
org.jruby.Ruby.loadFile(Ruby.java:2576)
org.jruby.runtime.load.ExternalScript.load(ExternalScript.java:66)
org.jruby.runtime.load.LoadService.load(LoadService.java:329)
org.jruby.RubyKernel.loadCommon(RubyKernel.java:1053)
org.jruby.RubyKernel.load19(RubyKernel.java:1045)
org.jruby.RubyKernel$INVOKER$s$0$1$load19.call(RubyKernel$INVOKER$s$0$1$load19.gen)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:204)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
home.hal.$dot_gem.jruby.$1_dot_9_dot_3.bin.ripl.file_(/home/hal/.gem/jruby/1.9.3/bin/ripl:23)
home.hal.$_dot_gem.jruby.$1_dot_9_dot_3.bin.ripl.load(/home/hal/.gem/jruby/1.9.3/bin/ripl)
org.jruby.Ruby.runScript(Ruby.java:770)
org.jruby.Ruby.runScript(Ruby.java:763)
org.jruby.Ruby.runNormally(Ruby.java:640)
org.jruby.Ruby.runFromMain(Ruby.java:489)
org.jruby.Main.doRunFromMain(Main.java:375)
org.jruby.Main.internalRun(Main.java:264)
org.jruby.Main.run(Main.java:230)
org.jruby.Main.run(Main.java:214)
org.jruby.Main.main(Main.java:194)

However in irb, it works:

irb(main):005:0> Test.singleton_class.method_defined?(:foo)
=> true

Environment: jruby 1.7.0 (1.9.3p203) 2012-10-22 ff1ebbe on OpenJDK 64-Bit Server VM 1.7.0_09-icedtea-mockbuild_2012_10_17_15_53-b00 [linux-amd64]
Project: JRuby
Labels: exception singleton ripl
Priority: Major Major
Reporter: Postmodern
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to