JDK-8323610 : G1: HeapRegion pin count should be size_t to avoid overflows
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 22,23
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-01-11
  • Updated: 2024-01-23
  • Resolved: 2024-01-15
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 JDK 23
22Fixed 23 b06Fixed
Related Reports
Relates :  
Description
Currently G1's heap region pin count is an uint, which might overflow with 4B nested GetCriticalPrimitiveArray.
This may overflow with reasonable effort.

Extend to size_t (64 bits) for safety.
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk22/pull/75 Date: 2024-01-15 10:57:45 +0000
15-01-2024

Changeset: 8643cc21 Author: Thomas Schatzl <tschatzl@openjdk.org> Date: 2024-01-15 09:35:50 +0000 URL: https://git.openjdk.org/jdk/commit/8643cc21333c6b51242ed3b9295b25f372244755
15-01-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/17390 Date: 2024-01-12 08:45:30 +0000
12-01-2024

E.g. some benchmark which does 7M pins/s (if it never unpinned) would overflow the existing counter within a few minutes, with the extended size this would take a very long time. There is no known issue because of that.
12-01-2024