RFR: 8258380: [JVMCI] don't clear InstalledCode reference when unloading JVMCI nmethods

Vladimir Kozlov kvn at openjdk.java.net
Tue Dec 15 17:35:02 UTC 2020


On Tue, 15 Dec 2020 07:00:40 GMT, Tom Rodriguez <never at openjdk.org> wrote:

> We have been getting crashes running our unit tests in our gates with JDK15. The crashes are mostly in nmethod::is_unloaded because IsUnloadingBehaviour::current() is null. It seemed like there was some inconsistency in the notion of is_unloading for JVMCI nmethods that was leading to the crashes. I noticed that the is_unloading path rescans the nmethod using a closure to determine if it's unloading and since make_unloaded will clear the InstalledCode reference at the end if you ran the closure again it might return false since the oop is now null instead of being an unmarked oop. There's no point in the clearly the oop in this path anyway since the nmethod is dead and leaving the oop around seem to solve this crash. We're only see this crash in 15 but I don't see why it couldn't occur in 11 or later.

As noted in JBS report this fix needs to be re-based to JDK 16 repo (with new PR) and pushed there.
It will be automatically forward ported into JDK 17 later.

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

Changes requested by kvn (Reviewer).

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


More information about the hotspot-compiler-dev mailing list