RFR 8005056: NPG: Crash after redefining java.lang.Object
Coleen Phillimore
coleen.phillimore at oracle.com
Thu May 9 07:22:14 PDT 2013
Dan,
Thank you for adding serviceability. I'll provide more detail on the
change if needed. Here's some additional detail.
What I did was added a closure to pass to
ClassLoaderDataGraph::classes_do() function. This function walks all
the loaded classes, which includes the array classes. The
SystemDicitonary walk only walks loaded InstanceKlasses. The array
classes created are linked from the InstanceKlass in _array_klasses and
the code used to walk them separately. The code for switching to the
new methods from the old methods didn't change very much.
The reason we have to change the vtables in array classes is because
array classes are inherited from java/lang/Object class and have this
vtable. We had missed the ones for arrays of basic types created in
universe. The old code never fixed these entries but it didn't crash
because the methodOops were followed with the basic type array classes
in their vtable so wouldn't go away. With permgen removal, we
explicitly delete unreferenced Method objects so these ones have to be
replaced. And it's more correct because you don't want to call the old
Method.
Coleen
On 05/09/2013 09:55 AM, Daniel D. Daugherty wrote:
> Adding Serviceability to this review thread since this concerns
> JVM/TI RedefineClasses().
>
> Coleen, this will take a bit of time to review.
>
> Dan
>
>
> On 5/8/13 8:51 PM, Coleen Phillimore wrote:
>> Summary: Need to walk array class vtables replacing old methods too
>> if j.l.o is redefined
>>
>> Array methods aren't in the SystemDictionary and the code that was
>> there didn't walk the basic type array classes defined in universe.
>> It also walked the same classes more than once. Use the
>> ClassLoaderDataGraph class walking instead.
>>
>> open webrev at http://cr.openjdk.java.net/~coleenp/8005056/
>> bug link at http://bugs.sun.com/view_bug.do?bug_id=8005056
>>
>> Tested with all redefine classes tests, jdk java/lang/instrument
>> tests, hotspot jtreg tests.
>>
>> Thanks,
>> Coleen
>>
>
More information about the serviceability-dev
mailing list