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

William Kemper wkemper at openjdk.org
Fri Sep 2 21:36:11 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.

William Kemper has updated the pull request incrementally with two additional commits since the last revision:

 - Fix zero build
 - Fix off-by-one error in off-by-one fix

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

Changes:
  - all: https://git.openjdk.org/shenandoah/pull/160/files
  - new: https://git.openjdk.org/shenandoah/pull/160/files/28945aca..b8abe52e

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=shenandoah&pr=160&range=01
 - incr: https://webrevs.openjdk.org/?repo=shenandoah&pr=160&range=00-01

  Stats: 2 lines in 2 files changed: 1 ins; 0 del; 1 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