JDK-8320331 : G1 Full GC Heap verification relies on metadata not reset before verification
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-11-17
  • Updated: 2024-04-23
  • Resolved: 2023-11-22
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 22
22 b26Fixed
Related Reports
Blocks :  
Description
During Full GC "during gc" verification (-XX:VerifyDuringGC) g1 accesses the heap from top() to bottom() as if it were fully parsable.

This is wrong, because we already started class unloading in phase 1/marking (full gc "during gc" verification is right after phase 1), but the region's parsable bottom's are not set correctly (i.e. are bottom()) and since verification walks heap region object by object it  accesses nominally unloaded klass data.

There is no issue at this point as metaspace data has not really been unloaded yet, but if we want to move metaspace purging to an earlier stage this will be an issue.

I.e. keeping this behavior would make JDK-8317809 uglier than necessary.
Comments
Fix request [21u] I backport this as prereq of JDK-8317809. Low risk, rather simple modification. Clean backport. SAP nightly testing passed.
23-04-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk21u-dev/pull/519 Date: 2024-04-22 09:02:27 +0000
22-04-2024

Changeset: 1629a905 Author: Thomas Schatzl <tschatzl@openjdk.org> Date: 2023-11-22 17:17:11 +0000 URL: https://git.openjdk.org/jdk/commit/1629a9059bd2e0f07559a384be4276c7dc13eff2
22-11-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/16733 Date: 2023-11-20 11:24:12 +0000
20-11-2023

Found during testing of JDK-8317809. I think other STW collectors have the same issue (at least Serial GC), accessing objects with nominally unloaded data but not yet fully scrapped during full gc. Will file extra CRs if necessary.
17-11-2023