RFR(XS) 8191585 VM anonymous classes created during CDS dump time cause crash

Ioi Lam ioi.lam at oracle.com
Tue Mar 6 19:20:12 UTC 2018


Please review this small VM change and the corresponding test case.


The crash happens in the following code:

class CombineDictionariesClosure : public CLDClosure {
     void do_cld(ClassLoaderData* cld) {
       if (cld->is_system_class_loader_data() || 
cld->is_platform_class_loader_data()) {
         for (int i = 0; i < cld->dictionary()->table_size(); ++i) {
                                  ^^^^^^^^^^^ == NULL

The bug is in cld->is_system_class_loader_data() -- the CLD of anon 
classes have a NULL
cld::dictionary(), but its cld::class_loader() returns the loader object 
of the holder

The fix is to reject if cld::is_anonymous() is true.

- Ioi

More information about the hotspot-runtime-dev mailing list