The security enabled SVT JLM tests have a step where they attempt to access a password file on disc. These tests fail if run with OpenJDK8-OpenJ9 SDK while attempting to access the password file, with following UnsatisfiedLinkError:
Exception in thread "main" java/lang/UnsatisfiedLinkError: sun/management/FileSystemImpl.isAccessUserOnly0(Ljava/lang/String;)Z
at sun/management/FileSystemImpl.isAccessUserOnly (FileSystemImpl.java:41)
at sun/management/jmxremote/ConnectorBootstrap.checkPasswordFile (ConnectorBootstrap.java:575)
at sun/management/jmxremote/ConnectorBootstrap.startRemoteConnectorServer (ConnectorBootstrap.java:429)
at sun/management/Agent.startAgent (Agent.java:262)
at sun/management/Agent.startAgent (Agent.java:452)
at java/lang/System.startSNMPAgent (NativeMethod:4294967295)
at java/lang/Thread.completeInitialization (Thread.java:167)
at java/lang/J9VMInternals.completeInitialization (J9VMInternals.java:72)
Note: The same test works fine on OpenJDK 8 hotspot and IBM Java 8 SDK.
Java versions
Test fails with the _OpenJDK8-OpenJ9_:
https://ci.adoptopenjdk.net/view/work%20in%20progress/job/test_personal/442/console
openjdk version "1.8.0_162"
OpenJDK Runtime Environment (build 1.8.0_162-b12)
Eclipse OpenJ9 VM (build master-301afd1e, JRE 1.8.0 Linux amd64-64 Compressed References 20180323_128 (JIT enabled, AOT enabled)
OpenJ9 - 301afd1e
OMR - b623c98f
JCL - 8599c6f6 based on jdk8u162-b12)
Test passes with _OpenJDK 8_
https://ci.adoptopenjdk.net/view/work%20in%20progress/job/test_personal/443/consoleFull
openjdk version "1.8.0-adoptopenjdk"
OpenJDK Runtime Environment (build 1.8.0-adoptopenjdk-jenkins_2018_03_08_17_02-b00)
OpenJDK 64-Bit Server VM (build 25.71-b00, mixed mode)
Test passes with _IBM Java 8_ (tested internally) :
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 8.0.6.0 - pxa6480sr6-20180322_01(SR6))
IBM J9 VM (build 2.9, JRE 1.8.0 Linux amd64-64 Compressed References 20180321_381926 (JIT enabled, AOT enabled)
OpenJ9 - 941d614
OMR - 3693306
IBM - d06f11a)
JCL - 20180320_01 based on Oracle jdk8u171-b09
How to reproduce:
You can reproduce the defect by running the personal build at Adopt (https://ci.adoptopenjdk.net/view/work%20in%20progress/job/test_personal/).
To run with OpenJDK, please use the following values:
personalRepo = Mesbah-Alam
personalBranch = addJlmTestToAdoptOpenJDK
PLATFORM = x64_linux
SPEC聽= linux_x86-64_cmprssptrs
JAVA_VERSION = SE80
JAVA_IMPL = hotspot
JVM_VERSION = openjdk8
TESTPROJECT = systemtest
TARGET = TestJlmRemoteMemoryAuth_0
MACHINE_LABEL 聽= linux&&x64&&test
SDK_RESOURCE = nightly
UPSTREAM_JOB_NAME = N/A
UPSTREAM_JOB_NUMBER = N/A
CUSTOMIZED_SDK_URL = (leave empty
To run with OpenJDK8-OpenJ9, please use JAVA_IMPL=openj9 and JVM_VERSION=openjd8-openj9.
To run with IBM SDK, please use JAVA_IMPL=openj9, JVM_VERSION=openjd8-openj9, and provide the full path to the IBM SDK zip in CUSTOMIZED_SDK_URL field.
To reproduce manually on a local machine
The UnsatisfiedLinkError is actually logged inside the log file of the "server" sub-process of the test. It is not viewable on console output of the Jenkins job. In order to run the test manually, you may execute the Java command line for the "server" sub-process of the test manually.
One way to do it is :
execute.pl script (e.g. /home/jenkins/workspace/test_personal/openjdk-tests/TestConfig/scripts/testKitGen/../../../TestConfig/test_output_15216596313069/TestJlmRemoteMemoryAuth_0/20180321-191352-TestJlmRemoteMemoryAuth/execute.pl)For any other question/queries regarding how to reproduce the issue, please contact the test team.
@theresa-m Can you take a look at this?
The test is failing after this pr: https://github.com/eclipse/openj9/pull/1226 Digging into this more
It doesn't seem likely #1226 is the cause of this problem, but enables the test to work properly, which exposed this problem. The FileSystemImpl.isAccessUserOnly0 native is in libmanagement, but OpenJ9 replaces this library with a stub. We'll need to restore this native and perhaps others as well in order for the OpenJDK code to work properly.
Looking at the list of natives in jdk/make/mapfiles/libmanagement/mapfile-vers, this may be the only native required. Not sure about sun_management_Flag natives. The other alternative is to implement the native in OpenJ9 instead of patching the OpenJDK extensions to include it.
fyi the OpenJ9 stub for libmanagement is in runtime/mgmt