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

StackOverflowError in a native method causes Segmentation Fault

XMLWordPrintable

    • jit
    • sparc
    • solaris_2.5.1



      Name: szC45993 Date: 04/22/99



      Stack overflow occurred in println() crashes VM (jdk1.2.2O/solaris with JIT on).
      The same bug occurs in all JDK versions (jdk1.2beta4K, jdk1.2fcs, jdk1.2.1,
      jdk1.2.2, jdk1.3A) where JIT is turned on by default.

      novo7% cat resourcearea001.java
      public class resourcearea001 {

          public static int ist(int iprm) {
      System.out.println("#ist#");
      return iprm + ist(-iprm);
          }

          public static void main(String argv[]) {
      try{
      int iii = ist(7);
      } catch (StackOverflowError e) {
      System.out.println("StackOverflowError");
      }
          }
      }
      novo7% jdk1.2.2O/solaris/bin/javac resourcearea001.java
      novo7% jdk1.2.2O/solaris/bin/java resourcearea001
      ...
      #ist#
      #ist#
      #ist#
      #ist#
      #ist#
      #ist#
      Segmentation Fault (core dumped)
      novo7%

      jdk1.2.2O java (and others mentioned above) works fine if println() is
      removed or if JIT is turned off:

      novo7% cat resourcearea001.java
      public class resourcearea001 {

          public static int ist(int iprm) {
      // System.out.println("#ist#");
      return iprm + ist(-iprm);
          }

          public static void main(String argv[]) {
      try{
      int iii = ist(7);
      } catch (StackOverflowError e) {
      System.out.println("StackOverflowError");
      }
          }
      }
      novo7% jdk1.2.2O/solaris/bin/javac resourcearea001.java
      novo7% jdk1.2.2O/solaris/bin/java resourcearea001
      StackOverflowError
      novo7%

      Hook 5(hook5): test

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

            Unassigned Unassigned
            zsssunw Zss Zss (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: