[lworld] Integrated: 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 16:29:02 UTC 2023


On Tue, 14 Nov 2023 13:57:59 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

> 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

This pull request has now been integrated.

Changeset: 6be441a4
Author:    Tobias Hartmann <thartmann at openjdk.org>
URL:       https://git.openjdk.org/valhalla/commit/6be441a4decbd85cd51c26e1699a34bbc2281d24
Stats:     111 lines in 13 files changed: 11 ins; 1 del; 99 mod

8319967: [lworld] TypeAryPtr::cast_to_not_null_free hits assert(!not_null_free || !is_flat()) failed: inconsistency

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

PR: https://git.openjdk.org/valhalla/pull/951



More information about the valhalla-dev mailing list