ART: Weaken boot classpath initialization check
Only abort in debug builds. Warn in non-debug mode.
Bug: 33265291
Test: m test-art-host
Change-Id: I288303cd7790a8b796f8b0717170861ea65e1f8c
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index f98f364..9917770 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -240,10 +240,11 @@
ScopedLocalRef<jthrowable> cause(env, env->ExceptionOccurred());
CHECK(cause.get() != nullptr);
- // Boot classpath classes should not fail initialization.
- if (!Runtime::Current()->IsAotCompiler()) {
+ // Boot classpath classes should not fail initialization. This is a sanity debug check. This
+ // cannot in general be guaranteed, but in all likelihood leads to breakage down the line.
+ if (klass->GetClassLoader() == nullptr && !Runtime::Current()->IsAotCompiler()) {
std::string tmp;
- CHECK(klass->GetClassLoader() != nullptr) << klass->GetDescriptor(&tmp);
+ LOG(kIsDebugBuild ? FATAL : WARNING) << klass->GetDescriptor(&tmp) << " failed initialization";
}
env->ExceptionClear();