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

wrong error thrown on inability to create an activation frame

XMLWordPrintable

    • sparc
    • solaris_2.4



      Name: swC45995 Date: 12/04/96


      The following assertion do not holds:

      If there is not sufficient memory available to create such an activation frame, an <code>OutOfMemoryError</code> is thrown. (#15.11.4.5 Create Frame,
      Synchronize, Transfer Control)

      Thus, execution of the following test

      public class test
      {
      static void doSomething(long l)
      {
      if (l > 0)
      doSomething(++l);
      }

      public static void main(String argv[])
      {
      try {
      doSomething(1L);
      } catch (OutOfMemoryError e) {
      System.out.println("OutOfMemoryError");
      return;
      } catch (StackOverflowError e) {
      System.out.println("StackOverflowError");
      return;
      }
      System.out.println("fail");
      }
      }

      produces such output:

      novo40% java test
      StackOverflowError


      instead of expected:

      novo40% java test
      OutOfMemoryError
      ======================================================================

            tlindholsunw Timothy Lindholm (Inactive)
            wensunw Wen Wen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: