RFR: 8338566: Missing membar in ciEnv::get_or_create_exception before publishing handle
Aleksey Shipilev
shade at openjdk.org
Wed Sep 11 14:45:05 UTC 2024
On Wed, 11 Sep 2024 14:17:30 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
> Similar to [JDK-8251923](https://bugs.openjdk.org/browse/JDK-8251923), we need a store-store barrier before publishing a handle because otherwise another thread could observe the handle before it's fully initialized and read null from it. This affects architectures with a weak memory model like AArch64.
>
> Unfortunately, this only happened twice in our testing and I was never able to reproduce it.
>
> Thanks,
> Tobias
I think we better fix it in `JNIHandles::make_global`, since both [JDK-8251923](https://bugs.openjdk.org/browse/JDK-8251923) and this bug shows how fragile and hard to reproduce this failure mode is. Let's hear from others?
I don't mind this PR to go in, if we follow it with the RFE that replaces the per-use `storestore`-s with a (pun intended) more global one.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20950#issuecomment-2343878865
More information about the hotspot-compiler-dev
mailing list