RFR: Fix off-by-one error when verifying object registrations

William Kemper wkemper at openjdk.org
Fri Sep 2 17:01:42 UTC 2022


This change originally started with an effort to fix a build error caused by using the global `malloc` and `free` calls. Replacing these calls with hotspot idioms caused remembered set verification errors. The verification errors were, ultimately, due to the verification code reading past the end of an array. The `NEW_C_HEAP_ARRAY` macro tacks a bit of information onto the allocated array for the purpose of tracking native memory use (NMT). This was enough to change the behavior when the verifier read past the end of the array. This PR subsumes https://github.com/openjdk/shenandoah/pull/155 and fixes the root cause of the verification errors. This change also removes the unused `overreach_map` as this was also using global `malloc` and `free` calls.

-------------

Commit messages:
 - Removed unused header
 - Merge branch 'shenandoah-master' into fix-verifier-off-by-one
 - Do not attempt to validate cards beyond the lost valid card
 - Remove unused overreach map
 - Merge branch 'shenandoah-master' into use-os-malloc
 - Revert to global malloc
 - Update another use of global malloc/free
 - Use os::malloc instead of malloc

Changes: https://git.openjdk.org/shenandoah/pull/160/files
 Webrev: https://webrevs.openjdk.org/?repo=shenandoah&pr=160&range=00
  Stats: 116 lines in 5 files changed: 21 ins; 88 del; 7 mod
  Patch: https://git.openjdk.org/shenandoah/pull/160.diff
  Fetch: git fetch https://git.openjdk.org/shenandoah pull/160/head:pull/160

PR: https://git.openjdk.org/shenandoah/pull/160


More information about the shenandoah-dev mailing list