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

There is a safepoint synchronization problem with inlined natives

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4
    • 5.0u17
    • 5.0
    • hotspot
    • x86
    • linux

    Description

      FULL PRODUCT VERSION :
      1.5.0_12

      FULL OS VERSION :
      Linux RHEL 4

      A DESCRIPTION OF THE PROBLEM :
      If you run the attached code on 5u12 using the server compiler then it hangs.

      The problem appears to be that the inlined call to os::javaTimeMillis() doesn't test for a safepoint condition.

      THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: No

      THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile the code and run with the -server VM option.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      It should run OK. Instead the jvm hangs (won't respond to CTRL+C or CTRL+\)
      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class SafepointFailure extends Thread {
              public void run() {
                      while (System.currentTimeMillis() != 1);
              }

              public static void main(String[] args) throws Exception {
                      new SafepointFailure().start();
                      while (true) {
                              String foo = new String("foo");
                      }
              }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Run with client compiler or disable compilation of the run method.

      Attachments

        Issue Links

          Activity

            People

              cfang Changpeng Fang (Inactive)
              ryeung Roger Yeung (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: