openj9 icon indicating copy to clipboard operation
openj9 copied to clipboard

CryptoTests cryptotest/tests/SignatureTests.java timeout in java.math.BigInteger.implSquareToLen

Open pshipton opened this issue 2 years ago • 13 comments

https://openj9-jenkins.osuosl.org/job/Test_openjdk17_j9_extended.functional_x86-64_linux_Nightly_testList_0/394/ - ub16x64j96 CryptoTests_0 cryptotest/tests/SignatureTests.java

timeout, no diagnostic files.

133)	SunEC: 	SHA1withECDSA~SHA1withECDSA	 (Signature)

"MainThread" prio=5 Id=22 RUNNABLE
	at [email protected]/java.math.BigInteger.implSquareToLen(BigInteger.java:2212)
	at [email protected]/java.math.BigInteger.squareToLen(BigInteger.java:2124)
	at [email protected]/java.math.BigInteger.implMontgomerySquare(BigInteger.java:2866)
	at [email protected]/java.math.BigInteger.montgomerySquare(BigInteger.java:2823)
	at [email protected]/java.math.BigInteger.oddModPow(BigInteger.java:3093)
	at [email protected]/java.math.BigInteger.modPow(BigInteger.java:2754)
	at [email protected]/java.math.BigInteger.passesMillerRabin(BigInteger.java:1122)
	at [email protected]/java.math.BigInteger.primeToCertainty(BigInteger.java:978)
	at [email protected]/java.math.BitSieve.retrieve(BitSieve.java:203)
	at [email protected]/java.math.BigInteger.largePrime(BigInteger.java:847)
	at [email protected]/java.math.BigInteger.probablePrime(BigInteger.java:785)
	at [email protected]/sun.security.rsa.RSAKeyPairGenerator.generateKeyPair(RSAKeyPairGenerator.java:173)
	at [email protected]/java.security.KeyPairGenerator$Delegate.generateKeyPair(KeyPairGenerator.java:727)
	at [email protected]/java.security.KeyPairGenerator.genKeyPair(KeyPairGenerator.java:495)
	at app//cryptotest.utils.KeysNaiveGenerator.getRsaKeyPair(KeysNaiveGenerator.java:165)
	at app//cryptotest.utils.KeysNaiveGenerator.getRsaPrivateKey(KeysNaiveGenerator.java:169)
	at app//cryptotest.tests.SignatureTests.checkAlgorithm(SignatureTests.java:85)
	at app//cryptotest.utils.AlgorithmTest.mainLoop(AlgorithmTest.java:79)
	at app//cryptotest.tests.SignatureTests.main(SignatureTests.java:68)

pshipton avatar Feb 13 '23 14:02 pshipton

https://openj9-jenkins.osuosl.org/job/Test_openjdk17_j9_extended.functional_s390x_linux_Nightly_testList_1/415 - ub20-390-3 CryptoTests_0 cryptotest/tests/SignatureTests.java

72)	SunRsaSign: 	SHA384withRSA~OID.1.2.840.113549.1.1.12	 (Signature)

"MainThread" prio=5 Id=22 RUNNABLE
	at [email protected]/java.math.BigInteger.implSquareToLen(BigInteger.java:2202)
	at [email protected]/java.math.BigInteger.squareToLen(BigInteger.java:2124)
	at [email protected]/java.math.BigInteger.square(BigInteger.java:2093)
	at [email protected]/java.math.BigInteger.square(BigInteger.java:2076)
	at [email protected]/java.math.BigInteger.lucasLehmerSequence(BigInteger.java:1070)
	at [email protected]/java.math.BigInteger.passesLucasLehmer(BigInteger.java:998)
	at [email protected]/java.math.BigInteger.primeToCertainty(BigInteger.java:978)
	at [email protected]/java.math.BitSieve.retrieve(BitSieve.java:203)
	at [email protected]/java.math.BigInteger.largePrime(BigInteger.java:847)
	at [email protected]/java.math.BigInteger.probablePrime(BigInteger.java:785)
	at [email protected]/sun.security.rsa.RSAKeyPairGenerator.generateKeyPair(RSAKeyPairGenerator.java:187)
	at [email protected]/java.security.KeyPairGenerator$Delegate.generateKeyPair(KeyPairGenerator.java:721)
	at [email protected]/java.security.KeyPairGenerator.genKeyPair(KeyPairGenerator.java:495)
	at app//cryptotest.utils.KeysNaiveGenerator.getRsaKeyPair(KeysNaiveGenerator.java:165)
	at app//cryptotest.utils.KeysNaiveGenerator.getRsaPrivateKey(KeysNaiveGenerator.java:169)
	at app//cryptotest.tests.SignatureTests.checkAlgorithm(SignatureTests.java:85)
	at app//cryptotest.utils.AlgorithmTest.mainLoop(AlgorithmTest.java:79)
	at app//cryptotest.tests.SignatureTests.main(SignatureTests.java:68)

pshipton avatar Feb 13 '23 14:02 pshipton

