JDK-8239004 : [lworld] Unsafe.makePrivateBuffer should return an Object
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: repo-valhalla
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2020-02-13
  • Updated: 2024-07-10
  • Resolved: 2024-07-10
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.
Other
repo-valhallaResolved
Related Reports
Blocks :  
Duplicate :  
Description
Unsafe.makePrivateBuffer currently returns an inline type which allows flattening in containers and scalarization on the stack which in turn leads to loss of the larval bit and Unsafe.put* assert or potentially not having any effect. It should return an Object.

We might also want to fail at checkcast when the larval bit is set (not sure though about the cost/benefit ratio, we could as well just treat it as user error).

JDK-8239003 keeps track of the required C2 changes once this is in.
Comments
Will be fixed by JDK-8239003.
10-07-2024