diff options
| author | 2017-04-04 10:09:05 -0700 | |
|---|---|---|
| committer | 2017-04-04 10:09:05 -0700 | |
| commit | d66def32a2d7ee5e7c5225dce52b980b63bce91c (patch) | |
| tree | e1f6db3a25115e85537fb35882179f3e6f7d6d62 | |
| parent | 8682fce2634c392510b98ab0b08544a7336143b3 (diff) | |
ART: Fix preloaded dex cache expectations
In fallback mode, there may not be dex caches for all boot classpath
dex files - there is no guarantee that a class from every dex file
has been loaded.
Bug: 36033084
Test: m
Test: m test-art-host
Test: manual - fill the /data partition, reboot
Change-Id: I3752b48d9d61947959e8056bd01db0e323724d37
| -rw-r--r-- | runtime/native/dalvik_system_VMRuntime.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/native/dalvik_system_VMRuntime.cc b/runtime/native/dalvik_system_VMRuntime.cc index 6ca951fd53..11f850524d 100644 --- a/runtime/native/dalvik_system_VMRuntime.cc +++ b/runtime/native/dalvik_system_VMRuntime.cc @@ -451,8 +451,12 @@ static void PreloadDexCachesStatsFilled(DexCacheStats* filled) Thread* const self = Thread::Current(); for (const DexFile* dex_file : class_linker->GetBootClassPath()) { CHECK(dex_file != nullptr); + // In fallback mode, not all boot classpath components might be registered, yet. + if (!class_linker->IsDexFileRegistered(self, *dex_file)) { + continue; + } ObjPtr<mirror::DexCache> const dex_cache = class_linker->FindDexCache(self, *dex_file); - CHECK(dex_cache != nullptr); // Boot class path dex caches are never unloaded. + DCHECK(dex_cache != nullptr); // Boot class path dex caches are never unloaded. for (size_t j = 0; j < dex_cache->NumStrings(); j++) { ObjPtr<mirror::String> string = dex_cache->GetResolvedString(dex::StringIndex(j)); if (string != nullptr) { |