RFR: 8235119: Incomplete initialization of scan_top values results in out-of-bounds scanning of regions

Stefan Johansson stefan.johansson at oracle.com
Thu Dec 19 17:06:47 UTC 2019

Hi Kim,

On 2019-12-19 17:47, Kim Barrett wrote:
>> On Dec 19, 2019, at 8:27 AM, Stefan Johansson <stefan.johansson at oracle.com> wrote:
>> Hi,
>> Please review this fix for JDK-8235119, it's intended for both JDK 14 and 15.
>> Webrev: http://cr.openjdk.java.net/~sjohanss/8235119/00/
>> Issue: https://bugs.openjdk.java.net/browse/JDK-8235119
>> Summary
>> When we parallelized the evacuation preparation in JDK-8141637 we made a small change to how we initialize the scan state. The problem with this change was that free and unavailable regions didn't get cleared and reset as before. This will lead to regions being allocated during the GC can have an inconsistent state.
>> This fix reverts a small part of JDK-8141637, so that we continue to clear and reset all regions regardless of state and then just update the state for the regions needing it.
>> Testing
>> Functional testing in mach5 tier1-3 and Kim has done manual verification with tests that previously reproduced the failure.
>> Also big thanks to Kim, Sangheon and Thomas for all the work with reproducing and digging into the issue.
>> Cheers,
>> Stefan
> Looks good.
Thanks for the review. I will push this to jdk-14 tomorrow afternoon.
> I dislike the casts, but understand why they are there.  It seems there are inconsistencies
> regarding the range for number of regions, with some code using size_t and other code
> using uint.  It would be good to clean that up, but that should be a separate RFE from this
> bug fix.

I totally agree, I actually looked at how much needed to change to get 
better consistency here but I came to the same conclusion, that it was 
out of scope for this change. I don't have time to create the RFE right 
now, so feel free to create one if you like.


More information about the hotspot-gc-dev mailing list