Commit 28551958 authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

Extend error messages for blob or isolate verification failures

Bug: v8:7777
Change-Id: I781ac51ba740655c644e19388c6cadad7267b18c
Reviewed-on: https://chromium-review.googlesource.com/c/1478209
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59765}
parent 85b80cb7
......@@ -218,7 +218,12 @@ void Isolate::SetEmbeddedBlob(const uint8_t* blob, uint32_t blob_size) {
// Verify that the contents of the embedded blob are unchanged from
// serialization-time, just to ensure the compiler isn't messing with us.
EmbeddedData d = EmbeddedData::FromBlob();
CHECK_EQ(d.EmbeddedBlobHash(), d.CreateEmbeddedBlobHash());
if (d.EmbeddedBlobHash() != d.CreateEmbeddedBlobHash()) {
FATAL(
"Embedded blob checksum verification failed. This indicates that the "
"embedded blob has been modified since compilation time. A common "
"cause is a debugging breakpoint set within builtin code.");
}
#endif // DEBUG
}
......@@ -3407,12 +3412,20 @@ bool Isolate::Init(StartupDeserializer* des) {
// Initialize the builtin entry table.
Builtins::UpdateBuiltinEntryTable(this);
#ifdef DEBUG
// Verify that the current heap state (usually deserialized from the snapshot)
// is compatible with the embedded blob. If this DCHECK fails, we've likely
// loaded a snapshot generated by a different V8 version or build-time
// configuration.
DCHECK(IsolateIsCompatibleWithEmbeddedBlob(this));
if (!IsolateIsCompatibleWithEmbeddedBlob(this)) {
FATAL(
"The Isolate is incompatible with the embedded blob. This is usually "
"caused by incorrect usage of mksnapshot. When generating custom "
"snapshots, embedders must ensure they pass the same flags as during "
"the V8 build process (e.g.: --turbo-instruction-scheduling).");
}
DCHECK_IMPLIES(FLAG_jitless, FLAG_embedded_builtins);
#endif // DEBUG
#ifndef V8_TARGET_ARCH_ARM
// The IET for profiling should always be a full on-heap Code object.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment