On Wed, 1 Apr 2026 16:15:04 GMT, Igor Veresov <[email protected]> wrote:

> The problem here is that after method redefinition we still retain an MTD 
> object pointing to the old `Method*`. When this old method is eventually GCed 
> we end up with a dangling pointer, which when dereferenced leads potentially 
> to a crash if this area of metaspace has been overwritten by something else.
> 
> The solution is to remove pointers to redefined Methods and Klasses from the 
> training data after redefinition and preventing the re-addition of those 
> again. I also added some verification to check the training data stays clean.
> 
> This change will go in after #30517 is pushed.

This pull request has now been integrated.

Changeset: c18e3a33
Author:    Igor Veresov <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/c18e3a3377e67f50ab065d1ac9365c7d43950fb6
Stats:     127 lines in 6 files changed: 111 ins; 10 del; 6 mod

8379819: Creating AOT configuration crashes in MethodTrainingData::prepare

Reviewed-by: iklam, kvn

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

PR: https://git.openjdk.org/jdk/pull/30540

Reply via email to