JDK-6592429 : There is a safepoint synchronization problem with inlined natives
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2007-08-13
  • Updated: 2010-04-04
  • Resolved: 2009-08-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0u17Resolved
Related Reports
Duplicate :  
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.

Comments
EVALUATION Fixed in 5.0u17 b03!
13-08-2009