RFR: 8358537: (bf) JavaNioAccess::getBufferAddress bypasses direct buffer MemorySession state check [v2]
Brian Burkhalter
bpb at openjdk.org
Wed Jun 4 18:12:50 UTC 2025
On Wed, 4 Jun 2025 17:09:07 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
> Discussed this with the rest of the Panama team. The way it works currently (without this PR) is how it's intended to work.
Thank you for the elucidation: that is very helpful.
Perhaps some comments need to be added in strategic places to clarify the situation to avoid similar confusion in the future? This PR arose out of #25531, in particular when [it was suggested](https://github.com/openjdk/jdk/pull/25531#discussion_r2115194676) to access the address of the direct buffer via `IOUtil.bufferAddress` which calls `JavaNioAccess.getBufferAddress`. A failure was expected for buffers created from shared `Arena`s but none occurred, and it looked like there had been an oversight in the buffer address access protocol.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25631#issuecomment-2940936917
More information about the nio-dev
mailing list