RFR: 8328306: AArch64: MacOS lazy JIT "write xor execute" switching [v3]

Thomas Stuefe stuefe at openjdk.org
Tue Aug 19 05:34:44 UTC 2025


On Tue, 19 Aug 2025 00:12:34 GMT, Dean Long <dlong at openjdk.org> wrote:

>>> Only the hotspot code should write into the code cache, right? A more secure alternative would be then to use `os::address_is_in_vm()`. That compares against the text segment of the libjvm. Prevents accidental misdiagnosis of writes from anywhere (including possibly deliberate ones).
>> 
>> True, but is `dladdr(3)` safe to call from a sighandler on BSD? I don't know, but I wouldn't have thought so.
>
> To make it safe to call from a signal handler, we could take a snapshot of the boundaries during startup, something like what os::get_loaded_modules_info() does.

Yes, we should do that. As you say, we do this on Windows already. 

The only slight problem is that dladdr does not give me the end of the last mappings belonging to libjvm.so, only the base address. We also have multiple mappings. I only ever saw them being loaded adjacent to each other, but am not sure if that is guaranteed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26562#discussion_r2284101581


More information about the hotspot-dev mailing list