JDK-8275049 : [ZGC] missing null check in ZNMethod::log_register
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 17,18
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • CPU: ppc
  • Submitted: 2021-10-11
  • Updated: 2021-10-18
  • Resolved: 2021-10-13
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 17 JDK 18
17.0.2Fixed 18 b19Fixed
Related Reports
Relates :  
Description
We are getting SIGSEGV when running the test "runtime/logging/RedefineClasses.java" with ZGC on PPC64.

The VM crashes while trying to read (*p)->klass() in "ZNMethod::log_register". ā€˜p’ points to an Oops table slot in an nmethod which contains a null Oop.

This happens on PPC64, because C1 allocates Oop slots for PatchingStubs and initializes them to null. (The actual Oop will get inserted during execution time when the PatchingStub gets executed.)
"ZNMethod::log_register" needs to be able to deal with null Oops on PPC64 for this reason.

Note: C1 PatchingStubs are not used on aarch64 and x86_64 uses Oops embedded into the instruction stream instead of the nmethod Oop slots.

Comments
Fix Request (17u): Prerequisite for backport of ZGC on PPC64. VM crashes in logging code without this fix. Tested in jdk18. No regression. Fix is simple and applies cleanly.
15-10-2021

Changeset: cf828673 Author: Martin Doerr <mdoerr@openjdk.org> Date: 2021-10-13 07:12:52 +0000 URL: https://git.openjdk.java.net/jdk/commit/cf828673a9b76fd3f26db9a3f714166861a65c9e
13-10-2021