Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2137884 | 1.4.2_12 | Abhijit Saha | P3 | Closed | Fixed | b03 |
Name: tb29552 Date: 12/22/2003
FULL PRODUCT VERSION :
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)
FULL OS VERSION :
SunOS ussunx4 5.8 Generic_108528-10 sun4u sparc SUNW,Sun-Blade-1000
EXTRA RELEVANT SYSTEM CONFIGURATION :
Program is actually running as part of the J2EE application on the JBoss 3.2 server.
A DESCRIPTION OF THE PROBLEM :
The attached program does not add up integers correctly when using the Hotspot server compiler.
This bug may be related to 4843257. However, 4843257 was closed int Apr 2003, and this bug still occurs on Solaris.
I was unable to reproduce the bug on Windows.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile attached program: "javac Bug.java"
Run program: "java -server -Xcomp Bug"
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
total=1118.0
ACTUAL -
total=-1.8014390618947024E16
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class Bug
{
public static double calcTotal ( long[] counts )
{
double total = 0;
for ( int i=0; i < counts.length; i++ )
{
total += counts[i];
}
return ( total );
}
public static void main ( String[] args )
{
long[] counts = new long[] {
113,64,23,56,98,48,33,101,8,14,27,58,17,6,
121,18,3,3,24,13,58,14,23,14,4,123,29,5 };
double total = Bug.calcTotal( counts );
System.out.println( "total=" + total );
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
The program work CORRECTLY if I disable loop unrolling:
java -server -Xcomp -XX:LoopUnrollLimit=0 Bug
It also works CORRECTLY if I I disable the Hotspot server compiler:
java -Xcomp Bug
Unfortunately this has a negetice effect on overall system performance.
(Review ID: 231819)
======================================================================
FULL PRODUCT VERSION :
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)
FULL OS VERSION :
SunOS ussunx4 5.8 Generic_108528-10 sun4u sparc SUNW,Sun-Blade-1000
EXTRA RELEVANT SYSTEM CONFIGURATION :
Program is actually running as part of the J2EE application on the JBoss 3.2 server.
A DESCRIPTION OF THE PROBLEM :
The attached program does not add up integers correctly when using the Hotspot server compiler.
This bug may be related to 4843257. However, 4843257 was closed int Apr 2003, and this bug still occurs on Solaris.
I was unable to reproduce the bug on Windows.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile attached program: "javac Bug.java"
Run program: "java -server -Xcomp Bug"
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
total=1118.0
ACTUAL -
total=-1.8014390618947024E16
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class Bug
{
public static double calcTotal ( long[] counts )
{
double total = 0;
for ( int i=0; i < counts.length; i++ )
{
total += counts[i];
}
return ( total );
}
public static void main ( String[] args )
{
long[] counts = new long[] {
113,64,23,56,98,48,33,101,8,14,27,58,17,6,
121,18,3,3,24,13,58,14,23,14,4,123,29,5 };
double total = Bug.calcTotal( counts );
System.out.println( "total=" + total );
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
The program work CORRECTLY if I disable loop unrolling:
java -server -Xcomp -XX:LoopUnrollLimit=0 Bug
It also works CORRECTLY if I I disable the Hotspot server compiler:
java -Xcomp Bug
Unfortunately this has a negetice effect on overall system performance.
(Review ID: 231819)
======================================================================
- backported by
-
JDK-2137884 Incorrect floating-point arithmetic or loop unrolling with -server -Xcomp option
-
- Closed
-
- duplicates
-
JDK-6420491 JCK-Runtime-14a SecureRandom tests fail only on sun4u with -d64 -Xcomp configuration.
-
- Closed
-
- relates to
-
JDK-4971850 fpl03602m3 fails on Ultra III
-
- Resolved
-