RFR: 8159237: PreservedMarks verification code fails

Stefan Karlsson stefan.karlsson at oracle.com
Fri Jun 10 12:18:08 UTC 2016

Hi all,

Please review this patch to fix a recently introduced bug in the 
verification code of the preserved marks code:


The bug was introduced when the following code:

volatile size_t total_size = 0; ... for (uint i = 0; i < _num; i += 1) {
total_size += get(i)->size();

was moved into a separate function and the address to total_size was 
passed as an argument to the new function. The new function incorrectly 
updates the pointer and not the variable that the pointer points to:

total_size_addr += preserved_marks_set->get(i)->size();

The suggested fix for the bug is:

- total_size_addr += preserved_marks_set->get(i)->size();
+ *total_size_addr += preserved_marks_set->get(i)->size();


More information about the hotspot-gc-dev mailing list