RFR: 8262896: [macos_aarch64] Crash in jni_fast_GetLongField

Anton Kozlov akozlov at openjdk.java.net
Tue Apr 13 11:03:57 UTC 2021


On Tue, 13 Apr 2021 10:04:20 GMT, Andrew Haley <aph at openjdk.org> wrote:

> Looking at this further, the use of W^X for functions like this one, callable from JNI code, makes no sense.
> These functions are never written to once they have been generated. Could we generate them during init into a non-executable page, then remap that page as read/execute only? Then we wouldn't have to care about the state of W^X.

Indeed, this code does not need to be changed after it was generated. But I don't think it will be easy to implement simple remapping (due security restrictions). It would be helpful if we could unlock only a part of the code cache for writing, leaving the other executable, but I don't know immediate way to do this.

Probably I'll convert this to draft. Meanwhile it is still worth to fix the random crash. What do you think about this patch compared to turning off fast JNI accessors?

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

PR: https://git.openjdk.java.net/jdk/pull/3422


More information about the hotspot-dev mailing list