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

Memory Access API tests fail on 32-bit

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 14
    • Fix Version/s: 14
    • Component/s: core-libs
    • Resolved In Build:
      b32
    • CPU:
      x86, arm
    • OS:
      linux

      Backports

        Description

        A couple of unrelated issues:

        --------

        libNativeAccess.c has some build warnings due to casting from a 32-bit pointer to a 64-bit signed jlong:

        /home/nicgas01/jdk/test/jdk/java/foreign/libNativeAccess.c: In function 'Java_TestNative_getByteRaw':
        /home/nicgas01/jdk/test/jdk/java/foreign/libNativeAccess.c:30:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
             jbyte *arr = (jbyte*)addr;

        ------

        java/foreign/TestArrays.java testTooBigForArray() crashes the VM because it tries to allocate a Integer.MAX_VALUE * 2 byte buffer. When this is aligned up to HeapWordSize it overflows a 32-bit size_t.

        # Java VM: OpenJDK Server VM (fastdebug 15-internal+0-adhoc.nicgas01.jdk, mixed mode, sharing, g1 gc, linux-arm)
        # Problematic frame:
        # V [libjvm.so+0x4b5926] Copy::fill_to_memory_atomic(void*, unsigned int, unsigned char)+0xc

        ------

        java/foreign/TestByteBuffer.java fails on 32-bit Arm due to unaligned accesses.

        test TestByteBuffer.testResizeRoundtripHeap(TestByteBuffer$$Lambda$69/0xd1ae9438@151acc1, TestByteBuffer$$Lambda$62/0xd1a9a638@1296ffe, [100:B64]): failure
        java.lang.IllegalStateException: Misaligned access at address: 12

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                ngasson Nick Gasson
                Reporter:
                ngasson Nick Gasson
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: