RFR: 8027630 SIGSEGV in const char*Klass::external_name()
staffan.larsen at oracle.com
Fri Nov 15 01:47:51 PST 2013
The StackFrameInfo class used when creating stack dumps from the management APIs keeps references to Methods. This is similar to what BacktraceBuilder does when creating stack traces in java_lang_Throwable::fill_in_stack_trace(). For permgen removal, BacktraceBuilder was updated to add a reference to the holder class of the methods, otherwise these classes can be unloaded.
This fix adds the same kind of code to StackFrameInfo so that it now has an oop reference to the class. The new pop has been added to the oops_do() method.
In addition, the Method reference needs to be made visible to the MetadataOnStackMark class. To fix this a long chain of metadata_do() calls have been added.
I would really like to create a test for this race, but can’t figure out a reliable way to do so.
More information about the serviceability-dev