JDK-6420491 : JCK-Runtime-14a SecureRandom tests fail only on sun4u with -d64 -Xcomp configuration.
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 1.4.2_12
  • Priority: P1
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_nevada,solaris_10
  • CPU: sparc
  • Submitted: 2006-05-02
  • Updated: 2010-04-03
  • Resolved: 2006-05-05
Related Reports
Duplicate :  
Description
Configuration:	JCK-Runtime-14a - MultiJVM Mode.
JAVA:	java version "1.4.2_12"
	Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_12-b02)
	Java HotSpot(TM) 64-Bit Server VM (build 1.4.2_12-b02, compiled mode)
OS:	Sparc 10 u1 b19a [ latest Java recommended patches]
Config:	-d64 -Xcomp	

The following api/java_security tests fail with the above configuration only.

/api/java_security/SecureRandom/SecureRandom101
/api/java_security/SecureRandom/getSeed101
/api/java_security/SecureRandom/nextBytes101
/api/java_security/SecureRandom/setSeed101
/api/java_security/SecureRandom/setSeed201

All fail with following message:

SecureRandom101: Failed. - maybe accidentally, with probability 1%
STATUS:Failed.test cases: 1; all failed; first test case failure: SecureRandom101

See attached .jtr for one of the tests for full details.
See also attached SecureRandom.sh for reproducing the first test case failure.
Need only to change JDK and JCK environment variables in the script.

Further analysis is as follows across different platforms.

JDK		OS		Config		RESULT
-----------------------------------------------------------------
1.4.2_12b2	Sparc 10u1b19a	-d64 -Xcomp	5 SecureRandom Tests fail.
1.4.2_12b2	Sparc 10u1b19a	 -Xcomp		All Pass.
1.4.2_12b2	Sparc 10u1b19a	 -d64		All Pass.

HENCE RELATED to combination of -d64 -Xcomp configuration only.

1.4.2_12b2	AMD64 10u1b19a	-d64 -Xcomp	All Pass.
1.4.2_12b2	XP Home		-d64 -Xcomp	All Pass.
1.4.2_12b2	Sparc 9		-d64 -Xcomp	All Pass.
1.4.2_12b2	sun4v 10u1b19a	-d64 -Xcomp	All Pass.

HENCE RELATED to sun4u only and Solaris 10.

These tests are also failing with -64 -Xcomp configuration on Sparc 10 u1 b19a for the following JDK releases -
1.4.2_12b1
1.4.2_11b6
1.4.2_11b5
1.4.2_11b4
1.4.2_11b3
1.4.2_11b2
1.4.2_11b1
1.4.2_10b3 - As far back as I checked. So this is something which is not just related and introduced in 1.4.2_12.

However, when I run the tests on the previous Solaris 10 FCS build which was -  
s10_74L2a SPARC with j2sdk1.4.2_12b2 -d64 -Xcomp the tests pass.
Hence again only related to Solaris 10 u1 b19a.

The last time this configuration was tested in QA ie: -d64 -Xcomp was for 1.4.2_10b3 at which time we were running the older FCS release of Solaris - s10_74L2a, and tests pass.

I cannot determine from my analysis which java version this was introduced in, as you can see this is a somewhat an exceptional circumstance.
We have tests which are conforming to sun4v Sol10u1b19a with -d64 -Xcomp config. and which are not conforming to sun4u.

Comments
EVALUATION Interesting ... $ cat /etc/rel* Solaris 10 1/06 s10s_u1wos_19a SPARC Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms. Assembled 07 December 2005 $ uname -a SunOS hiltonlv 5.10 Generic_118822-30 sun4u sparc SUNW,Ultra-60 ** Shows javasoft.sqe.tests.api.java.security.SecureRandom.SecureRandom101Tests with 142_12 b02 -d64 -Xcomp passed java version "1.4.2_12" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_12-b02) Java HotSpot(TM) 64-Bit Server VM (build 1.4.2_12-b02, compiled mode) SecureRandom101: Passed. While $ uname -a SunOS shimmer 5.10 Generic_118822-25 sun4u sparc SUNW,Sun-Fire-V240 $ cat /etc/rel* Solaris 10 1/06 s10s_u1wos_19a SPARC Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms. Assembled 07 December 2005 shows failure with 142_12 b02 -d64 -Xcomp. Not only that, tested with _11 fcs, _10, _08 and 142FCS and it's always failed. NOT a regression at all into _12.
05-05-2006

EVALUATION This appears to be a duplicate of 4971887.
04-05-2006

EVALUATION All these failed tests relies on tests/api/java_security/SecureRandom/ChiSquareTest.java for evaluating how random the generated numbers are. In ChiSquareTest.java, it performs some mixed-type and floating point calculation in order to decide how random the generated numbers are. When "-d64 -Xcomp" is used, the calculation in ChiSquareTest leads to abnormal value (e.g. chisq=1.5718867442832059E32) for various 1.4.2 and 1.4.1 releases. With the following one line change (in ChiSquareTest.java): Replace: long[] ccount = new long[256]; with: int[] ccount=new int[256]; the calculation of chisq seems to produce values within the normal range, e.g. two hundreds to four hundreds. At this point, it doesn't seem to be SecureRandom related, so I am re-assigning this to hotspot/compiler2.
04-05-2006