JDK-8344168 : Change Unsafe base offset from int to long
  • Type: Enhancement
  • Component: core-libs
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-11-14
  • Updated: 2025-02-10
  • Resolved: 2025-01-30
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 25
25 b09Fixed
Related Reports
Causes :  
Relates :  
Description
The type of the Unsafe base offset constant is int, which may cause overflow when adding int offsets, such as 8343925 (PR #22012). 8343984 (PR #22027) fixes most of the offset overflows in JDK, but ArraysSupport and CRC32C are still unfixed.

[~liach] proposed the idea of ​​changing the Unsafe base offset to long, which is a complete solution to the Unsafe offset overflow. 
Comments
Changeset: fdfb68c8 Branch: master Author: Shaojin Wen <swen@openjdk.org> Date: 2025-01-30 15:57:13 +0000 URL: https://git.openjdk.org/jdk/commit/fdfb68c8d0fddfe527291a7f4b75176c830dbb49
30-01-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/22095 Date: 2024-11-14 05:32:34 +0000
14-11-2024