RFR: 8309475: Test java/foreign/TestByteBuffer.java fails: a problem with msync (aix) [v2]

Martin Doerr mdoerr at openjdk.org
Thu Aug 10 19:25:29 UTC 2023


On Mon, 31 Jul 2023 21:52:25 GMT, Tyler Steele <tsteele at openjdk.org> wrote:

>> This change adds additional support to MappedByteBuffer::force which delegates to msync on AIX. Specifically, it checks whether and error with errno set to EINVAL is the cause of a msync call to an address mmapped with the MAP_PRIVATE flag set. If this flag is set, then the msync call EINVAL is expected, and can be ignored as per the Java documentation of the force method.
>> 
>>> In particular, the method has no effect for buffers mapped in read-only or private mapping modes. [1]
>> 
>> Separated into separate file as per recommendation by @AlanBateman.
>> 
>> [1] https://download.java.net/java/early_access/jdk21/docs/api/java.base/java/nio/MappedByteBuffer.html#force()
>
> Tyler Steele has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains four commits:
> 
>  - Re-Removes problem list entry
>  - Maintain linux-specific definition for minicore_vec_t
>  - Separate AIX MappedMemoryUtils to new file. Add force0 implementation
>  - Replace vm_page_size call with sysconf(_SC_PAGESIZE) in javaClasses.cpp

src/java.base/aix/native/libnio/MappedMemoryUtils.c line 140:

> 138:             return;
> 139:         } else if (map_entry->pr_vaddr <= end_address &&
> 140:                    end_address <= map_entry->pr_vaddr + map_entry->pr_size) {

MappedMemoryUtils.c:140:55: error: arithmetic on a pointer to void is a GNU extension [-Werror,-Wgnu-pointer-arith]
                   end_address <= map_entry->pr_vaddr + map_entry->pr_size) {
                                  ~~~~~~~~~~~~~~~~~~~ ^

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14964#discussion_r1290573098


More information about the nio-dev mailing list