JDK-8057914 : Test sun/security/pkcs11/MessageDigest/TestCloning.java fails with j.l.CloneNotSupportedException: MD5
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.crypto:pkcs11
  • Affected Version: 8u40,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Not an Issue
  • OS: solaris_11
  • CPU: sparc
  • Submitted: 2014-09-09
  • Updated: 2016-06-21
  • Resolved: 2016-06-15
Related Reports
Relates :  
Relates :  
Starting from 8u40-b04 test sun/security/pkcs11/MessageDigest/TestCloning.java fails with j.l.CloneNotSupportedException: MD5 exception on Solaris11-sparc hosts:

Beginning test run TestCloning...
Running test with provider SunPKCS11-Solaris...
Testing against provider SunPKCS11-Solaris
MD2 is not supported, skipping
Testing MD5 of SunPKCS11-Solaris
java.lang.CloneNotSupportedException: MD5
	at sun.security.pkcs11.P11Digest.clone(P11Digest.java:316)
	at java.security.MessageDigest$Delegate.clone(MessageDigest.java:544)
	at TestCloning.testCloning(TestCloning.java:92)
	at TestCloning.main(TestCloning.java:65)
	at PKCS11Test.premain(PKCS11Test.java:86)
	at PKCS11Test.testDefault(PKCS11Test.java:147)
	at PKCS11Test.main(PKCS11Test.java:95)
	at TestCloning.main(TestCloning.java:43)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:745)
Caused by: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_OPERATION_NOT_INITIALIZED
	at sun.security.pkcs11.wrapper.PKCS11.C_GetOperationState(Native Method)
	at sun.security.pkcs11.P11Digest.clone(P11Digest.java:311)
	... 13 more

With 8u40-b03 as well as with 8u20-fcs the test pass.
Test also fails starting from jdk9-b15.

Could it be related to JDK-8037745 ?
Closing as Not an Issue since the failure has not been seen recently, so it is likely the affected Solaris 11 hosts have been upgraded to the latest SRU with the fix.

Just to be clear: - the original bug was reported against Solaris 11 (no idea which version) - other folks added entries about Solaris 10 - the entries I've been adding have been for Solaris 11 From my POV, this is a Solaris 11 issue and not a Solaris 10 issue and it got side tracked by the Solaris 10 entries...

That's odd. The underlying Solaris bug should be fixed in Solaris 11.0 so no patch should be required. This will need more investigation, could be a different problem.

INTJDK-7613285 talks about patches for Solaris 10 machines. This bug was originally reported against Solaris 11 and all of the sightings that I've added to this bug are for Solaris 11. This bug should not have been closed because of a Solaris 10 patch so I'm reopening it.

That failure is related to a Solaris bug that was fixed in the patches. Until all the test machines have been updated, these failure will happen. The test machines need to be updated to it is not misleading.

Is it ok to throw java.lang.CloneNotSupportedException without these patches, is not it misleading?

Since this test works fine with 8u20, issue could be considered as a regression.