> 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 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/30540/files - new: https://git.openjdk.org/jdk/pull/30540/files/877f0a2d..9f28d642 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=30540&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=30540&range=00-01 Stats: 2 lines in 1 file changed: 2 ins; 0 del; 0 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
