RFR (XS) 8066679: jvmtiRedefineClasses.cpp assert cache ptrs must match
Daniel D. Daugherty
daniel.daugherty at oracle.com
Tue Apr 7 16:44:37 UTC 2015
On 3/25/15 7:16 PM, serguei.spitsyn at oracle.com wrote:
> Please, review the fix for:
> Open hotspot webrev:
I concur that the old assertions are bad. They assume that
the cached class file bytes on the scratch_class must match
the cached class file bytes on the target class. That's a
valid assumption in a RedefineClasses() only world, but that's
not true when RetransformClasses() is used.
This will be hard to test. I think the race can only happen
on the first retransform of a class. If you have two parallel
retransform threads, both see that there are no cached bytes
so both cache the initial bytes and then both have to update
the cached bytes pointer at about the same time... Very hard
> There can be multiple concurrent RetransformClasses calls on
> different threads.
> So that, the assert "cache ptrs must match" is incorrect as it was
> based on wrong assumptions.
> The fix removes two related asserts and also frees the scratch_class
> if it is necessary to avoid leaking the memory.
> In progress: nsk redefine classes tests, JTREG java/lang/instrument
More information about the hotspot-dev