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.