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

Support openj9 to run openjdk hotspot_custom target for jvmti tests #5370

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

LongyuZhang
Copy link
Contributor

@LongyuZhang LongyuZhang commented Jun 5, 2024

@LongyuZhang LongyuZhang marked this pull request as draft June 5, 2024 18:58
@LongyuZhang
Copy link
Contributor Author

Test Link: hyc_grinder 41198

  • TARGET: disabled.hotspot_custom,
  • CUSTOM_TARGET: serviceability/jvmti/GetSystemProperty/JvmtiGetSystemPropertyTest.java
14:55:09  TEST: serviceability/jvmti/GetSystemProperty/JvmtiGetSystemPropertyTest.java
14:55:09  TEST JDK: /home/jenkins/workspace/Grinder/jdkbinary/j2sdk-image

However, this test failed with output:

14:55:09  ACTION: main -- Failed. Unexpected exit from test [exit code: 1]
14:55:09  REASON: User specified action: run main/othervm/native -agentlib:JvmtiGetSystemPropertyTest JvmtiGetSystemPropertyTest 
14:55:09  TIME:   0.105 seconds
14:55:09  messages:
14:55:09  command: main -agentlib:JvmtiGetSystemPropertyTest JvmtiGetSystemPropertyTest
14:55:09  reason: User specified action: run main/othervm/native -agentlib:JvmtiGetSystemPropertyTest JvmtiGetSystemPropertyTest 
14:55:09  started: Wed Jun 05 11:55:09 PDT 2024
14:55:09  Mode: othervm [/othervm specified]
14:55:09  finished: Wed Jun 05 11:55:09 PDT 2024
14:55:09  elapsed time (seconds): 0.105
14:55:09  configuration:
14:55:09  STDOUT:
14:55:09  STDERR:
14:55:09  JVMJ9TI001E Agent library JvmtiGetSystemPropertyTest could not be opened (libJvmtiGetSystemPropertyTest.so: cannot open shared object file: No such file or directory)
14:55:09  JVMJ9VM015W Initialization error for library j9jvmti29(-3): JVMJ9VM009E J9VMDllMain failed

@fengxue-IS would you have any suggestion about this failure? Thanks.

@pshipton
Copy link
Contributor

pshipton commented Jun 5, 2024

libJvmtiGetSystemPropertyTest.so should be part of the test image, but it's not on jdk17. I see it's there for jdk21. Seems we need to expand building the native code for jdk17 similarly to what has been done for jdk21.

@fengxue-IS
Copy link
Contributor

serviceability test suite have only been enabled on OpenJ9 for JDK 19+ to support Project Loom, so I don't suppose this should be verified against JDK17

@LongyuZhang
Copy link
Contributor Author

LongyuZhang commented Jun 6, 2024

Tested with JDK21 (hyc_grinder 41212), still failed with the same output:
TARGET: disabled.hotspot_custom,
CUSTOM_TARGET: serviceability/jvmti/GetSystemProperty/JvmtiGetSystemPropertyTest.java

21:48:14  STDERR:
21:48:14  JVMJ9TI001E Agent library JvmtiGetSystemPropertyTest could not be opened (libJvmtiGetSystemPropertyTest.so: cannot open shared object file: No such file or directory)
21:48:14  JVMJ9VM015W Initialization error for library j9jvmti29(-3): JVMJ9VM009E J9VMDllMain failed

@LongyuZhang
Copy link
Contributor Author

Test with sanity/BasicVMTest.java, passed successfully (hyc_grinder 41215/testReport)

  • TARGET: disabled.hotspot_custom
  • CUSTOM_TARGET: sanity/BasicVMTest.java

@LongyuZhang LongyuZhang marked this pull request as ready for review June 6, 2024 02:17
@LongyuZhang LongyuZhang requested a review from llxia June 6, 2024 02:18
@fengxue-IS
Copy link
Contributor

fengxue-IS commented Jun 6, 2024

Tested with JDK21 (hyc_grinder 41212), still failed with the same output: TARGET: disabled.hotspot_custom, CUSTOM_TARGET: serviceability/jvmti/GetSystemProperty/JvmtiGetSystemPropertyTest.java

21:48:14  STDERR:
21:48:14  JVMJ9TI001E Agent library JvmtiGetSystemPropertyTest could not be opened (libJvmtiGetSystemPropertyTest.so: cannot open shared object file: No such file or directory)
21:48:14  JVMJ9VM015W Initialization error for library j9jvmti29(-3): JVMJ9VM009E J9VMDllMain failed

I suspect the failure is due to use of JVM_NATIVE_OPTIONS in

$(JTREG_BASIC_OPTIONS) $(JVM_NATIVE_OPTIONS) -vmoptions:$(Q)-Xmx512m $(JVM_OPTIONS) $(VMOPTION_HEADLESS)$(Q) \

which is defined based on the JDK_IMPL test is running against:

JDK_NATIVE_OPTIONS := -nativepath:"$(TESTIMAGE_PATH)$(D)jdk$(D)jtreg$(D)native"
ifeq ($(JDK_IMPL), hotspot)
JVM_NATIVE_OPTIONS := -nativepath:"$(TESTIMAGE_PATH)$(D)hotspot$(D)jtreg$(D)native"
# else if JDK_IMPL is openj9 or ibm
else ifneq ($(filter openj9 ibm, $(JDK_IMPL)),)
JVM_NATIVE_OPTIONS := -nativepath:"$(TESTIMAGE_PATH)$(D)openj9"
endif

but for serviceability test suite, -nativepath:"$(TESTIMAGE_PATH)/hotspot/jtreg/native" is required for openj9 impl as well.
see example in serviceability_jvmti_j9 suite

<testCaseName>serviceability_jvmti_j9</testCaseName>
<variations>
<variation>Mode150</variation>
<variation>Mode650</variation>
<variation>Mode1000</variation>
</variations>
<command>$(JAVA_COMMAND) -Xmx512m -jar $(Q)$(TEST_RESROOT)$(D)jtreg$(D)lib$(D)jtreg.jar$(Q) \
$(JTREG_BASIC_OPTIONS) -nativepath:"$(TESTIMAGE_PATH)/hotspot/jtreg/native" -vmoptions:$(Q)-Xmx512m $(JVM_OPTIONS) $(VMOPTION_HEADLESS)$(Q) \

FYI @LongyuZhang

@llxia
Copy link
Contributor

llxia commented Jun 7, 2024

I thought I commented on it yesterday. Anyway, instead of using JVM_NATIVE_OPTIONS in the playlist for hotspot_custom, set -nativepath:"$(TESTIMAGE_PATH)/hotspot/jtreg/native"

Subtests of serviceability_jvmti_j9 (i.e., serviceability/jvmti/GetSystemProperty/JvmtiGetSystemPropertyTest.java) have to run to completion with hotspot_custom. It is the purpose of this PR.

@LongyuZhang
Copy link
Contributor Author

Updated the PR based on @fengxue-IS and @llxia comments.
New test links for serviceability/jvmti/GetSystemProperty/JvmtiGetSystemPropertyTest.java

openjdk/playlist.xml Outdated Show resolved Hide resolved
- Leveraging hotspot_custom to support openj9 to run openjdk custom target

Signed-off-by: LongyuZhang <[email protected]>
Copy link
Contributor

@llxia llxia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @LongyuZhang

@llxia llxia merged commit bc92b7d into adoptium:master Jun 7, 2024
3 checks passed
@sophia-guo sophia-guo changed the title Support openj9 to run openjdk custom target Support openj9 to run openjdk hotspot_custom target for jvmti tests Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants