RFR(S): 8251860: ClassLoaderData::loaded_classes_do fails with "assert(ZAddress::is_marked(addr)) failed: Should be marked"
calvin.cheung at oracle.com
calvin.cheung at oracle.com
Wed Aug 26 21:35:37 UTC 2020
bug: https://bugs.openjdk.java.net/browse/JDK-8251860
webrev: http://cr.openjdk.java.net/~ccheung/jdk16/8251860/webrev.00/
Please refer to the bug report for an analysis of the crash.
The proposed fix is to acquire the ClassLoaderDataGraph_lock before
calling ClassLoaderDataGraph::loaded_classes_do(&link_closure). The
link_closure will not do the actual linking but just to store the
InstanceKlass'es in an array and increment the keep_alive counter of the
class_loader_data of each InstanceKlass. After the call to
ClassLoaderDataGraph::loaded_classes_do, each InstanceKlass in the array
will be linked and the keep_alive counter of the class_loader_data will
be decremented.
Testing:
- tested about 40 times on the MacOS host where the crash was seen
(before the fix, the crash was seen about once in 20 runs)
- Tier1 - 4.
thanks,
Calvin
More information about the hotspot-runtime-dev
mailing list