[lworld] RFR: 8319967: [lworld] TypeAryPtr::cast_to_not_null_free hits assert(!not_null_free || !is_flat()) failed: inconsistency
Tobias Hartmann
thartmann at openjdk.org
Tue Nov 14 14:04:23 UTC 2023
I hit this very intermittent failure with stress testing and was able to extract a simple test. [JDK-8227634](https://bugs.openjdk.org/browse/JDK-8227634) added the following optimization: When casting an element loaded from an array to a known type, we use that type information to set not-null-free not-flat properties of the array (also when storing an object of a known type to an array). Now that optimization gets confused when we load a field of an element from a flat array. In the failing case (see `TestArrays::test150`), we load an Object field from a flat array element and cast it to String. The optimization then incorrectly assumes that we are casting the (primitive type) element and casts the array to not-flat which fails because the array is known to be flat. The actual fix is the additional `!ary_t->is_flat()` check in `GraphKit::gen_checkcast`. The rest is refactoring that changes `flat_array` to `flat_in_array` which is more precise.
Thanks,
Tobias
-------------
Commit messages:
- 8319967: [lworld] TypeAryPtr::cast_to_not_null_free hits assert(\!not_null_free || \!is_flat()) failed: inconsistency
Changes: https://git.openjdk.org/valhalla/pull/951/files
Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=951&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8319967
Stats: 111 lines in 13 files changed: 11 ins; 1 del; 99 mod
Patch: https://git.openjdk.org/valhalla/pull/951.diff
Fetch: git fetch https://git.openjdk.org/valhalla.git pull/951/head:pull/951
PR: https://git.openjdk.org/valhalla/pull/951
More information about the valhalla-dev
mailing list