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

jshell infinite loops when startup script contains System.exit call

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 17
    • 15
    • tools
    • None
    • b15
    • generic
    • generic

    Description

      File: t.repl

      System.out.println("hello");
      System.exit(0);


      $ jshell --version
      jshell 15

      $ jshell --startup t.repl


      | State engine terminated.
      java.io.EOFException
      at java.base/java.io.DataInputStream.readInt(DataInputStream.java:396)
      at java.base/java.io.ObjectInputStream$BlockDataInputStream.readInt(ObjectInputStream.java:3423)
      at java.base/java.io.ObjectInputStream.readInt(ObjectInputStream.java:1125)
      at jdk.jshell/jdk.jshell.execution.StreamingExecutionControl.readAndReportExecutionResult(StreamingExecutionControl.java:277)
      at jdk.jshell/jdk.jshell.execution.StreamingExecutionControl.invoke(StreamingExecutionControl.java:99)
      at jdk.jshell/jdk.jshell.execution.JdiDefaultExecutionControl.invoke(JdiDefaultExecutionControl.java:160)
      at jdk.jshell/jdk.jshell.Eval.declare(Eval.java:885)
      at jdk.jshell/jdk.jshell.Eval.eval(Eval.java:140)
      at jdk.jshell/jdk.jshell.JShell.eval(JShell.java:493)
      at jdk.jshell/jdk.internal.jshell.tool.JShellTool.processSource(JShellTool.java:3600)
      at jdk.jshell/jdk.internal.jshell.tool.JShellTool.processSourceCatchingReset(JShellTool.java:1321)
      at jdk.jshell/jdk.internal.jshell.tool.JShellTool.processInput(JShellTool.java:1219)
      at jdk.jshell/jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:1192)
      at jdk.jshell/jdk.internal.jshell.tool.JShellTool.startUpRun(JShellTool.java:1159)
      at jdk.jshell/jdk.internal.jshell.tool.JShellTool.resetState(JShellTool.java:1115)
      at jdk.jshell/jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:989)
      at jdk.jshell/jdk.internal.jshell.tool.JShellToolBuilder.start(JShellToolBuilder.java:254)
      at jdk.jshell/jdk.internal.jshell.tool.JShellToolProvider.main(JShellToolProvider.java:120)
      hello
      [... goes on forever....]

      Attachments

        Issue Links

          Activity

            People

              jlahoda Jan Lahoda
              sundar Sundararajan Athijegannathan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: