On Mon, 28 Jul 2025 14:53:34 GMT, Markus Grönlund <mgron...@openjdk.org> wrote:
>> Greetings, >> >> The following change set addresses the data loss resulting in the assertion >> "Missing object ID X in pool jdk.types.Method". >> >> It involves three components: >> >> 1. Address a regression introduced by >> [JDK-835221](https://bugs.openjdk.org/browse/JDK-8352251). By locating >> JFR_ONLY(Jfr::check_and_process_sample_request(thread);) before the >> global_poll() in SafepointMechanism::process(), a stacktrace can be >> captured, and artifacts tagged, during a safepoint. This breaks an invariant >> as artifacts, i.e. methods, can be tagged in the wrong epoch (also a >> stacktrace can be stored in the wrong epoch). Must be moved to post >> global_poll(). >> >> 2. Retransform/Redefine classes include a non-safe copy of Method trace >> flags, leading to stale bits being set onto the new Methods. Method trace >> flags need to be copied, but must be done under a safepoint. >> >> 3. It seems that there has been an increase in the frequency of issuing >> calls to InstanceKlass::purge_previous_versions(), making scratch klasses >> and old methods disappear before JFR gets the chance to serialize also >> tagged old methods. Therefore, we need to ensure that we always tag the >> latest version of a Method. >> >> There is also a cleanup of gratuitous type conversions, from Klass* to >> InstanceKlass* in the newly introduced MethodTracing subsystem. >> >> Testing: jdk_jfr, stress testing >> >> Thank you >> Markus > > Markus Grönlund has updated the pull request incrementally with one > additional commit since the last revision: > > removed unused Marked as reviewed by egahlin (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/26458#pullrequestreview-3063256275