JDK-8315321 : [aix] os::attempt_reserve_memory_at must map at the requested address or fail
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11,17,21,22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: aix
  • Submitted: 2023-08-30
  • Updated: 2023-09-07
  • Resolved: 2023-09-01
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 22
22 b14Fixed
Related Reports
Relates :  
Description
There is a long standing bug on our AIX-port that may cause `os::attempt_reserve_memory_at()` to return a different address than requested. 

All other implementations - usually just using mmap(2) - will unmap again if the attach address differs from the requested one.

On AIX, we use either mmap or shmat, depending on some internal logic and our page size goal. If we use shmat (mostly this is the default nowadays) we may end up with an address mapped to the next lower segment boundary. Not only may this round down the requested address by SHMLBA, but it has been observed to result in a very high address if the requested address had been very low (e.g. attempting to map below 0x20_0000 gave us 0xa00_0100_a000_0000). I assume (not having the sources to the AIX kernel) that this is either the result of a wraparound while looking for the next lower segment boundary, or it is a segment chosen at random.

Whatever the reason for that behavior, the contract for `os::attempt_reserve_memory_at()` is to return an address at that exact address, and not somewhere nearby or far away.
Comments
Changeset: c32e340d Author: Thomas Stuefe <stuefe@openjdk.org> Date: 2023-09-01 11:05:34 +0000 URL: https://git.openjdk.org/jdk/commit/c32e340d94524de018c7c72e162ae3fee4953d06
01-09-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/15481 Date: 2023-08-30 08:15:36 +0000
30-08-2023