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

[solaris i386] Compiler Safepoints do not work on multiprocessor systems

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.3.0
    • 1.3.0
    • hotspot
    • None
    • sol-beta2
    • generic
    • solaris_8

      This is a copy of 4317961 which was for SPARC (which is now fixed.)

      Problem occurs when thr_getstate returns a flag value of TRS_NONVOLATILE
      in fetch_top_frame_fast. The i386 code for fetch_top_frame_fast returns
      a null pc/sp, restarts the thread, and tries to suppend again. Unfortunately,
      the thread with the infinite loop is always in a state in which TRS_NONVOLATILE
      is returned, so GC never runs.

      Compiler safepoints do not work.

      Run the appended program with following commandline
      and it will hang with both compilers
      java -Xcomp -verbose:gc sf

      Run it with following commandline and it terminates properly:
      java -Xint -verbose:gc sf

      The program hangs if the method loop is compiled because
      the runtime cannot properly suspend the endless loop.
      I have verified that both Compiler 1 and Compiler 2 (server) are
      emitting safepoint information.



      ----------------
      public class sf {
              static public boolean _xx = true;

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

      public void start() {
      new TesterThread().start();
      new GCThread().start();
      }

      class TesterThread extends Thread {

                      // trick compiler 2 in believing that this is not and endless loop
                      public void loop (int n) {
      long counter = 0;
      while (_xx) {
      if (n == 0) {
                                        _xx = false;
                                      }
      }
                      }
      public void run () {
      System.out.println("Start loop");
                              loop(3);
      }
      }

      class GCThread extends Thread {
      public void run () {
      System.out.println("Starting GC loop");
      long counter = 0;
      while (true) {
      try { sleep(250); } catch (InterruptedException ix) {}
      System.gc();
                                      counter++;
                                      if (counter == 10) {
                                        _xx = false;
                                        return;
                                      }
      }
      }
      }
      }

            sgoldman Steve Goldman (Inactive)
            rknippelsunw Ross Knippel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: