On Mon, 1 Sep 2025 05:31:43 GMT, Amit Kumar <amitku...@openjdk.org> wrote:

> Originally Reported in OpenJ9, fix by @AditiS11 present here: 
> https://github.com/ibmruntimes/openj9-openjdk-jdk25/pull/32
> 
> These test failure were reported in OpenJ9 (x86), I can't reproduce on my 
> system (s390x): 
> 
> java/foreign/TestFill.java
> java/foreign/TestSegments.java
> java/foreign/TestSegmentBulkOperationsContentHash.java
> java/foreign/TestStringEncoding.java
> java/foreign/TestVarArgs.java
> 
> 
> 
> ```java 
>         // Always allocate at least some memory so that zero-length segments 
> have distinct
>         // non-zero addresses.
>         alignedSize = Math.max(1, alignedSize);
> 
> 
> Here minimum-allocated size will be 1, which is incorrect because 
> 
> 
>     private static void initNativeMemory(long address, long byteSize) {
>         for (long i = 0; i < byteSize; i += Long.BYTES) {
>             UNSAFE.putLongUnaligned(null, address + i, 0);
>         }
>     }
> 
> `initNativeMemory()` is going to write Long.

Thanks for spotting this bug! It seems like a bug that I introduced, and so, 
thanks again!

-------------

Marked as reviewed by pminborg (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/27027#pullrequestreview-3172497772

Reply via email to