On Wed, 1 Apr 2026 17:22:55 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.
>
> Igor Veresov has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Fix no-CDS build

Looks good to me.

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

Marked as reviewed by kvn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/30540#pullrequestreview-4046304843

Reply via email to