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

There is a safepoint synchronization problem with inlined natives

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0u17
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: