RFR: 8325108: POSIX map_memory_to_file calls release_memory incorrectly [v2]

Johan Sjölen jsjolen at openjdk.org
Thu Aug 1 11:46:55 UTC 2024


> Hi,
> 
> This PR fixes a small bug where `os::map_memory_to_file` attempts to unmap an incorrect mapping by calling `os::release_memory`. If NMT is turned on this will lead to a JVM crash, as the region was not previously mapped.
> 
> I'm fairly sure that this branch is actually dead code as `MAP_FIXED` is appended to the flags of the mmap call, and according to my man pages on mmap this will lead to mmap failing instead of giving another mapping to the address. However, I'd rather be on the safe side than sorry so I only do the minimal changes necessary to fix the bug.

Johan Sjölen has updated the pull request incrementally with one additional commit since the last revision:

  Assert instead

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/17669/files
  - new: https://git.openjdk.org/jdk/pull/17669/files/1f7684ee..2d562dce

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=17669&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=17669&range=00-01

  Stats: 6 lines in 1 file changed: 0 ins; 4 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/17669.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17669/head:pull/17669

PR: https://git.openjdk.org/jdk/pull/17669


More information about the hotspot-runtime-dev mailing list