Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pshipton opened this issue Feb 13, 2023 · 13 comments

Comments

@pshipton
Copy link
Member

pshipton commented Feb 13, 2023

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
Copy link
Member Author

pshipton commented Feb 13, 2023

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
Copy link
Member Author

@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
Copy link
Member Author

pshipton commented Feb 13, 2023

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
Copy link
Member Author

@pshipton
Copy link
Member Author

The jdk19 timeouts are also happening on Adoptium builds.

@llxia
Copy link
Contributor

llxia commented Feb 13, 2023

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
Copy link
Contributor

llxia commented Feb 14, 2023

Increase timeout for CryptoTests: adoptium/aqa-tests#4339

@0xdaryl
Copy link
Contributor

0xdaryl commented Mar 14, 2023

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
Copy link
Contributor

0xdaryl commented Mar 14, 2023

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

@BradleyWood
Copy link
Member

@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.

@hzongaro
Copy link
Member

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants