RFR: 8355915: [leyden] Crash in MDO clearing the unloaded array type [v3]

Vladimir Ivanov vlivanov at openjdk.org
Thu May 1 19:00:02 UTC 2025


On Wed, 30 Apr 2025 10:01:58 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> Caught this when doing benchmarks with Spring Boot. See the bug for reproducer.
>> 
>> The lifecycle of array types of `T` is bound to the lifecycle of `T` themselves. So the fix does similar thing to `is_excluded` and other code: when we encounter the `T[]`, we ask if its bottom component classes is not yet initialized. This fits nicely with our current uses, which skip such classes, and ever touch their (potentially nullptr) CLDs.
>> 
>> Additional testing:
>>  - [x] Ad-hoc testing with most recent spring-boot-petclinic
>>  - [x] Linux x86_64 server fastdebug, `runtime/cds`
>
> Aleksey Shipilev has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
> 
>  - Co-opt Igor's fix
>  - Merge branch 'premain' into JDK-8355915-mdo-array-crash
>  - More robust fix
>  - Fix
>  - Fix

src/hotspot/share/oops/methodData.cpp line 352:

> 350:         continue; // skip not-yet-initialized classes // TODO: maybe clear the slot instead?
> 351:       }
> 352:       if (always_clean || !k->is_loader_present_and_alive() || is_excluded(k)) {

In the longer term, the thing which concerns me about it is that both `is_excluded()` (and `is_klass_loaded()` in `ciMethodData.cpp`) are deliberately limited to Leyden-related modes while `k->is_loader_present_and_alive()` is performed unconditionally across all execution modes. Seeing a Klass with a missing CLD during normal execution mode is a sign of a bug in some other place.

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

PR Review Comment: https://git.openjdk.org/leyden/pull/64#discussion_r2070661760


More information about the leyden-dev mailing list