javac crashes when no. of nesting blocks exceeds internal threshold.

XMLWordPrintable

    • hopper
    • generic, x86, sparc
    • generic, solaris_9, windows_98
    • Verified

      This bug is found in a stress-test case for Javac. It is not a MUST-FIX for merlin.

      For the following build
      =======================

      jtools-sqe:/home/vr128054/vertest/4496625 69 % javac -J-version
      java version "1.4.0-beta3"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b81)
      Java HotSpot(TM) Client VM (build 1.4.0-beta3-b81, mixed mode)

      Please use the following class to generate the testcase
      ========================================================

      jtools-sqe:/home/vr128054/vertest/4496625 70 % more gen.java
      public class gen
      {
              public static void main (String args[])
              {
                      int lCtr;

                      System.out.println ("public class test");
                      System.out.println ("{");

                      for (lCtr = 0; lCtr < 1024; lCtr ++)
                      {
                              System.out.println ("{");
                      }

                      for (lCtr = 0; lCtr < 1024; lCtr ++)
                      {
                              System.out.println ("}");
                      }

                      System.out.println ("}");
              }
      }

      Do the following...
      ===================

      jtools-sqe:/home/vr128054/vertest/4496625 71 % javac gen.java
      jtools-sqe:/home/vr128054/vertest/4496625 72 % java gen > test.java

      Now, when attempting to compiler test.java, javac crashes.
      ==========================================================

      jtools-sqe:/home/vr128054/vertest/4496625 73 % javac test.java
      An exception has occurred in the compiler (1.4.0-beta3). Please file a bug at the Java Developer Connection (http://java.sun.com/cgi-bin/bugreport.cgi) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
      java.lang.StackOverflowError
              at com.sun.tools.javac.v8.parser.Scanner.nextToken(Scanner.java:1022)
              at com.sun.tools.javac.v8.parser.Parser.accept(Parser.java:212)
              at com.sun.tools.javac.v8.parser.Parser.block(Parser.java:1203)
              at com.sun.tools.javac.v8.parser.Parser.block(Parser.java:1216)
              at com.sun.tools.javac.v8.parser.Parser.statement(Parser.java:1356)
              at com.sun.tools.javac.v8.parser.Parser.blockStatements(Parser.java:1272)
              at com.sun.tools.javac.v8.parser.Parser.block(Parser.java:1204)
              at com.sun.tools.javac.v8.parser.Parser.block(Parser.java:1216)
              at com.sun.tools.javac.v8.parser.Parser.statement(Parser.java:1356)
              at com.sun.tools.javac.v8.parser.Parser.blockStatements(Parser.java:1272)
              at com.sun.tools.javac.v8.parser.Parser.block(Parser.java:1204)
              at com.sun.tools.javac.v8.parser.Parser.block(Parser.java:1216)
              at com.sun.tools.javac.v8.parser.Parser.statement(Parser.java:1356)
              at com.sun.tools.javac.v8.parser.Parser.blockStatements(Parser.java:1272)
              at com.sun.tools.javac.v8.parser.Parser.block(Parser.java:1204)
              at com.sun.tools.javac.v8.parser.Parser.block(Parser.java:1216)
              at com.sun.tools.javac.v8.parser.Parser.statement(Parser.java:1356)
              at com.sun.tools.javac.v8.parser.Parser.blockStatements(Parser.java:1272)
              at com.sun.tools.javac.v8.parser.Parser.block(Parser.java:1204)
              at com.sun.tools.javac.v8.parser.Parser.block(Parser.java:1216)
              at com.sun.tools.javac.v8.parser.Parser.statement(Parser.java:1356)
              at com.sun.tools.javac.v8.parser.Parser.blockStatements(Parser.java:1272)
      .
      .
      .
      .
      .
      .
      .

      crash too big to attach here.

      This is a corner case and an internal threshold -crossing need not make the tool crash. Perhaps an exception handler reporting this issue would be good, with some graceful exiting. Can consider fix for Tiger.


            Assignee:
            Neal Gafter (Inactive)
            Reporter:
            Ra Vijayan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: