JDK-8178490 : Usages of is_object_aligned with pointers are broken
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9,10
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-04-11
  • Updated: 2017-08-25
  • Resolved: 2017-06-26
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 10
10 b21Fixed
Related Reports
Relates :  
Description
is_object_aligned only works correctly for sizes measured in words.

When a pointer is passed into:
inline bool is_object_aligned(intptr_t addr) {
  return addr == align_object_size(addr);
}

inline intptr_t align_object_size(intptr_t size) {                                                                                                                                                                                            
  return align_size_up(size, MinObjAlignment);                                                                                                                                                                                                
} 

the pointer is incorrectly interpreted as a word size and the alignment is checked against MinObjectAligment instead of MinObjectAlignmentInBytes.

This was found while working on JDK-8178489.