Lazy region change breaks rubinius mspec run
--------------------------------------------

                 Key: JRUBY-1701
                 URL: http://jira.codehaus.org/browse/JRUBY-1701
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
            Reporter: Charles Oliver Nutter
            Assignee: Marcin Mielżyński


Seems to be a problem with this code causing NPE in rbx mspec run:

>From RubyRegexp.regsub:
{noformat}
            case '+':
                if (regs == null && mbeg == -1) {
                    no = 0;
                    continue;
                } else {
                    no = regs.numRegs-1;
                    while(regs.beg[no] == -1 && no > 0) no--;
                    if (no == 0) continue;
                }
                break;
{noformat}

And the trace:
{noformat}
Exception in thread "main" java.lang.NullPointerException
        at org.jruby.RubyRegexp.regsub(RubyRegexp.java:604)
        at org.jruby.RubyString.gsub(RubyString.java:1757)
        at org.jruby.RubyString.gsub(RubyString.java:1683)
        at sun.reflect.GeneratedMethodAccessor273.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.jruby.internal.runtime.methods.ReflectedJavaMethod.call(ReflectedJavaMethod.java:143)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:158)
        at 
org.jruby.runtime.CallSite$ArgumentBoxingCallSite.call(CallSite.java:103)
        at org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:653)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:300)
        at org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:644)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:300)
        at org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:644)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:300)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:169)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:176)
        at org.jruby.runtime.Block.yield(Block.java:115)
        at 
it4091779_4901415.__rescue_2(/Users/headius/NetBeansProjects/rubinius/spec/mini_rspec.rb:360)
        at 
it4091779_4901415.__ensure_1(/Users/headius/NetBeansProjects/rubinius/spec/mini_rspec.rb:359)
        at 
it4091779_4901415.__rescue_1(/Users/headius/NetBeansProjects/rubinius/spec/mini_rspec.rb:359)
        at 
it4091779_4901415.__file__(/Users/headius/NetBeansProjects/rubinius/spec/mini_rspec.rb:358)
        at 
it4091779_4901415.run(/Users/headius/NetBeansProjects/rubinius/spec/mini_rspec.rb)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:115)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:144)
        at 
it6409509_4901415.__file__(/Users/headius/NetBeansProjects/rubinius/spec/mini_rspec.rb:414)
        at 
it6409509_4901415.run(/Users/headius/NetBeansProjects/rubinius/spec/mini_rspec.rb)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:115)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:158)
        at 
org.jruby.evaluator.ASTInterpreter.fCallNode(ASTInterpreter.java:1098)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:346)
        at org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:627)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:294)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:169)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:176)
        at org.jruby.runtime.Block.yield(Block.java:115)
        at 
describe1892370_4901415.__file__(/Users/headius/NetBeansProjects/rubinius/spec/mini_rspec.rb:381)
        at 
describe1892370_4901415.run(/Users/headius/NetBeansProjects/rubinius/spec/mini_rspec.rb)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:115)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:144)
        at 
describe11364484_4901415.__file__(/Users/headius/NetBeansProjects/rubinius/spec/mini_rspec.rb:410)
        at 
describe11364484_4901415.run(/Users/headius/NetBeansProjects/rubinius/spec/mini_rspec.rb)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:115)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:158)
        at 
org.jruby.evaluator.ASTInterpreter.fCallNode(ASTInterpreter.java:1098)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:346)
        at org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:627)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:294)
        at org.jruby.evaluator.ASTInterpreter.rootNode(ASTInterpreter.java:1600)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:449)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:169)
        at org.jruby.Ruby.loadFile(Ruby.java:1794)
        at org.jruby.runtime.load.ExternalScript.load(ExternalScript.java:52)
        at org.jruby.runtime.load.LoadService.load(LoadService.java:214)
        at org.jruby.RubyKernel.load(RubyKernel.java:679)
        at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.jruby.internal.runtime.methods.ReflectedJavaMethod.call(ReflectedJavaMethod.java:141)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:144)
        at 
org.jruby.runtime.CallSite$ArgumentBoxingCallSite.call(CallSite.java:103)
        at last_mspec.closure0___rescue_1(last_mspec.rb:12)
        at last_mspec.closure0(last_mspec.rb:12)
        at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.jruby.runtime.callback.ReflectionCallbackFactory$1.call(ReflectionCallbackFactory.java:145)
        at org.jruby.runtime.CompiledBlock.yield(CompiledBlock.java:128)
        at org.jruby.runtime.CompiledBlock.yield(CompiledBlock.java:109)
        at org.jruby.runtime.Block.yield(Block.java:110)
        at org.jruby.RubyArray.each(RubyArray.java:1181)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.jruby.internal.runtime.methods.ReflectedJavaMethod.call(ReflectedJavaMethod.java:143)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:158)
        at 
org.jruby.runtime.CallSite$ArgumentBoxingCallSite.call(CallSite.java:109)
        at last_mspec.__file__(last_mspec.rb:7)
        at last_mspec.load(last_mspec.rb)
        at org.jruby.Ruby.runScript(Ruby.java:574)
        at org.jruby.Ruby.runNormally(Ruby.java:504)
        at org.jruby.Ruby.runFromMain(Ruby.java:427)
        at org.jruby.Main.runInterpreter(Main.java:214)
        at org.jruby.Main.runInterpreter(Main.java:170)
        at org.jruby.Main.run(Main.java:119)
        at org.jruby.Main.run(Main.java:93)
        at org.jruby.Main.main(Main.java:84)
{noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
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