adoptium / aqa-systemtest

Java load testing and other full system application tests
Apache License 2.0
19 stars 65 forks source link

Java 17 jlink fails on Mac OS X Aarch64 due to incorrect architecture #464

Closed karianna closed 2 years ago

karianna commented 2 years ago

STF 18:20:58.492 - Running command: /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/openjdkbinary/j2sdk-image/Contents/Home/bin/jlink --module-path /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/openjdkbinary/j2sdk-image/Contents/Home/jmods:/Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/tmp --add-modules com.test.jlink --output /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/tmp/19.CRI2 STF 18:20:58.492 - Redirecting stderr to /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/results/19.JLNK.stderr STF 18:20:58.492 - Redirecting stdout to /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/results/19.JLNK.stdout STF 18:20:58.495 - Monitoring processes: JLNK STF 18:20:59.125 - Monitoring Report Summary: STF 18:20:59.125 - o Process JLNK ended with the expected exit code (0) STF 18:20:59.125 - STF 18:20:59.125 - +------ Step 20 - Running listmods STF 18:20:59.125 - | Run foreground process STF 18:20:59.125 - | Program: /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/tmp/19.CRI2/bin/java STF 18:20:59.125 - | Mnemonic: LIST STF 18:20:59.125 - | Echo: ECHO_ON STF 18:20:59.125 - | Expectation: CLEAN_RUN within 1m STF 18:20:59.125 - | STF 18:20:59.125 - Running command: /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/tmp/19.CRI2/bin/java --list-modules -XX:+UseCompressedOops STF 18:20:59.125 - Redirecting stderr to /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/results/20.LIST.stderr STF 18:20:59.125 - Redirecting stdout to /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/results/20.LIST.stdout STF 18:20:59.129 - Monitoring processes: LIST LIST com.hello LIST com.test.jlink LIST java.base@17 STF 18:20:59.769 - Monitoring Report Summary: STF 18:20:59.769 - o Process LIST ended with the expected exit code (0) STF 18:20:59.769 - STF 18:20:59.769 - +------ Step 21 - Check output STF 18:20:59.769 - | Count file matches STF 18:20:59.769 - | TargetFile: /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/results/20.LIST.stdout STF 18:20:59.769 - | ExpectedNumMatches: 1 STF 18:20:59.769 - | SearchStrings: ["com.hello"] STF 18:20:59.769 - | STF 18:20:59.769 - Found 1 instances of ["com.hello"] STF 18:20:59.769 - STF 18:20:59.769 - +------ Step 22 - Check output STF 18:20:59.769 - | Count file matches STF 18:20:59.769 - | TargetFile: /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/results/20.LIST.stdout STF 18:20:59.769 - | ExpectedNumMatches: 1 STF 18:20:59.769 - | SearchStrings: ["com.test.jlink"] STF 18:20:59.769 - | STF 18:20:59.769 - Found 1 instances of ["com.test.jlink"] STF 18:20:59.769 - STF 18:20:59.769 - +------ Step 23 - Check output STF 18:20:59.769 - | Count file matches STF 18:20:59.769 - | TargetFile: /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/results/20.LIST.stdout STF 18:20:59.769 - | ExpectedNumMatches: 1 STF 18:20:59.769 - | SearchStrings: ["java.base"] STF 18:20:59.769 - | STF 18:20:59.769 - Found 1 instances of ["java.base"] STF 18:20:59.769 - STF 18:20:59.769 - +------ Step 24 - Running adoptopenjdk.test.modularity.jlink.JniTest STF 18:20:59.769 - | Run foreground process STF 18:20:59.769 - | Program: /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/tmp/19.CRI2/bin/java STF 18:20:59.769 - | Mnemonic: T2 STF 18:20:59.769 - | Echo: ECHO_ON STF 18:20:59.769 - | Expectation: CLEAN_RUN within 1m STF 18:20:59.769 - | STF 18:20:59.769 - Running command: /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/tmp/19.CRI2/bin/java -Djava.library.path=/Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/native --add-reads com.test.jlink=ALL-UNNAMED -XX:+UseCompressedOops -classpath /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/jvmtest/system/systemtest_prereqs/junit/junit.jar:/Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/jvmtest/system/systemtest_prereqs/junit/hamcrest-core.jar org.junit.runner.JUnitCore adoptopenjdk.test.modularity.jlink.JniTest STF 18:20:59.769 - Redirecting stderr to /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/results/24.T2.stderr STF 18:20:59.769 - Redirecting stdout to /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/results/24.T2.stdout STF 18:20:59.772 - Monitoring processes: T2 T2 JUnit version 4.12 T2 stderr Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/tmp/19.CRI2/lib/libJniTest.dylib: dlopen(/Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/tmp/19.CRI2/lib/libJniTest.dylib, 1): no suitable image found. Did find: T2 stderr /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/tmp/19.CRI2/lib/libJniTest.dylib: mach-o, but wrong architecture T2 stderr /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/tmp/19.CRI2/lib/libJniTest.dylib: mach-o, but wrong architecture T2 stderr at java.base/jdk.internal.loader.NativeLibraries.load(Native Method) T2 stderr at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:384) T2 stderr at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:228) T2 stderr at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:170) T2 stderr at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:311) T2 stderr at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:281) T2 stderr at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2422) T2 stderr at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:818) T2 stderr at java.base/java.lang.System.loadLibrary(System.java:1989) T2 stderr at com.test.jlink/adoptopenjdk.test.modularity.jlink.JniTest.(JniTest.java:24) T2 stderr at java.base/java.lang.Class.forName0(Native Method) T2 stderr at java.base/java.lang.Class.forName(Class.java:467) T2 stderr at org.junit.internal.Classes.getClass(Classes.java:16) T2 stderr at org.junit.runner.JUnitCommandLineParseResult.parseParameters(JUnitCommandLineParseResult.java:100) T2 stderr at org.junit.runner.JUnitCommandLineParseResult.parseArgs(JUnitCommandLineParseResult.java:50) T2 stderr at org.junit.runner.JUnitCommandLineParseResult.parse(JUnitCommandLineParseResult.java:44) T2 stderr at org.junit.runner.JUnitCore.runMain(JUnitCore.java:72) T2 stderr at org.junit.runner.JUnitCore.main(JUnitCore.java:36) STF 18:20:59.974 - FAILED Process T2 ended with exit code (1) and not the expected exit code/s (0) STF 18:20:59.975 - Monitoring Report Summary: STF 18:20:59.975 - o Process T2 ended with exit code (1) and not the expected exit code/s (0) STF 18:20:59.975 - Killing processes: T2 STF 18:20:59.975 - o Process T2 pid 3086 is not running FAILED at step 24 (Running adoptopenjdk.test.modularity.jlink.JniTest). Expected return value=0 Actual=1 at /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/TKG/../TKG/output_16316650461897/Jlink_ReqMod_0/20210914-182055-JlinkTest/execute.pl line 455. STF 18:20:59.997 - FAILED execute script failed. Expected return value=0 Actual=1

sophia-guo commented 2 years ago

Move to https://github.com/adoptium/aqa-systemtest/issues/463

smlambert commented 2 years ago

FYI for future reference, @sophia-guo - you can actually transfer issues to other repos using the 'Transfer issue' option on the right side of the page:

Screen Shot 2021-09-21 at 11 17 04 AM

I believe as a committer you have permissions to do that.

sophia-guo commented 2 years ago

Looks like the complied JniTest.dylib doesn't work on aarch64 macos.

https://github.com/adoptium/aqa-systemtest/issues/463#issuecomment-924102940

sophia-guo commented 2 years ago

The compile command is

[exec] gcc -D_JNI_IMPLEMENTATION_ -D_TRIVIAL_AGENT -O0 -g3 -pedantic -c -Wall -std=c99 -fPIC -fno-omit-frame-pointer -static-libgcc -o /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/system/aqa-systemtest/openjdk.test.modularity/bin/tests/com.test.jlink/native/lib/osx/JniTest.o -I. -I/Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/system/aqa-systemtest/openjdk.test.modularity/bin/tests/com.test.jlink/native/lib -I/Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/openjdkbinary/j2sdk-image/Contents/Home/include/darwin -I/Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/openjdkbinary/j2sdk-image/Contents/Home/include -I/usr/include JniTest.c
20:17:22 [exec] clang: warning: argument unused during compilation: '-static-libgcc' [-Wunused-command-line-argument]
20:17:22 [exec] chmod 755 /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/system/aqa-systemtest/openjdk.test.modularity/bin/tests/com.test.jlink/native/lib/osx/JniTest.o
20:17:22 [exec] gcc -dynamiclib -o /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/system/aqa-systemtest/openjdk.test.modularity/bin/tests/com.test.jlink/native/bin/osx/libJniTest.dylib /Users/jenkins/workspace/Test_openjdk17_hs_sanity.system_aarch64_mac/aqa-tests/system/aqa-systemtest/openjdk.test.modularity/bin/tests/com.test.jlink/native/lib/osx/JniTest.o

@gdams Do you have idea about compile command or options on aarch64 macos?

sophia-guo commented 2 years ago

My guess is we need to update compile command similar to this PR https://github.com/adoptium/aqa-systemtest/pull/458/files @gdams, which add option or flag -arch arm64 for mac arm64?