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

Missing stack trace for StackOverflowError with client VM (or hotspot in 1.3.1.)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • hotspot
    • x86
    • windows_2000



      Name: gm110360 Date: 03/28/2002


      FULL PRODUCT VERSION :
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

        Bug also seen in:

      java version "1.3.1_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
      Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)

      FULL OPERATING SYSTEM VERSION :

      Microsoft Windows 2000 [Version 5.00.2195]

      ADDITIONAL OPERATING SYSTEMS :

      Cygwin B20

      A DESCRIPTION OF THE PROBLEM :
      An infinite loop of method calls causes termination
      of client VM without java.lang.StackOverflowError stack
      trace being shown, or only with a part of the stack trace
      shown. This makes it very hard to debug.
      The same behavior is found for hotspot VM in 1.3.1.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Use the following Test.java

      2. Compile with /j2sdk1.4.0/bin/javac Test.java

      3. Run with /j2sdk1.4.0/bin/java -client -classpath c:Test

      4. You see a series of printouts:
      Test.main()
      count = 1
      count = 2
      count = 3
      ...
      count = 4570
      count = 4571
      count = 4572

      5. The VM terminates with no error thrown.







      EXPECTED VERSUS ACTUAL BEHAVIOR :
      You should see first a series of printout messages
      and then a java.lang.StackOverflowError thrown followed
      by VM termination.

      Instead you see the series of printouts which
      goes to "count = 4572". The VM terminates without
      any error reported. This happens in 1.4 with
      client VM and in 1.3.1 with hotspot VM.

      If you comment out the print command
          System.out.println("count = " + (++count));
      and repeat the process, you will see a truncated
      stack trace of java.lang.StackOverflowError.
      (This is similar to reported bug 4222717).

      It seems like the client VM (or hotspot VM in 1.3.1)
      does not leave enough memory to print the stack trace
      of the StackOverflowError.

      The behavior where the VM terminates without any error
      makes it very hard to debug.










      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class Test {


          private static int count = 0;


          public static void doThis() {
              System.out.println("count = " + (++count));
              Test.doThis();
          }


          public static void main(String[] args) {
      System.out.println("Test.main()");
              Test.doThis();
          }
      }

      ---------- END SOURCE ----------

      CUSTOMER WORKAROUND :
      The system behaves correctly in 1.3.1. and 1.3.0.with the
      classic VM. You first see a list of printouts and
      then a *complete* stack trace of
      java.lang.StackOverflowError.

      Also in 1.3.0. you get the following message before
      termination with hotspot VM:

      #
      # An EXCEPTION_STACK_OVERFLOW exception has been detected
      in native code outside the VM.
      # Program counter=0x77f822a0
      #
      (Review ID: 144741)
      ======================================================================

      Name: agR10195 Date: 09/01/2002



      Alexey Gibadullin, ###@###.###

      A testcase has been added into testbase_nsk (since release 16) to verify
      this bug and to execute it regularly. The test name is:

          nsk/regression/b4659732

      The current location of the testbase is
          
          /net/sqesvr.sfbay/export/vsn/VM/testbase/testbase_nsk


      ======================================================================

            kbr Kenneth Russell (Inactive)
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: