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

println() crashes VM after StackOverflowError

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      x86, sparc
    • OS:
      solaris, solaris_8, windows_2000

      Description



      Name: agR10195 Date: 03/04/2002



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

      The following test reveals that println() crashes VM when
      StackOverflowError is reached.

      public class Test {
          private static int i = 0;

          public static void main(String argv[]) {
              recurse();
          }

          public static void recurse() {
              try {
                  i++;
                  recurse();
              } catch (StackOverflowError e) {
                  System.out.println("StackOverflowError: " + i);
                  return;
              } catch (OutOfMemoryError e) {
                  System.out.println("OutOfMemoryError: " + i);
                  return;
              }
          }
      }

      The crash was observed against the latest Merlin-b92 Server java_g with
      default mode on Solx86 and 64-bit Solsparc only. The test passes in all
      other modes on all platforms.

      However, now the test crashes Hopper-b03 in the following modes.

      Solx86: java, Client, -Xmixed
                       java, Client, -Xint
                       java_g, Client, -Xmixed
                       java, Server, -Xmixed
                       java, Server, -Xint
                       java_g, Server, -Xmixed
              
      64-bit Solsparc: java_g, Server, -Xmixed

      Win: java, Client, -Xmixed
                       java, Client, -Xcomp
                       java_g, Client, -Xmixed
                       java_g, Server, -Xmixed
                       
      % ../jdk1.4.0-b92/solx86/bin/java -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)
      % ../jdk1.4.0-b92/solx86/bin/java -Xint Test
      StackOverflowError: 5526

      % ../jdk1.4.1-b03/solx86/bin/java -version
      java version "1.4.1-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b03)
      Java HotSpot(TM) Client VM (build 1.4.1-beta-b03, mixed mode)
      % ../jdk1.4.1-b03/solx86/bin/java -Xint Test
      Segmentation Fault
      % ../jdk1.4.1-b03/solx86/bin/java -Xcomp Test
      StackOverflowError: 5976

      Also, the test passes fine without System.out.println().

      So, it looks like a bug was introduced in Hopper.

      See also bugs that have been closed:

      4254634 println() while catching StackOverflowError causes hotspot VM crash
      4231968 StackOverflowError in a native method causes Segmentation Fault

      This bug affects the following test from testbase_nsk:

          nsk/regression/b4470106
          
      Testbase_nsk testbase is located at:

          /net/sqesvr.sfbay/export/vsn/VM/testbase/testbase_nsk.v14

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

      -----------------------------------------------------------------------------
      I am getting the same problem/error on Solaris IA8,IA6 & IA9 with "Xint" mode using hopper builds. The test passed with Merlin b92 on Solaris IA8,IA6 & IA9 with "Xint" mode . Looks like this bug is introduced in Hopper.

      ###@###.### 2002-03-18
      -----------------------------------------------------------------------------

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              coleenp Coleen Phillimore
              Reporter:
              gazsunw Gaz Gaz (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: