RFR: JDK-8257828: SafeFetch may crash if invoked in non-JavaThreads [v2]
Thomas Stuefe
stuefe at openjdk.java.net
Sat Dec 12 07:26:56 UTC 2020
On Thu, 10 Dec 2020 07:49:55 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Thomas Stuefe has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Make SafeFetch work on Windows + AIX fix
>
> Hi Thomas,
> This looks good - I like the common handling (though I dislike the need for the zero case :( ).
> Thanks,
> David
Hi,
I made this work on Windows too (thanks @kimbarrett for reminding me). This involved fixing `HandleException`, which is
roughly the pendant of ucontext_set_pc() for Windows. I also combined dumplicate coding for the three Windows architectures.
I excluded the `os_safefetch_negative` gtest for Windows, that won't work as long as we miss SEH for gtests, see https://bugs.openjdk.java.net/browse/JDK-8185734. This is not a big deal though since the `os_safefetch_negative_at_safepoint` gtest still works, which tests SafeFetch in the VMThread. I experimented with locally adding a SEH catcher around the SafeFetch call in the test, but I removed that coding because it introduced too much complexity for little gain.
I also fixed a small issue for AIX where the zero page is readable so we need another guaranteed-to-be-invalid address. Since we need invalid addresses in a number of places in text code, I plan to centralize this definition at some point.
Thanks, Thomas
-------------
PR: https://git.openjdk.java.net/jdk/pull/1695
More information about the hotspot-runtime-dev
mailing list