@0xdaryl it seems OpenJ9 is too slow to complete this newly added test. I notice jdk17 implSquareToLen() has an @IntrinsicCandidate annotation, while in jdk11 it's @HotSpotIntrinsicCandidate.

@llxia can we increase the timeout setting for this test? timeout set to 120000ms

pshipton avatar Feb 13 '23 14:02 pshipton

https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_extended.functional_aarch64_linux_Nightly_testList_0/99 - cent8-aarch64-1 CryptoTests_0 cryptotest/tests/SignatureTests.java

34)	SUN: 	SHA3-256withDSA~OID.2.16.840.1.101.3.4.3.6	 (Signature)

"MainThread" prio=5 Id=27 RUNNABLE
	at [email protected]/java.math.BigInteger.implMulAdd(BigInteger.java:3320)

https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_extended.functional_aarch64_mac_Nightly_testList_0/103

90)	SunRsaSign: 	SHA512withRSA~OID.1.2.840.113549.1.1.13	 (Signature)

https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_extended.functional_ppc64_aix_Nightly_testList_1/100

40)	SUN: 	SHA256withDSA~OID.2.16.840.1.101.3.4.3.2	 (Signature)

"MainThread" prio=5 Id=35 RUNNABLE
	at [email protected]/java.math.BigInteger.implSquareToLen(BigInteger.java:2316)

https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_extended.functional_ppc64le_linux_Nightly_testList_1/101

46)	SUN: 	NONEwithDSA~RawDSA	 (Signature)

"MainThread" prio=5 Id=35 RUNNABLE
	at [email protected]/java.math.BigInteger.implMulAddCheck(BigInteger.java:3296)

https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_extended.functional_s390x_linux_Nightly_testList_1/102

29)	SUN: 	SHA512withDSA~2.16.840.1.101.3.4.3.4	 (Signature)

"MainThread" prio=5 Id=23 RUNNABLE
	at [email protected]/java.math.BigInteger.montReduce(BigInteger.java:3241)

https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_extended.functional_x86-64_linux_Nightly_testList_1/100

25)	SUN: 	SHA3-512withDSA~OID.2.16.840.1.101.3.4.3.8	 (Signature)

"MainThread" prio=5 Id=23 RUNNABLE
	at [email protected]/java.math.BigInteger.implSquareToLen(BigInteger.java:2316)

https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_extended.functional_x86-64_mac_Nightly_testList_0/99

91)	SunRsaSign: 	SHA512withRSA~1.2.840.113549.1.1.13	 (Signature)

pshipton avatar Feb 13 '23 15:02 pshipton

cryptotest/CryptoTest.java is also timing out https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_extended.functional_ppc64_aix_Nightly_testList_1/100 https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_extended.functional_ppc64le_linux_Nightly_testList_1/101 https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_extended.functional_s390x_linux_Nightly_testList_1/102 https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_extended.functional_x86-64_linux_Nightly_testList_1/100

pshipton avatar Feb 13 '23 15:02 pshipton

and cryptotest/tests/SecureRandomTests.java https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_extended.functional_x86-64_linux_Nightly_testList_1/100

pshipton avatar Feb 13 '23 15:02 pshipton

The jdk19 timeouts are also happening on Adoptium builds.

pshipton avatar Feb 13 '23 15:02 pshipton

I can set -timeoutFactor:2 (instead of 1). But I am not sure if it is the best way to do it. https://openj9-jenkins.osuosl.org/job/Grinder/2022/

llxia avatar Feb 13 '23 21:02 llxia

Increase timeout for CryptoTests: https://github.com/adoptium/aqa-tests/pull/4339

llxia avatar Feb 14 '23 19:02 llxia

I notice jdk17 implSquareToLen() has an @IntrinsicCandidate annotation, while in jdk11 it's @HotSpotIntrinsicCandidate.

Interesting. I believe our intrinsics matching code is only looking for the former, not the latter. But it is the former that might be the issue in this case. We'll investigate the slowness, but not for 0.38.

0xdaryl avatar Mar 14 '23 12:03 0xdaryl

@BradleyWood : please investigate the slowdown here. I moved this to 0.40.

0xdaryl avatar Mar 14 '23 12:03 0xdaryl

@0xdaryl it seems OpenJ9 is too slow to complete this newly added test. I notice jdk17 implSquareToLen() has an @IntrinsicCandidate annotation, while in jdk11 it's @HotSpotIntrinsicCandidate.

I don't think implSquareToLen intrinsic was ever implemented in OpenJ9 on any platform. I think we should open an issue to implement it, and any other unimplemented intrinsics.

BradleyWood avatar Jul 12 '23 14:07 BradleyWood

Reassigning to @jmesyou, as he's working on issue #17778.

I'm not sure whether we need both issues, or if #17778 will act as an epic issue with this as a subtask. I'll leave it for him to decide.

hzongaro avatar Aug 14 '23 21:08 hzongaro

I'm assuming this won't be ready for the 0.41 code split, so I'll move it out to 0.43.

hzongaro avatar Aug 22 '23 15:08 hzongaro