Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8189804

Jshell crashes when tab complete

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      FULL PRODUCT VERSION :
      java version "9.0.1"
      Java(TM) SE Runtime Environment (build 9.0.1+11)
      Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Darwin Lingchaos-iMac 17.0.0 Darwin Kernel Version 17.0.0: Thu Aug 24 21:48:19 PDT 2017; root:xnu-4570.1.46~2/RELEASE_X86_64 x86_64

      A DESCRIPTION OF THE PROBLEM :
      Jshell crashes when I use `TAB` to complete something in it.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      I can always reproduce this bug by these steps:

      $ jshell -v --add-modules jdk.incubator.httpclient

      jshell> import jdk.incubator.http.*;

      jshell> HttpRequest.newBuilder().uri(new URI( // here type `TAB` twice

      then jshell crashes with the traceback:

      jshell> HttpRequest.newBuilder().uri(new URI(Exception in thread "main" java.lang.StringIndexOutOfBoundsException: index 1230,length 1230
      at java.base/java.lang.String.checkIndex(String.java:3075)
      at java.base/java.lang.AbstractStringBuilder.charAt(AbstractStringBuilder.java:281)
      at java.base/java.lang.StringBuilder.charAt(StringBuilder.java:77)
      at jdk.compiler/jdk.internal.shellsupport.doc.JavadocFormatter.reflow(JavadocFormatter.java:590)
      at jdk.compiler/jdk.internal.shellsupport.doc.JavadocFormatter.access$200(JavadocFormatter.java:70)
      at jdk.compiler/jdk.internal.shellsupport.doc.JavadocFormatter$FormatJavadocScanner.reflowTillNow(JavadocFormatter.java:561)
      at jdk.compiler/jdk.internal.shellsupport.doc.JavadocFormatter$FormatJavadocScanner.visitStartElement(JavadocFormatter.java:256)
      at jdk.compiler/com.sun.tools.javac.tree.DCTree$DCStartElement.accept(DCTree.java:810)
      at jdk.compiler/com.sun.source.util.DocTreeScanner.scan(DocTreeScanner.java:79)
      at jdk.compiler/jdk.internal.shellsupport.doc.JavadocFormatter$FormatJavadocScanner.scan(JavadocFormatter.java:549)
      at jdk.compiler/com.sun.source.util.DocTreeScanner.scanAndReduce(DocTreeScanner.java:83)
      at jdk.compiler/com.sun.source.util.DocTreeScanner.scan(DocTreeScanner.java:98)
      at jdk.compiler/jdk.internal.shellsupport.doc.JavadocFormatter$FormatJavadocScanner.visitDocComment(JavadocFormatter.java:147)
      at jdk.compiler/com.sun.tools.javac.tree.DCTree$DCDocComment.accept(DCTree.java:132)
      at jdk.compiler/com.sun.source.util.DocTreeScanner.scan(DocTreeScanner.java:79)
      at jdk.compiler/jdk.internal.shellsupport.doc.JavadocFormatter$FormatJavadocScanner.scan(JavadocFormatter.java:549)
      at jdk.compiler/jdk.internal.shellsupport.doc.JavadocFormatter.formatJavadoc(JavadocFormatter.java:118)
      at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$ExpressionJavadocTask.lambda$perform$0(ConsoleIOContext.java:626)
      at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
      at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1494)
      at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
      at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
      at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
      at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:511)
      at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$ExpressionJavadocTask.perform(ConsoleIOContext.java:632)
      at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.complete(ConsoleIOContext.java:287)
      at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.access$000(ConsoleIOContext.java:69)
      at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$1.complete(ConsoleIOContext.java:100)
      at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.readLine(ConsoleReader.java:2684)
      at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.readLine(ConsoleReader.java:2279)
      at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.readLine(ConsoleIOContext.java:139)
      at jdk.jshell/jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:1140)
      at jdk.jshell/jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:929)
      at jdk.jshell/jdk.internal.jshell.tool.JShellToolBuilder.run(JShellToolBuilder.java:239)
      at jdk.jshell/jdk.internal.jshell.tool.JShellToolProvider.main(JShellToolProvider.java:119)

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      jshell should not crash
      ACTUAL -
      jshell crashes

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      jshell> HttpRequest.newBuilder().uri(new URI(Exception in thread "main" java.lang.StringIndexOutOfBoundsException: index 1230,length 1230
      at java.base/java.lang.String.checkIndex(String.java:3075)
      at java.base/java.lang.AbstractStringBuilder.charAt(AbstractStringBuilder.java:281)
      at java.base/java.lang.StringBuilder.charAt(StringBuilder.java:77)
      at jdk.compiler/jdk.internal.shellsupport.doc.JavadocFormatter.reflow(JavadocFormatter.java:590)
      at jdk.compiler/jdk.internal.shellsupport.doc.JavadocFormatter.access$200(JavadocFormatter.java:70)
      at jdk.compiler/jdk.internal.shellsupport.doc.JavadocFormatter$FormatJavadocScanner.reflowTillNow(JavadocFormatter.java:561)
      at jdk.compiler/jdk.internal.shellsupport.doc.JavadocFormatter$FormatJavadocScanner.visitStartElement(JavadocFormatter.java:256)
      at jdk.compiler/com.sun.tools.javac.tree.DCTree$DCStartElement.accept(DCTree.java:810)
      at jdk.compiler/com.sun.source.util.DocTreeScanner.scan(DocTreeScanner.java:79)
      at jdk.compiler/jdk.internal.shellsupport.doc.JavadocFormatter$FormatJavadocScanner.scan(JavadocFormatter.java:549)
      at jdk.compiler/com.sun.source.util.DocTreeScanner.scanAndReduce(DocTreeScanner.java:83)
      at jdk.compiler/com.sun.source.util.DocTreeScanner.scan(DocTreeScanner.java:98)
      at jdk.compiler/jdk.internal.shellsupport.doc.JavadocFormatter$FormatJavadocScanner.visitDocComment(JavadocFormatter.java:147)
      at jdk.compiler/com.sun.tools.javac.tree.DCTree$DCDocComment.accept(DCTree.java:132)
      at jdk.compiler/com.sun.source.util.DocTreeScanner.scan(DocTreeScanner.java:79)
      at jdk.compiler/jdk.internal.shellsupport.doc.JavadocFormatter$FormatJavadocScanner.scan(JavadocFormatter.java:549)
      at jdk.compiler/jdk.internal.shellsupport.doc.JavadocFormatter.formatJavadoc(JavadocFormatter.java:118)
      at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$ExpressionJavadocTask.lambda$perform$0(ConsoleIOContext.java:626)
      at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
      at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1494)
      at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
      at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
      at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
      at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:511)
      at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$ExpressionJavadocTask.perform(ConsoleIOContext.java:632)
      at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.complete(ConsoleIOContext.java:287)
      at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.access$000(ConsoleIOContext.java:69)
      at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$1.complete(ConsoleIOContext.java:100)
      at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.readLine(ConsoleReader.java:2684)
      at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.readLine(ConsoleReader.java:2279)
      at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.readLine(ConsoleIOContext.java:139)
      at jdk.jshell/jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:1140)
      at jdk.jshell/jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:929)
      at jdk.jshell/jdk.internal.jshell.tool.JShellToolBuilder.run(JShellToolBuilder.java:239)
      at jdk.jshell/jdk.internal.jshell.tool.JShellToolProvider.main(JShellToolProvider.java:119)

      REPRODUCIBILITY :
      This bug can be reproduced always.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fmatte Fairoz Matte
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: