diff options
author | Sebastien Hertz <shertz@google.com> | 2015-04-07 10:28:53 +0200 |
---|---|---|
committer | Sebastien Hertz <shertz@google.com> | 2015-04-07 10:55:26 +0200 |
commit | ca068b2385ba160367d1e7fd123317b851b99390 (patch) | |
tree | 7a8c20069c3d3bae136d6760b52be5b6c4dc7daf /runtime/hprof | |
parent | 1b8e8cac2c96f6d2af8e7217f997a30e11c098b5 (diff) | |
download | art-ca068b2385ba160367d1e7fd123317b851b99390.zip art-ca068b2385ba160367d1e7fd123317b851b99390.tar.gz art-ca068b2385ba160367d1e7fd123317b851b99390.tar.bz2 |
Ignore not yet loaded classes during hprof
Skips classes that are no yet loaded because we cannot access its
fields nor its superclass. This CL fixes a crash observed during the
run-test 130-hprof.
Bug: 20040824
Change-Id: Ia618b6c1579d35dfd726726ca6d2ff4258d8a841
Diffstat (limited to 'runtime/hprof')
-rw-r--r-- | runtime/hprof/hprof.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/hprof/hprof.cc b/runtime/hprof/hprof.cc index d6a6595..cdb3e2a 100644 --- a/runtime/hprof/hprof.cc +++ b/runtime/hprof/hprof.cc @@ -949,6 +949,10 @@ void Hprof::DumpHeapObject(mirror::Object* obj) { } void Hprof::DumpHeapClass(mirror::Class* klass) { + if (!klass->IsLoaded() && !klass->IsErroneous()) { + // Class is allocated but not yet loaded: we cannot access its fields or super class. + return; + } size_t sFieldCount = klass->NumStaticFields(); if (sFieldCount != 0) { int byteLength = sFieldCount * sizeof(JValue); // TODO bogus; fields are packed |