RFR: 8325108: POSIX map_memory_to_file calls release_memory incorrectly [v3]
Thomas Stuefe
stuefe at openjdk.org
Fri Aug 2 14:32:35 UTC 2024
On Thu, 1 Aug 2024 12:54:03 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> 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 two additional commits since the last revision:
>
> - Fix the formatting
> - Assert was incorrect.
+1 (embarrassing... how did I miss that.)
-------------
Marked as reviewed by stuefe (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/17669#pullrequestreview-2215725890
More information about the hotspot-runtime-dev
mailing list