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

Some jdk_foreign tests fail on Mac/AArch64 when using the fallback linker

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P5 P5
    • tbd
    • 21, 22
    • core-libs
    • None

      There are a few failing jdk_foreign tests on Mac/AArch64 when using the fallback linker (running the tests with `-Djdk.internal.foreign.CABI=FALLBACK`):

      test/jdk/java/foreign/TestUpcallStack.java
      test/jdk/java/foreign/arraystructs/TestArrayStructs.java#specialized
      test/jdk/java/foreign/arraystructs/TestArrayStructs.java#interpreted

      These tests were disabled when running on this configuration as part of: https://bugs.openjdk.org/browse/JDK-8309880

      It seems like this is an issue in libffi (version 3.4.2 was used to test). My best guess is that libffi doesn't correctly add padding around structs that are passed on the stack (as opposed to scalars, structs are not 'packed' together in the mac/aarch64 ABI, unless they are HFAs. See how we handle this in the foreign linker impl [1], [2]). This issue might be fixed in a future version of libffi.

      [1]: https://github.com/openjdk/jdk/blob/75dcc4ef94d90e4aa7f8ca5eccc97c91492d6eed/src/java.base/share/classes/jdk/internal/foreign/abi/aarch64/CallArranger.java#L296
      [2]: https://github.com/openjdk/jdk/blob/75dcc4ef94d90e4aa7f8ca5eccc97c91492d6eed/src/java.base/share/classes/jdk/internal/foreign/abi/aarch64/CallArranger.java#L329

            jvernee Jorn Vernee
            jvernee Jorn Vernee
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: