Integrated: 7124710: interleaved RedefineClasses() and RetransformClasses() calls may have a problem

Alex Menkov amenkov at openjdk.org
Sat Oct 8 15:57:54 UTC 2022


On Thu, 25 Aug 2022 21:16:22 GMT, Alex Menkov <amenkov at openjdk.org> wrote:

> The problem is RedefineClasses does not update cached_class_bytes, so subsequent RetransformClasses gets obsolete class bytes (this are testcases 3-6 from the new test)
> 
> cached_class_bytes are set when an agent instruments the class from ClassFileLoadHook.
> After successful RedefineClasses it should be reset.
> The fix updates ClassFileLoadHook caller to not use old cached_class_bytes with RedefineClasses (if some agent instruments the class, new cached_class_bytes are allocated for scratch_class) and updates cached_class_bytes after successful RedefineClasses or RetransformClasses.

This pull request has now been integrated.

Changeset: 495c0435
Author:    Alex Menkov <amenkov at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/495c043533d68106e07721b2e971006e9eba97e3
Stats:     594 lines in 4 files changed: 577 ins; 9 del; 8 mod

7124710: interleaved RedefineClasses() and RetransformClasses() calls may have a problem

Reviewed-by: sspitsyn, dcubed

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

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


More information about the serviceability-dev mailing list