Bug of FFM implementation when creating upcalls accepting both structure and pointer parameters
Jorn Vernee
jorn.vernee at oracle.com
Mon Jul 14 13:10:58 UTC 2025
Thanks for the report!
I've filed: https://bugs.openjdk.org/browse/JDK-8362169
Jorn
On 14-7-2025 00:13, Chuigda Whitegive wrote:
> Original StackOverflow question and answer: https://stackoverflow.com/a/79700269/14312575
>
> Brief: on Windows platform, when creating upcall stubs with FFM APIs, if the callback functions has both structure (larger than pointer size) and pointer parameters, the MemorySegments accepting these pointer parameters will be incorrectly linked with a confined memory session. Also, according to the answer of Jorn Vernee, this issue may also reproduce on platforms whose C ABI allocates structs that are passed by-value on the stack of the caller (AArch64 for example).
>
> The reproducer has been attached in the email.
More information about the panama-dev
mailing list