> 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 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 four additional commits since 
the last revision:

 - Add test by Ioi
 - Merge branch 'master' into 8379819-cleanup-td-redef
 - Fix no-CDS build
 - Cleanup TD after redefinition

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/30540/files
  - new: https://git.openjdk.org/jdk/pull/30540/files/9f28d642..a195ae19

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=30540&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=30540&range=01-02

  Stats: 22181 lines in 767 files changed: 11694 ins; 4198 del; 6289 mod
  Patch: https://git.openjdk.org/jdk/pull/30540.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/30540/head:pull/30540

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

Reply via email to