Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8296959

Fix hotspot shell tests of 8u on multilib systems

    XMLWordPrintable

Details

    • b04

    Description

      Few hotspot tests (from hotspot/tier1) currently fail for x86 (32-bit) builds on 64-bit system (Linux):
      compiler/criticalnatives/argumentcorruption/Test8167409.sh
      runtime/jni/CallWithJNIWeak/test.sh
      runtime/jni/ReturnJNIWeak/test.sh

      Problem:
      Tests build 64-bit JNI libraries and trying to use them for 32-bit jdk, resulting in error:
      Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/runner/work/jdk8u-dev/jdk8u-dev/test-results/testoutput/hotspot_tier1/JTwork/scratch/libCNCheckLongArgs.so: /home/runner/work/jdk8u-dev/jdk8u-dev/test-results/testoutput/hotspot_tier1/JTwork/scratch/libCNCheckLongArgs.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)

      These tests only target Linux and (some) Solaris.

      Solution:
      Fixed by supplying appropriate compiler argument (-m32) to build 32-bit libraries for 32-bit JDK. (Some tests already did that, but not in uniform way). I verified in manpage of gcc that -m32 argument is supported for all 32-bit variants of architectures supported by JDK 8 [1]. Solaris cc also seems to support -m32 [2].
      This fix is JDK 8 only as newer JDK use new approach, where JNI test libraries are build are build system and tests not longer build them themselfs.

      Testing:
      Change fixed these tests on linux-x86. (tested here [3])
      Tests are part of hotspot/tier1. This is one of problems, which needs to be fixed, so that hotspot/tier1 can be enabled in GHA on linux-x86. Other one is JDK-8295952 [4] (will need to get fixed and backported).

      [1] https://man7.org/linux/man-pages/man1/gcc.1.html
      [2] https://docs.oracle.com/cd/E37069_01/html/E54439/cc-1.html
      [3] https://github.com/zzambers/jdk8u-dev/actions/runs/3441392968
      [4] https://bugs.openjdk.org/browse/JDK-8295952

      Attachments

        Issue Links

          Activity

            People

              sgehwolf Severin Gehwolf
              zzambers Zdenek Zambersky
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: