JDK-7009756 : volatile variables could be broken throw reflection API
Type:Bug
Component:hotspot
Sub-Component:compiler
Affected Version:7
Priority:P3
Status:Closed
Resolution:Fixed
OS:generic
CPU:x86
Submitted:2010-12-30
Updated:2011-03-08
Resolved:2011-03-08
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.
See example in attachement.
Bug is reproduced with -server on sparc after several iterations.
Originally was found by JR test.
Comments
PUBLIC COMMENTS
Unsafe_SetLongVolatile() and Unsafe_GetLongVolatile() are not atomic
on 32 bit x86 (C++ generates two 32 bit loads/stores).
Use Atomic::load() and Atomic::store() to access a volatile long.