JDK-8234359 : [JVMCI] invalidate_nmethod_mirror shouldn't use a phantom reference
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,14
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-11-18
  • Updated: 2020-03-23
  • Resolved: 2019-11-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 14
11.0.7-oracleFixed 14 b25Fixed
Description
While testing the latest JVMCI in JDK11 crashes were occurring during draining of the SATB buffers.  The problem was tracked down to invalidate_nmethod_mirror being called on an nmethod whose InstalledCode instance was also dead in the current GC.  Reading this oop using NativeAccess<ON_PHANTOM_OOP_REF> lead to that oop being enqueued in the SATB buffer.  In JDK 14 it appears some other change in G1 disables those barriers at the point this code is executed but in JDK11 no such logic exists.  This code never resurrect that oop so using the normal AS_NO_KEEPALIVE semantics is correct avoids attempting to enqueue the potentially dead object.
Comments
OpenJDK 11 updates backport will follow after larger Graal integration, see https://github.com/oracle/graal/issues/2196
11-03-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/b0a649295f25 User: never Date: 2019-11-25 19:13:22 +0000
25-11-2019