summaryrefslogtreecommitdiffstats
path: root/runtime/hprof
diff options
context:
space:
mode:
authorSebastien Hertz <shertz@google.com>2015-04-07 10:28:53 +0200
committerSebastien Hertz <shertz@google.com>2015-04-07 10:55:26 +0200
commitca068b2385ba160367d1e7fd123317b851b99390 (patch)
tree7a8c20069c3d3bae136d6760b52be5b6c4dc7daf /runtime/hprof
parent1b8e8cac2c96f6d2af8e7217f997a30e11c098b5 (diff)
downloadart-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.cc4
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