JDK-8236634 : Memory Access API tests fail on 32-bit
  • Type: Bug
  • Component: core-libs
  • Affected Version: 14
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86,arm
  • Submitted: 2020-01-03
  • Updated: 2020-05-25
  • Resolved: 2020-01-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 14 JDK 15
14 b32Fixed 15Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
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


Comments
URL: https://hg.openjdk.java.net/jdk/jdk14/rev/e70d8459c2ba User: njian Date: 2020-01-13 07:32:26 +0000
13-01-2020

After discussing with Maurizio, we decided to fix the build warnings and skip the failing tests for jdk/jdk14, and then fix the failures properly in jdk/jdk later. Forgot to link to the review thread: https://mail.openjdk.java.net/pipermail/core-libs-dev/2020-January/064218.html
13-01-2020

I believe we should split the fix for build warnings (that fails default build on x86_32): JDK-8236920, to make jdk/jdk14 buildable again.
10-01-2020