RFR (XS): JDK-8025728: Missing volatile specifier for field G1AllocRegion::_alloc_region
Siebenborn, Axel
axel.siebenborn at sap.com
Wed Oct 2 07:16:37 UTC 2013
Hi
We investigated some crashes on AIX using the G1 collector. We compiled the HotSpot with IBM XLC12. The reason for the crashes is, that XLC creates code which loads _alloc_region's value and compares it against NULL. Later on, it reloads _alloc_region from memory and uses that new value without another null-check. The problem is that meanwhile another thread has set the _alloc_region's value to NULL.
While one may argue that the code generated by XLC is not very elegant it is still correct from a C++ point of view. And we can't be sure that other compilers do not generate similar code.
Fortunately, this behavior can be easily prevented by declaring _alloc_region as volatile pointer.
Could you please review the following webrev:
http://www.sapjvm.com/as/webrevs/8025728/
Regards,
Axel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20131002/c2138e65/attachment.htm>
More information about the hotspot-gc-dev
mailing list