JDK-8221456 : nmethod::make_unloaded() clears _method member too early
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,12,13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-03-26
  • Updated: 2019-10-08
  • Resolved: 2019-03-27
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 13
11.0.6-oracleFixed 13 b14Fixed
Related Reports
Duplicate :  
Description
nmethod::make_unloaded() clears the _method member too early, before passing the nmethod to the CollectedHeap::unregister_nmethod(). This is not what happens when an nmethod is unregistered via nmethod::make_not_entrant_or_zombie(). We should align this behavior. Clearing the _method member after it has been unregistered is useful, since the GC can then print the method name/signature in logs, etc. Moving the clearing of _method until after CollectedHeap::unregister_nmethod() should be a safe and uncontroversial thing to do.

Today, ZGC can crash if -Xlog:gc+nmethod=debug is used and an nmethod is unloaded via nmethod::make_unloaded(), because it tries to log the name of the method.
Comments
Fix Request ZGC can crash without the patch. The patch is rather trivial. The transplanted patch applies with minimal fuzz. tier1 and tier2 pass with the patch. There was no testcase provided with the original fix.
08-10-2019