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

Solaris/x86 JIT produces core dump rather than StackOverflowError

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 1.2.2
    • Fix Version/s: None
    • Component/s: vm-legacy
    • Labels:
    • Subcomponent:
      jit
    • CPU:
      x86
    • OS:
      solaris_2.6

      Description



      Name: mc57594 Date: 12/16/99


      The following test case shows the Solaris/x86 JDK 1.2.2 getting
      a core dump, rather than the proper StackOverflowException, when the
      JIT is on.

      The problem is in source file src/share/native/java/io/io_util.c.
      Local arrays of BUF_SIZE are allocated in readBytes() and writeBytes().
      BUF_SIZE is currently set to 8192. But the JIT's stack overflow
      test relies upon no stack frame extending the stack for more than 4096
      bytes past its current point (see the "RedZoneSlop" amount and related
      comments and logic).

      We believe the best solution is to reduce BUF_SIZE to 3072. We don't
      think that will degrade I/O performance in any material way, but are
      interested in hearing if Sun thinks otherwise.


      $ uname -a
      SunOS king 5.6 Generic_105182-03 i86pc i386 i86pc

      $ $j122b/bin/java -version
      java version "1.2.2"
      Classic VM (build JDK-1.2.2-001, green threads, sunwjit)

      $ cat stack.java
      class S extends Thread {
              public int count;
              public long recurse() {
                      long l0 = 0;
                      long l1 = 1;
                      long l2 = 2;
                      long l3 = 3;
                      long l4 = 4;
                      long l5 = 5;
                      long l6 = 6;
                      long l7 = 7;
                      long l8 = 8;
                      long l9 = 9;
                      count++;
                      System.out.println("in recurse count " + count);
                      return l0 + l1 + l2 + l3 + l4 + l5 + l6 + l7 + l8 +l9 + recurse();
              }
              public void run() {
                      System.out.println("Running in thread " + this);
                      recurse();
                      System.out.println("Finishing in thread " + this);
              }
      }

      public class stack {
              public static void main(String[] args) {
                      new S().start();
              }
      }

      $ $j122b/bin/java stack
      Running in thread Thread[Thread-0,5,main]
      in recurse count 1
      in recurse count 2
      in recurse count 3
      [...]
      in recurse count 920
      in recurse count 921
      Segmentation Fault(coredump)
      (Review ID: 98935)
      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mchamnessunw Mark Chamness (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: