Revert "Add Crash Keys support"

This reverts commit 02103b276b.

Reason for revert: Speculative revert for breakage on roll:
https://chromium-review.googlesource.com/c/chromium/src/+/1650264

Failing build in breakpad:
https://ci.chromium.org/p/chromium/builders/try/linux_chromium_asan_rel_ng/298512

Original change's description:
> Add Crash Keys support
> 
> This adds crash keys containing the isolate address and addresses of
> the read_only, map, and code spaces to crash report minidumps.
> When not compiling V8 with Chrome, a noop implementation is used.
> 
> Bug: v8:9323
> Change-Id: I8523630e7a4ff792855163c06bf76dab35b1b9e5
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1641326
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Commit-Queue: Irina Yatsenko <irinayat@microsoft.com>
> Cr-Commit-Position: refs/heads/master@{#62059}

TBR=jkummerow@chromium.org,tmrts@chromium.org,irinayat@microsoft.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: v8:9323
Change-Id: I29138292dd474cf60e2bf3cc9b0629a085abd31c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1649787
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62077}
This commit is contained in:
Maya Lekova 2019-06-11 10:12:04 +02:00 committed by Commit Bot
parent 05611feb34
commit 06930f7420
6 changed files with 0 additions and 152 deletions

View File

@ -2148,7 +2148,6 @@ v8_source_set("v8_base_without_compiler") {
"src/diagnostics/code-tracer.h",
"src/diagnostics/compilation-statistics.cc",
"src/diagnostics/compilation-statistics.h",
"src/diagnostics/crash-key.h",
"src/diagnostics/disasm.h",
"src/diagnostics/disassembler.cc",
"src/diagnostics/disassembler.h",
@ -3280,30 +3279,10 @@ v8_source_set("v8_base_without_compiler") {
}
}
v8_source_set("v8_crash_keys") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
if (build_with_chromium) {
deps = [
"//components/crash/core/common:crash_key",
]
sources = [
"src/diagnostics/crash-key.cc",
]
} else {
sources = [
"src/diagnostics/crash-key-noop.cc",
]
}
configs = [ ":internal_config" ]
}
group("v8_base") {
public_deps = [
":v8_base_without_compiler",
":v8_compiler",
":v8_crash_keys",
]
}
@ -3783,7 +3762,6 @@ if (v8_use_snapshot && current_toolchain == v8_snapshot_toolchain) {
visibility = [ ":*" ] # Only targets in this file can depend on this.
sources = [
"src/diagnostics/crash-key-noop.cc",
"src/snapshot/embedded/embedded-file-writer.cc",
"src/snapshot/embedded/embedded-file-writer.h",
"src/snapshot/embedded/platform-embedded-file-writer-aix.cc",

View File

@ -1,3 +0,0 @@
include_rules = [
"+components/crash/core/common/crash_key.h",
]

View File

@ -1,19 +0,0 @@
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Noop implementation of crash keys to be used by targets that don't support
// crashpad.
#include "src/diagnostics/crash-key.h"
namespace v8 {
namespace internal {
namespace crash {
void AddCrashKey(int id, const char* name, uintptr_t value) {
}
} // namespace crash
} // namespace internal
} // namespace v8

View File

@ -1,59 +0,0 @@
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/diagnostics/crash-key.h"
#include "components/crash/core/common/crash_key.h"
#include <string>
#include <sstream>
namespace v8 {
namespace internal {
namespace crash {
using CrashKeyInstance = crash_reporter::CrashKeyString<kKeySize>;
static CrashKeyInstance crash_keys[] = {
{"v8-0", CrashKeyInstance::Tag::kArray},
{"v8-1", CrashKeyInstance::Tag::kArray},
{"v8-2", CrashKeyInstance::Tag::kArray},
{"v8-3", CrashKeyInstance::Tag::kArray},
{"v8-4", CrashKeyInstance::Tag::kArray},
{"v8-5", CrashKeyInstance::Tag::kArray},
{"v8-6", CrashKeyInstance::Tag::kArray},
{"v8-7", CrashKeyInstance::Tag::kArray},
{"v8-8", CrashKeyInstance::Tag::kArray},
{"v8-9", CrashKeyInstance::Tag::kArray},
{"v8-10", CrashKeyInstance::Tag::kArray},
{"v8-11", CrashKeyInstance::Tag::kArray},
{"v8-12", CrashKeyInstance::Tag::kArray},
{"v8-13", CrashKeyInstance::Tag::kArray},
{"v8-14", CrashKeyInstance::Tag::kArray},
{"v8-15", CrashKeyInstance::Tag::kArray},
};
void AddCrashKey(int id, const char* name, uintptr_t value) {
static int current = 0;
if (current > kMaxCrashKeysCount) {
return;
}
if (current == kMaxCrashKeysCount) {
static crash_reporter::CrashKeyString<1> over("v8-too-many-keys");
over.Set("1");
current++;
return;
}
auto& trace_key = crash_keys[current];
std::stringstream stream;
stream << name << " " << id << " 0x" << std::hex << value;
trace_key.Set(stream.str().substr(0, kKeySize));
current++;
}
} // namespace crash
} // namespace internal
} // namespace v8

View File

@ -1,34 +0,0 @@
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Conflicts between v8/src/base and base prevent from including
// components/crash/core/common/crash_key.h into most of v8's files, so have to
// provide wrappers to localize the include to v8/src/base/crash-key.cc only.
#ifndef V8_DIAGNOSTICS_CRASH_KEY_H_
#define V8_DIAGNOSTICS_CRASH_KEY_H_
#include <stdint.h>
namespace v8 {
namespace internal {
namespace crash {
// Crash keys must be statically allocated so we'll have a few slots for
// pointer values and will log if we run out of space. The pointer value will
// be combined with the given name and id. Names should be sufficiently short
// to fit key_size limit.
// The crash key in the dump will look similar to:
// {"v8-0", "isolate 0 0x21951a41d90"}
// (we assume a pointer is being logged and we convert it to hex).
constexpr int kKeySize = 64;
constexpr int kMaxCrashKeysCount = 16;
void AddCrashKey(int id, const char* name, uintptr_t value);
} // namespace crash
} // namespace internal
} // namespace v8
#endif // V8_DIAGNOSTICS_CRASH_KEY_H_

View File

@ -32,7 +32,6 @@
#include "src/debug/debug.h"
#include "src/deoptimizer/deoptimizer.h"
#include "src/diagnostics/compilation-statistics.h"
#include "src/diagnostics/crash-key.h"
#include "src/execution/frames-inl.h"
#include "src/execution/isolate-inl.h"
#include "src/execution/messages.h"
@ -3284,19 +3283,6 @@ bool Isolate::InitWithSnapshot(ReadOnlyDeserializer* read_only_deserializer,
return Init(read_only_deserializer, startup_deserializer);
}
static void AddCrashKeysForIsolateAndHeapPointers(Isolate* isolate) {
const int id = isolate->id();
crash::AddCrashKey(id, "isolate", reinterpret_cast<uintptr_t>(isolate));
auto heap = isolate->heap();
crash::AddCrashKey(id, "ro_space",
reinterpret_cast<uintptr_t>(heap->read_only_space()->first_page()));
crash::AddCrashKey(id, "map_space",
reinterpret_cast<uintptr_t>(heap->map_space()->first_page()));
crash::AddCrashKey(id, "code_space",
reinterpret_cast<uintptr_t>(heap->code_space()->first_page()));
}
bool Isolate::Init(ReadOnlyDeserializer* read_only_deserializer,
StartupDeserializer* startup_deserializer) {
TRACE_ISOLATE(init);
@ -3542,7 +3528,6 @@ bool Isolate::Init(ReadOnlyDeserializer* read_only_deserializer,
PrintF("[Initializing isolate from scratch took %0.3f ms]\n", ms);
}
AddCrashKeysForIsolateAndHeapPointers(this);
return true;
}