summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2017-08-03 05:06:28 -0700
committer Andreas Gampe <agampe@google.com> 2017-08-23 13:56:30 -0700
commit12fadcd25e30c832b055d0ce37ad11e85a1829c2 (patch)
tree0270ba6d251ec44f5e11d910de6e4b1daece5438 /compiler/driver/compiler_driver.cc
parent2ee17e69110a9ef98ea8c94219c7da23b918ef3f (diff)
ART: Rerun verifier in verbose mode on boot cp failure
When we fail to verify a boot classpath class during boot image compilation, re-run the verifier in verbose mode to print soft failures before aborting. Bug: 64290614 Test: m test-art-host Test: manual Change-Id: I1c875ee4a5a73f80b7f8b75be35ed885bc0bf427
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r--compiler/driver/compiler_driver.cc20
1 files changed, 18 insertions, 2 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index 037e45840d..7ea75ebd4c 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -2110,8 +2110,24 @@ class VerifyClassVisitor : public CompilationVisitor {
// invokes once verifier support is fully implemented.
if (manager_->GetCompiler()->GetCompilerOptions().IsBootImage() &&
!android::base::StartsWith(descriptor, "Ljava/lang/invoke/")) {
- DCHECK(klass->IsVerified()) << "Boot classpath class " << klass->PrettyClass()
- << " failed to fully verify: state= " << klass->GetStatus();
+ if (!klass->IsVerified()) {
+ // Re-run verification to get all failure messages if it soft-failed.
+ if (!klass->IsErroneous()) {
+ gLogVerbosity.verifier = true;
+ // Note: We can't call ClassLinker::VerifyClass, as it will elide the second
+ // verification.
+ Runtime* runtime = Runtime::Current();
+ std::string v_error;
+ verifier::MethodVerifier::VerifyClass(soa.Self(),
+ klass.Get(),
+ runtime->GetCompilerCallbacks(),
+ runtime->IsAotCompiler(),
+ verifier::HardFailLogMode::kLogInternalFatal,
+ &v_error);
+ }
+ LOG(FATAL) << "Boot classpath class " << klass->PrettyClass()
+ << " failed to fully verify: state= " << klass->GetStatus();
+ }
}
if (klass->IsVerified()) {
DCHECK_EQ(failure_kind, verifier::FailureKind::kNoFailure);