groovy

Stacktrace in the new shell

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.1-beta-3
  • Fix Version/s: 1.1-rc-1
  • Component/s: Groovysh
  • Labels:
    None
  • Number of attachments :
    0

Description

I have some difficulties reproducing this bug, as I'm not 100% sure what's causing it exactly, but it seems that when you launch the shell (with the NEWSHELL var env set), when you start typing some uncomplete statement, and then hit Escape, you can get the huge and horrible stacktrace below:

C:\Documents and Settings\Guillaume Laforge>groovysh
Groovy Shell (1.1-beta-3, JVM: 1.6.0_02-b06)
Type 'help' or '\h' for help.
-------------------------------------------------------------------------------------------------------------
groovy0):000>ERROR java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.AbstractStringBuilder.deleteCharAt (AbstractStringBuilder.java:770)
at java.lang.StringBuffer.deleteCharAt (StringBuffer.java:382)
at jline.ConsoleReader.killLine (ConsoleReader.java:742)
at jline.ConsoleReader.readLine (ConsoleReader.java:569)
at jline.ConsoleReader.readLine (ConsoleReader.java:416)
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:597)
at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke (ReflectionMetaMethod.java:64)
at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke (MetaClassHelper.java:537)
at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:772)
at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:614)
at org.codehaus.groovy.runtime.Invoker.invokePojoMethod (Invoker.java:87)
at org.codehaus.groovy.runtime.Invoker.invokeMethod (Invoker.java:75)
at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod (InvokerHelper.java:74)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN (ScriptBytecodeAdapter.java:158)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.readLine (InteractiveShellRunner.groovy:86)
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:597)
at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke (ReflectionMetaMethod.java:64)
at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke (MetaClassHelper.java:537)
at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:772)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN (ScriptBytecodeAdapter.java:66)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrent0 (ScriptBytecodeAdapter.java:99)
at org.codehaus.groovy.tools.shell.ShellRunner.work (ShellRunner.groovy:75)
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:597)
at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke (ReflectionMetaMethod.java:64)
at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke (MetaClassHelper.java:537)
at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:772)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN (ScriptBytecodeAdapter.java:66)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrent0 (ScriptBytecodeAdapter.java:99)
at org.codehaus.groovy.tools.shell.ShellRunner.run (ShellRunner.groovy:57)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run (InteractiveShellRunner.groovy)
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:597)
at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke (ReflectionMetaMethod.java:64)
at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke (MetaClassHelper.java:537)
at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:772)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN (ScriptBytecodeAdapter.java:118)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0 (ScriptBytecodeAdapter.java:142)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run (InteractiveShellRunner.groovy:64)
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:597)
at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke (ReflectionMetaMethod.java:64)
at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke (MetaClassHelper.java:537)
at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:772)
at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:614)
at org.codehaus.groovy.runtime.Invoker.invokePogoMethod (Invoker.java:98)
at org.codehaus.groovy.runtime.Invoker.invokeMethod (Invoker.java:79)
at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod (InvokerHelper.java:74)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN (ScriptBytecodeAdapter.java:158)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0 (ScriptBytecodeAdapter.java:201)
at org.codehaus.groovy.tools.shell.Groovysh.run (Groovysh.groovy:446)
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:597)
at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke (ReflectionMetaMethod.java:64)
at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke (MetaClassHelper.java:537)
at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:772)
at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:614)
at org.codehaus.groovy.runtime.Invoker.invokePogoMethod (Invoker.java:98)
at org.codehaus.groovy.runtime.Invoker.invokeMethod (Invoker.java:79)
at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod (InvokerHelper.java:74)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN (ScriptBytecodeAdapter.java:158)
at org.codehaus.groovy.tools.shell.Groovysh.main (Groovysh.groovy:591)
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:597)
at org.codehaus.groovy.tools.GroovyStarter.rootLoader (GroovyStarter.java:101)
at org.codehaus.groovy.tools.GroovyStarter.main (GroovyStarter.java:130)
groovy0):000> ERROR java.lang.StringIndexOutOfBoundsException: null
at java.lang.AbstractStringBuilder.delete (AbstractStringBuilder.java:702)
at java.lang.StringBuffer.delete (StringBuffer.java:373)
at jline.ConsoleReader.backspace (ConsoleReader.java:1200)
at jline.ConsoleReader.setBuffer (ConsoleReader.java:968)
at jline.ConsoleReader.readLine (ConsoleReader.java:558)
at jline.ConsoleReader.readLine (ConsoleReader.java:416)
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:597)
at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke (ReflectionMetaMethod.java:64)
at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke (MetaClassHelper.java:537)
at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:772)
at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:614)
at org.codehaus.groovy.runtime.Invoker.invokePojoMethod (Invoker.java:87)
at org.codehaus.groovy.runtime.Invoker.invokeMethod (Invoker.java:75)
at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod (InvokerHelper.java:74)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN (ScriptBytecodeAdapter.java:158)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.readLine (InteractiveShellRunner.groovy:86)
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:597)
at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke (ReflectionMetaMethod.java:64)
at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke (MetaClassHelper.java:537)
at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:772)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN (ScriptBytecodeAdapter.java:66)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrent0 (ScriptBytecodeAdapter.java:99)
at org.codehaus.groovy.tools.shell.ShellRunner.work (ShellRunner.groovy:75)
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:597)
at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke (ReflectionMetaMethod.java:64)
at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke (MetaClassHelper.java:537)
at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:772)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN (ScriptBytecodeAdapter.java:66)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrent0 (ScriptBytecodeAdapter.java:99)
at org.codehaus.groovy.tools.shell.ShellRunner.run (ShellRunner.groovy:57)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run (InteractiveShellRunner.groovy)
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:597)
at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke (ReflectionMetaMethod.java:64)
at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke (MetaClassHelper.java:537)
at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:772)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN (ScriptBytecodeAdapter.java:118)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0 (ScriptBytecodeAdapter.java:142)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run (InteractiveShellRunner.groovy:64)
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:597)
at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke (ReflectionMetaMethod.java:64)
at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke (MetaClassHelper.java:537)
at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:772)
at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:614)
at org.codehaus.groovy.runtime.Invoker.invokePogoMethod (Invoker.java:98)
at org.codehaus.groovy.runtime.Invoker.invokeMethod (Invoker.java:79)
at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod (InvokerHelper.java:74)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN (ScriptBytecodeAdapter.java:158)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0 (ScriptBytecodeAdapter.java:201)
at org.codehaus.groovy.tools.shell.Groovysh.run (Groovysh.groovy:446)
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:597)
at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke (ReflectionMetaMethod.java:64)
at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke (MetaClassHelper.java:537)
at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:772)
at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:614)
at org.codehaus.groovy.runtime.Invoker.invokePogoMethod (Invoker.java:98)
at org.codehaus.groovy.runtime.Invoker.invokeMethod (Invoker.java:79)
at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod (InvokerHelper.java:74)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN (ScriptBytecodeAdapter.java:158)
at org.codehaus.groovy.tools.shell.Groovysh.main (Groovysh.groovy:591)
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:597)
at org.codehaus.groovy.tools.GroovyStarter.rootLoader (GroovyStarter.java:101)
at org.codehaus.groovy.tools.GroovyStarter.main (GroovyStarter.java:130)
groovy0):000> exit
Bye!

