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

native stack overflow causes crash on Solaris

XMLWordPrintable

    • sparc
    • solaris_7



      Name: dkC59003 Date: 10/28/99


      The regression test (testbase_nsk) nsk/regression/b4278848 crashes
      HotSpot 1.3fcs-M (Solaris) VM with Segmentation Fault.

      See logs and source below.
      Comments in source code indicate the line that causes the crash.

      % java -version
      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-L)
      Java HotSpot (TM) Client VM (build 1.3-M, interpreted mode)

      %java b4278848
      Segmentation Fault

      ------------------------------ source text of test: .java -----------------------
      import java.lang.reflect.*;

      public class b4278848 implements Runnable {

          static int v_depth = 0;
          static Method v_method;
          static Thread v_thread;
          static int v_test_result;

          public static void test(Method p_method) throws Throwable {
              ++v_depth;

      // this line instead of the next line => HotSparc (build 1.3-M) works perfectly
      // System.out.println("Test at depth " + v_depth);

      // this line instead of the preceding line => HotSparc (build 1.3-M) : Segmentation Fault
              System.out.print("Test at depth " + v_depth+"\r");

              Object[] args = {p_method};
              try
              {
                  p_method.invoke(null, args);
              }
              catch (InvocationTargetException e)
              {
                  throw e.getTargetException();
              }
          }

          public void run() {
              try {
                  Class c = b4278848.class;
                  Class[] sig = {Method.class};
                  v_method = c.getMethod("test", sig);
                  test(v_method);
              }
              catch (Throwable e)
              {
                  if (e instanceof StackOverflowError) {
                       v_test_result=0/*STATUS_PASSED*/;
                  }
              }
          }

          public static int run(String argv[], java.io.PrintStream out) {
              v_test_result=2/*STATUS_FAILED*/;
              v_thread=new Thread(new b4278848());
              v_thread.start();
              try {
                  v_thread.join();
              }
              catch (InterruptedException e) {
              }
              return v_test_result;
          }
          public static void main(String argv[]) {
              System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);
          }
      } // end of class b4278848
      -------------------------------end of text of test -----------------------

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

            jcoomes John Coomes (Inactive)
            dkhukhrosunw Dmitry Khukhro (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: