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

java/foreign tests are still failing on x86_32 after foreign-memaccess integration

XMLWordPrintable

    • b18

      These two:

      $ CONF=linux-x86-server-fastdebug make images run-test TEST=java/foreign/TestByteBuffer.java

      java.lang.OutOfMemoryError: Unable to allocate 2147483660 bytes
      at java.base/jdk.internal.misc.Unsafe.allocateMemory(Unsafe.java:632)
      at jdk.incubator.foreign/jdk.internal.foreign.NativeMemorySegmentImpl.makeNativeSegment(NativeMemorySegmentImpl.java:91)
      at jdk.incubator.foreign/jdk.incubator.foreign.MemorySegment.allocateNative(MemorySegment.java:612)
      at jdk.incubator.foreign/jdk.incubator.foreign.MemorySegment.allocateNative(MemorySegment.java:559)
      at TestByteBuffer.testTooBigForByteBuffer(TestByteBuffer.java:464)

      $ CONF=linux-x86-server-fastdebug make images run-test TEST=java/foreign/TestMismatch.java

      test TestMismatch.testLarge(): failure
      java.lang.OutOfMemoryError: Unable to allocate 2147483660 bytes
      at java.base/jdk.internal.misc.Unsafe.allocateMemory(Unsafe.java:632)
      at jdk.incubator.foreign/jdk.internal.foreign.NativeMemorySegmentImpl.makeNativeSegment(NativeMemorySegmentImpl.java:91)
      at jdk.incubator.foreign/jdk.incubator.foreign.MemorySegment.allocateNative(MemorySegment.java:612)
      at jdk.incubator.foreign/jdk.incubator.foreign.MemorySegment.allocateNative(MemorySegment.java:559)
      at TestMismatch.testLarge(TestMismatch.java:114)

      They were failing before, and fixed by JDK-8237521 and using "(long) Integer.MAX_VALUE * 2" that would expose this path to additional checking on Unsafe side, which will throw the exception the test expects.

      However, that was reverted during the JDK-8243491 integration back to "(long)Integer.MAX_VALUE + 10L)":
      https://hg.openjdk.java.net/jdk/jdk/diff/8113059a83b2/test/jdk/java/foreign/TestByteBuffer.java#l1.118

      But I find the whole thing rather fragile.

            mcimadamore Maurizio Cimadamore
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: