ibmruntimes / openj9-openjdk-jdk

Extensions for OpenJDK for Eclipse OpenJ9
GNU General Public License v2.0
17 stars 73 forks source link

"Access is denied" failures in openjdk jdk_security tests #82

Open smlambert opened 5 years ago

smlambert commented 5 years ago

 javax/security/auth/login/modules/JaasModularClientTest.java.JaasModularClientTest  javax/security/auth/login/modules/JaasModularDefaultHandlerTest.java.JaasModularDefaultHandlerTest  sun/security/mscapi/CastError.java.CastError  sun/security/mscapi/InteropWithSunRsaSign.java.InteropWithSunRsaSign  sun/security/mscapi/KeyStoreEmptyCertChain.java.KeyStoreEmptyCertChain  sun/security/mscapi/PublicKeyInterop.java.PublicKeyInterop  sun/security/mscapi/RSAEncryptDecrypt.java.RSAEncryptDecrypt  sun/security/mscapi/ShortRSAKeyWithinTLS.java.ShortRSAKeyWithinTLS  sun/security/mscapi/SignUsingNONEwithRSA.java.SignUsingNONEwithRSA  sun/security/mscapi/SignUsingSHA2withRSA.java.SignUsingSHA2withRSA  sun/security/mscapi/SignatureOffsets.java.SignatureOffsets  sun/security/mscapi/SignedObjectChain.java.SignedObjectChain  sun/security/mscapi/SmallPrimeExponentP.java.SmallPrimeExponentP  sun/security/pkcs12/P12SecretKey.java.P12SecretKey  sun/security/provider/FileInputStreamPool/FileInputStreamPoolTest.java.FileInputStreamPoolTest  com/sun/net/httpserver/SelCacheTest.java.SelCacheTest com/sun/net/httpserver/Test12.java.Test12  com/sun/net/httpserver/Test9.java.Test9  com/sun/net/httpserver/Test9a.java.Test9a  java/net/URLClassLoader/B7050028.java.B7050028  java/net/URLConnection/UnknownContentType.java.UnknownContentType  java/security/KeyPairGenerator/FinalizeHalf.java.FinalizeHalf  java/security/Provider/SecurityProviderModularTest.java.SecurityProviderModularTest  java/security/Signature/ResetAfterException.java.ResetAfterException  java/security/Signature/SignatureLength.java.SignatureLength  sun/net/www/protocol/file/FileMap.java.FileMap  sun/net/www/protocol/file/GetLastModified.java.GetLastModified

Details in attached jtr files: jtr_test_output.tar.gz

pshipton commented 5 years ago

@groeges @andrew-m-leonard

groeges commented 5 years ago

@smlambert Are these still causing issues? Also, was this just on Windows or on other platforms as well?

groeges commented 5 years ago

@smlambert I have run all these tests on my local Windows system using JDK Next and all tests passed. JDK version was:

openjdk 13-internal 2019-09-17
OpenJDK Runtime Environment (build 13-internal+0-adhoc.Administrator.openj9-openjdk-jdk)
Eclipse OpenJ9 VM (build master-ffeaf288e, JRE 13 Windows Server 2016 amd64-64-Bit Compressed References 20190610_000000 (JIT enabled, AOT enabled)
OpenJ9   - ffeaf288e
OMR      - adf08c9e
JCL      - 1031586d8c based on jdk-13+24)

Running jenkins test jobs to see if they fail using them. If they do this may point to an infrastructure / test framework issue, as they do work locally.

groeges commented 5 years ago

Strange. When running using the Jenkins grinder jobs, the tests do fail with the error stated above. Investigating why this is the case for Jenkins and not locally!!

groeges commented 5 years ago

Ran the test locally and they pass. The tests are using the TEMP & TMP environment variable set as "C:\cygwin64\tmp". However, if these are unset or set to "C:\Windows" , as per the jenkins test system that seems to be failing, the local tests also fail. It seems that the 'jenkins' userid is unable to access the "C:\Windows" directory. @smlambert Based on the above investigation, is it possible for the test systems be modified to use a different value for the TEMP and TMP environment variables, one which the 'jenkins' userid can access, which then should allow these tests to pass.

smlambert commented 5 years ago

Thanks for your investigation @groeges, will look and see what we can do to update value of TEMP/TMP to allow Jenkins user access & tests to pass. FYI @llxia

groeges commented 5 years ago

@smlambert @llxia Did you manage to update the test machines and therefore get these tests passing. If so, are we now able to close this issue and/or raise a test infrastructure issue for this, as it now seems it doesn't seem related to the jdk extensions repositories.

llxia commented 5 years ago

fyi @longyuzhang could you take a look of this issue? Thanks

LongyuZhang commented 5 years ago

@groeges Hi Steve, we tried to set both TMP and TEMP to "C:\cygwin64\tmp" on Jenkins as you suggested, but jdk_security1 with jdk13 still failed with "access is denied". Following is the console output, could you check it? Thanks.

18:17:53  Eclipse OpenJ9 VM (build ibm_sdk-e8ab99c9c6, JRE 13 Windows Server 2012 R2 amd64-64-Bit Compressed References 20190710_8 (JIT enabled, AOT enabled)
18:17:53  OpenJ9   - e8ab99c9c6
18:17:53  OMR      - be27021a
18:17:53  JCL      - 1d0112e9684 based on jdk-13+28)

18:27:19  cd 'C:\Users\jenkins\workspace\Grinder_Sandbox\openjdk-tests\TestConfig\test_output_15632294373719\jdk_security1_0\work\scratch\4' && \
18:27:19  PATH='C:\cygwin64\bin;C:\Strawberry\perl\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Git\cmd;C:\openjdk\jdk8\bin;C:\apache-ant\apache-ant-1.10.5\bin;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft Windows Performance Toolkit' \
18:27:19  SystemDrive=C: \
18:27:19  SystemRoot='C:\Windows' \
18:27:19  TEMP='C:\cygwin64\tmp' \
18:27:19  TMP='C:\cygwin64\tmp' \
18:27:19  windir='C:\Windows' \
18:27:19      'C:\Users\jenkins\workspace\Grinder_Sandbox\openjdkbinary\j2sdk-image\bin\java' \
18:27:19          -Dtest.class.path.prefix='C:\Users\jenkins\workspace\Grinder_Sandbox\openjdk-tests\TestConfig\test_output_15632294373719\jdk_security1_0\work\classes\6\java\security\KeyPairGenerator\FinalizeHalf.d;C:\Users\jenkins\workspace\Grinder_Sandbox\openjdk-tests\openjdk\openjdk-jdk\test\jdk\java\security\KeyPairGenerator' \
18:27:19          -Dtest.src='C:\Users\jenkins\workspace\Grinder_Sandbox\openjdk-tests\openjdk\openjdk-jdk\test\jdk\java\security\KeyPairGenerator' \
18:27:19          -Dtest.src.path='C:\Users\jenkins\workspace\Grinder_Sandbox\openjdk-tests\openjdk\openjdk-jdk\test\jdk\java\security\KeyPairGenerator' \
18:27:19          -Dtest.classes='C:\Users\jenkins\workspace\Grinder_Sandbox\openjdk-tests\TestConfig\test_output_15632294373719\jdk_security1_0\work\classes\6\java\security\KeyPairGenerator\FinalizeHalf.d' \
18:27:19          -Dtest.class.path='C:\Users\jenkins\workspace\Grinder_Sandbox\openjdk-tests\TestConfig\test_output_15632294373719\jdk_security1_0\work\classes\6\java\security\KeyPairGenerator\FinalizeHalf.d' \
18:27:19          -Dtest.vm.opts='-ea -esa -Xmx512m -Xcompressedrefs' \
18:27:19          -Dtest.tool.vm.opts='-J-ea -J-esa -J-Xmx512m -J-Xcompressedrefs' \
18:27:19          -Dtest.compiler.opts= \
18:27:19          -Dtest.java.opts= \
18:27:19          -Dtest.jdk='C:\Users\jenkins\workspace\Grinder_Sandbox\openjdkbinary\j2sdk-image' \
18:27:19          -Dcompile.jdk='C:\Users\jenkins\workspace\Grinder_Sandbox\openjdkbinary\j2sdk-image' \
18:27:19          -Dtest.timeout.factor=8.0 \
18:27:19          -Dtest.root='C:\Users\jenkins\workspace\Grinder_Sandbox\openjdk-tests\openjdk\openjdk-jdk\test\jdk' \
18:27:19          -classpath 'C:\Users\jenkins\workspace\Grinder_Sandbox\openjdk-tests\TestConfig\test_output_15632294373719\jdk_security1_0\work\classes\6\java\security\KeyPairGenerator\FinalizeHalf.d;C:\Users\jenkins\workspace\Grinder_Sandbox\openjdk-tests\openjdk\openjdk-jdk\test\jdk\java\security\KeyPairGenerator;C:\Users\jenkins\workspace\Grinder_Sandbox\jvmtest\openjdk\jtreg\lib\javatest.jar;C:\Users\jenkins\workspace\Grinder_Sandbox\jvmtest\openjdk\jtreg\lib\jtreg.jar' \
18:27:19          FinalizeHalf
18:27:19  STDERR:
18:27:19  java.security.ProviderException: java.security.KeyException: Access is denied.
18:27:19  
18:27:19    at jdk.crypto.mscapi/sun.security.mscapi.CKeyPairGenerator$RSA.generateKeyPair(CKeyPairGenerator.java:126)
18:27:19    at java.base/java.security.KeyPairGenerator$Delegate.generateKeyPair(KeyPairGenerator.java:722)
18:27:19    at FinalizeHalf.test(FinalizeHalf.java:76)
18:27:19    at FinalizeHalf.main(FinalizeHalf.java:54)
18:27:19    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
18:27:19    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
18:27:19    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
18:27:19    at java.base/java.lang.reflect.Method.invoke(Method.java:567)
18:27:19    at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
18:27:19    at java.base/java.lang.Thread.run(Thread.java:831)
18:27:19  Caused by: java.security.KeyException: Access is denied.
18:27:19  
18:27:19    at jdk.crypto.mscapi/sun.security.mscapi.CKeyPairGenerator$RSA.generateCKeyPair(Native Method)
18:27:19    at jdk.crypto.mscapi/sun.security.mscapi.CKeyPairGenerator$RSA.generateKeyPair(CKeyPairGenerator.java:121)
18:27:19    ... 9 more
18:27:19  
18:27:19  JavaTest Message: Test threw exception: java.security.ProviderException
18:27:19  JavaTest Message: shutting down test
18:27:19  
18:27:19  STDOUT:
18:27:19  Checking SunJCE, DiffieHellman
18:27:19  Checking SunJCE, DiffieHellman
18:27:19  Checking SunJCE, DiffieHellman
18:27:19  Checking SunJCE, DiffieHellman
18:27:19  Checking SUN, DSA
18:27:19  Checking SUN, DSA
18:27:19  Checking SUN, DSA
18:27:19  Checking SUN, DSA
18:27:19  Checking SunRsaSign, RSA
18:27:19  Checking SunRsaSign, RSA
18:27:19  Checking SunRsaSign, RSA
18:27:19  Checking SunRsaSign, RSA
18:27:19  Checking SunMSCAPI, RSA
18:27:19  
18:27:19  TEST RESULT: Failed. Execution failed: `main' threw exception: java.security.ProviderException: java.security.KeyException: Access is denied.
sendaoYan commented 2 years ago

Shoud we disable there testcase temporarily