Activity

Hide
Jason Dillon added a comment -

Do you have any examples which tend to cause this to happen? And this is on windows na?

Show
Jason Dillon added a comment - Do you have any examples which tend to cause this to happen? And this is on windows na?
Hide
Guillaume Laforge added a comment -

I'm on Windows XP.
And I don't always get this error.
I can't seem to reproduce this bug each time
But I'll keep trying till I find a good use case producing this.

Show
Guillaume Laforge added a comment - I'm on Windows XP. And I don't always get this error. I can't seem to reproduce this bug each time But I'll keep trying till I find a good use case producing this.
Hide
Jason Dillon added a comment -

Okay, if you get something that pukes most of the time I can probably fix it... but its gonna be hard to track down if its so random.

Show
Jason Dillon added a comment - Okay, if you get something that pukes most of the time I can probably fix it... but its gonna be hard to track down if its so random.
Hide
Jason Dillon added a comment -

How often would you say this happens? I can add a hack to catch that StringIndexOutOfBoundsException as a short-term work-around if this is painful for you. Lemme know.

Show
Jason Dillon added a comment - How often would you say this happens? I can add a hack to catch that StringIndexOutOfBoundsException as a short-term work-around if this is painful for you. Lemme know.
Hide
Guillaume Laforge added a comment -

It happens, say, once out of ten, or something like that.

Show
Guillaume Laforge added a comment - It happens, say, once out of ten, or something like that.
Hide
Jason Dillon added a comment -

Okay, hack added... lemme know how it helps... if it does at all.

Show
Jason Dillon added a comment - Okay, hack added... lemme know how it helps... if it does at all.
Hide
Guillaume Laforge added a comment -

I have played even more with the new shell but don't encounter that error anymore since the hack.
Thanks Jason.

Show
Guillaume Laforge added a comment - I have played even more with the new shell but don't encounter that error anymore since the hack. Thanks Jason.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: