Skip to content

Commit

Permalink
Revert "Update Crashpad to 4375233ad2dad48f2332ecc20221df10f98b668a"
Browse files Browse the repository at this point in the history
This reverts commit 31fd846.

This causes debug Windows component builds to not run on Windows, giving the error below. Bruce & Rob tracked it to the change in util/BUILD.gn which adds mincore.lib

---------------------------
chrome.exe - System Error
---------------------------
The program can't start because api-ms-win-power-base-l1-1-0.dll is missing from your computer. Try reinstalling the program to fix this problem."


Original change's description:
> Update Crashpad to 4375233ad2dad48f2332ecc20221df10f98b668a
> 
> This includes a reland of 58866fc, which was reverted at
> 68255cb. The cause for the revert was addressed by upstream
> 82777cff5848.
> 
> 14dbd3531d98 gn win: Get main test binaries building
> 6cf4f928eb08 gn win: Add auxiliary test binaries used by
>              end_to_end_test.py
> 36679d572ba0 win: Don't assume offsets the same when
>              kDoesNotObserveDaylightSavingTime
> 9ab4fbf1e1a7 win: Improve child crash location test
> 798f6540435f gn win: Use new toolchain names to support both x86 and x64
> 83a83c5b0050 Roll mini_chromium to e7e8237
> a483e2c599b8 Fix names of Windows trybots after server-side rename
> 38b20ca57efc Relocate CaptureContext to misc and implement on Linux
> a8ad3bdbdfb1 linux: fix incorrect fallthrough
> 73e862e15a6c fuchsia: Exclude capture_context_test.cc from test build
> b83f4c731d8f Let UUID::InitializeFromString accept StringPiece16 too
> f878f155172b fuchsia: Add flock() stub to get test binaries linking
>              again
> e5bbdaff87a9 Pass FilePath to Settings in Initialize()
> c45ba7920e01 Make NewReport objects own their associated database
>              resources
> 7d5487fc44b3 minidump: add switch cases to handle linux/android and ARM
> c406797ce620 Add  UploadReport to manage database resources during
>              upload
> 7faa2ef89872 Get CrashpadInfo address via a .note, rather than dynamic
>              symtab
> 8d0d999d9245 Add a cross-platform database implementation
> b43858c9903f fuchsia: Start of ModuleSnapshot and ProcessReader
>              implementations
> 6667fa25595a fuchsia: Fixes to TestPaths
> 90cde8e30f7d Disable upload on Android
> 4094c2628d33 Address review comments for 8d0d999
> a4d7fb4cc390 Use .long for pointers on 32-bit platforms
> 5e5b927b38ca Build crashpad_client_linux.cc on Android
> eec1e17ab558 Fix two bugs in memset()ing CrashpadInfo on size mismatch
> 4717300fa4ce Reset CrashpadInfo after CrashpadInfoReader tests
> f9d160ffc6bb Revert "Reset CrashpadInfo after CrashpadInfoReader tests"
> 6798ba912e96 Reset CrashpadInfo after CrashpadInfoReader tests
> 0429216f59b1 linux: Add CrashReportExceptionHandler
> f38af628c9dc fuchsia: Don't fail rename if source == dest
> 040360239343 Fix
>              CrashpadInfoSizes_ClientOptions/CrashpadInfoSizes_ClientOpt
>              ions
> 10222b12362c fuchsia: Disable TimeZone.Basic test as timezones are non-
>              functional
> 5cb869392eed fuchsia: Compile out LoggingLock/UnlockFile, add DCHECKs to
>              Settings
> 4b7895615808 Add .hidden to CRASHPAD_NOTE_REFERENCE
> 8ee14eef08f3 fuchsia: Fix some packaging when run isn't from Crashpad
>              source root
> 4a9d422652a1 Turn fuchsia trybots on by default
> ec33c25797f9 fuchsia: Don't include sys/resource.h, recently removed
>              from SDK
> 8b738cd24d59 Don't include crash_report_database_generic.cc on Win/Mac
> d2a866978b89 Makes 'all' build on Linux
> d8d03172c278 arm: Capture context around pc and registers
> ebad8bd925c3 Don't spawn an upload thread if url is empty
> 0520fdff1edc linux: Move ScopedPrSetPtracer to util/
> 38540eaf71cb Add handler options for Linux/Android
> 01105719d767 linux: add CRASHPAD_SIMULATE_CRASH()
> 3dd85dc12638 fuchsia: Make ImageAnnotationReader[Test] work
> cab259330f2e fuchsia: Pass more data out of module snapshot
> 1aae5cedaf1e Refactor ModuleSnapshot(Linux|Fuchsia) into
>              ModuleSnapshotElf
> 4d96e4e504ef fuchsia: Return ModuleSnapshot* out of
>              ProcessSnapshotFuchsia
> 2290a826af1e Pull (most) platform-specific MemorySnapshots out
> 3030ae54171a fuchsia: Fix ninja auto-regen after run
> 61f1013ee4ef fuchsia: Add some thread reading to ProcessReader and a
>              test
> c69ba3d52783 non-win: Add
>              Multiprocess::SetExpectedChildTerminationBuiltinTrap()
> f130822b9f4b linux: Add CrashpadClient tests
> 2b05eb522fa4 Rename ProcessReader to platform-suffixed versions
> fa2a03fbdd0f linux: Add CrashpadClient::SetFirstChanceExceptionHandler()
> cd3afe616e63 Linux: Pull and use clang toolchain in third_party
> 8e80a575d15f Linux: Pull a sysroot if pulling a local clang
> fae18c2fc492 fuchsia: Add implementation of ThreadSnapshot
> a869ae18d256 Workaround for death test failure when in threadsafe mode
>              on Mac
> 8a12f5893050 fuchsia: Take bots off CQ pending flake investigation
> 9affa2a0e72d Optionally stub out the libcurl-based implementation of
>              HTTPTransport
> dec23bef5769 win gn: reintroduce flags to disable warnings
> 746ce1a63703 Roll mini_chromium to 987bde8
> 493e29bc3df0 win: Use correct format specifier
> a45e88602b90 Skip ELF notes with a p_vaddr of zero
> 71d90608828d Add Linux trybots to CQ
> 449506d59c6a Roll mini_chromium to ef0df11
> 82777cff5848 win: fix warnings when building with clang
> 23b2156fb694 Don’t read beyond a StringPiece’s bounds in
>              StringToNumber()
> 4375233ad2da win: fix 64-bit build
> 
> Also:
> Add new metrics enums values.
> Use new CrashReportDatabase interface.
> 
> Bug: crashpad:30, chromium:817982, chromium:818376
> Change-Id: Ib4fcc423f68a4c80907968498264413f3f229c5c
> Reviewed-on: https://chromium-review.googlesource.com/947745
> Commit-Queue: Chris Palmer <palmer@chromium.org>
> Reviewed-by: Sigurður Ásgeirsson <siggi@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#540894}

TBR=palmer@chromium.org,jperaza@chromium.org,mark@chromium.org,siggi@chromium.org

Change-Id: I2fbdde093d12fc1f93bd10478f6022effa0d8d2e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: crashpad:30, chromium:817982, chromium:818376
Reviewed-on: https://chromium-review.googlesource.com/950343
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541006}
  • Loading branch information
John Abd-El-Malek authored and Commit Bot committed Mar 6, 2018
1 parent d82b894 commit db6afd2
Show file tree
Hide file tree
Showing 182 changed files with 2,002 additions and 5,496 deletions.
17 changes: 11 additions & 6 deletions components/browser_watcher/postmortem_report_collector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,27 +224,30 @@ void PostmortemReportCollector::GenerateCrashReport(
DCHECK(report_proto);

// Prepare a crashpad report.
std::unique_ptr<CrashReportDatabase::NewReport> new_report;
CrashReportDatabase::NewReport* new_report = nullptr;
CrashReportDatabase::OperationStatus database_status =
report_database_->PrepareNewCrashReport(&new_report);
if (database_status != CrashReportDatabase::kNoError) {
LogCollectionStatus(PREPARE_NEW_CRASH_REPORT_FAILED);
return;
}
CrashReportDatabase::CallErrorWritingCrashReport
call_error_writing_crash_report(report_database_, new_report);

// Write the report to a minidump.
if (!WriteReportToMinidump(report_proto, client_id, new_report->ReportID(),
new_report->Writer())) {
if (!WriteReportToMinidump(report_proto, client_id, new_report->uuid,
reinterpret_cast<FILE*>(new_report->handle))) {
LogCollectionStatus(WRITE_TO_MINIDUMP_FAILED);
return;
}

// Finalize the report wrt the report database. Note that this doesn't trigger
// an immediate upload, but Crashpad will eventually upload the report (as of
// writing, the delay is on the order of up to 15 minutes).
call_error_writing_crash_report.Disarm();
crashpad::UUID unused_report_id;
database_status = report_database_->FinishedWritingCrashReport(
std::move(new_report), &unused_report_id);
new_report, &unused_report_id);
if (database_status != CrashReportDatabase::kNoError) {
LogCollectionStatus(FINISHED_WRITING_CRASH_REPORT_FAILED);
return;
Expand All @@ -257,9 +260,11 @@ bool PostmortemReportCollector::WriteReportToMinidump(
StabilityReport* report,
const crashpad::UUID& client_id,
const crashpad::UUID& report_id,
crashpad::FileWriterInterface* minidump_file) {
base::PlatformFile minidump_file) {
DCHECK(report);
return WritePostmortemDump(minidump_file, client_id, report_id, report);

crashpad::WeakFileHandleFileWriter writer(minidump_file);
return WritePostmortemDump(&writer, client_id, report_id, report);
}

} // namespace browser_watcher
11 changes: 5 additions & 6 deletions components/browser_watcher/postmortem_report_collector.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <vector>

#include "base/debug/activity_analyzer.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
Expand All @@ -24,7 +25,6 @@
#include "components/browser_watcher/stability_report_extractor.h"
#include "components/metrics/system_session_analyzer_win.h"
#include "third_party/crashpad/crashpad/client/crash_report_database.h"
#include "third_party/crashpad/crashpad/util/file/file_writer.h"

namespace browser_watcher {

Expand Down Expand Up @@ -94,11 +94,10 @@ class PostmortemReportCollector {
void GenerateCrashReport(const crashpad::UUID& client_id,
StabilityReport* report_proto);

virtual bool WriteReportToMinidump(
StabilityReport* report,
const crashpad::UUID& client_id,
const crashpad::UUID& report_id,
crashpad::FileWriterInterface* minidump_file);
virtual bool WriteReportToMinidump(StabilityReport* report,
const crashpad::UUID& client_id,
const crashpad::UUID& report_id,
base::PlatformFile minidump_file);

std::string product_name_;
std::string version_number_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class MockPostmortemReportCollector final : public PostmortemReportCollector {
bool(StabilityReport* report,
const crashpad::UUID& client_id,
const crashpad::UUID& report_id,
crashpad::FileWriterInterface* minidump_file));
base::PlatformFile minidump_file));
};

class MockSystemSessionAnalyzer : public metrics::SystemSessionAnalyzer {
Expand Down
28 changes: 19 additions & 9 deletions components/crash/content/app/minidump_with_crashpad_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,9 @@ bool MiniDumpWriteDumpWithCrashpadInfo(const base::Process& process,

// Appends the full contents of |source| to |dest| from the current position
// of |dest|.
bool AppendFileContents(base::File* source, crashpad::FileWriter* dest) {
bool AppendFileContents(base::File* source, base::PlatformFile dest) {
DCHECK(source && source->IsValid());
DCHECK(dest);
DCHECK_NE(base::kInvalidPlatformFile, dest);

// Rewind the source.
if (source->Seek(base::File::FROM_BEGIN, 0) == -1)
Expand All @@ -292,12 +292,16 @@ bool AppendFileContents(base::File* source, crashpad::FileWriter* dest) {
while (true) {
int bytes_read =
source->ReadAtCurrentPos(&buf[0], static_cast<int>(buf.size()));
if (bytes_read < 0)
if (bytes_read == -1)
return false;
if (bytes_read == 0)
break;

if (!dest->Write(&buf[0], static_cast<size_t>(bytes_read))) {
DWORD bytes_written = 0;
// Due to handle instrumentation, the destination can't be wrapped in
// a base::File, so we go basic Win32 API here.
if (!WriteFile(dest, &buf[0], bytes_read, &bytes_written, nullptr) ||
static_cast<int>(bytes_written) != bytes_read) {
return false;
}
}
Expand All @@ -319,12 +323,16 @@ bool DumpAndReportProcess(const base::Process& process,
if (!database)
return false;

std::unique_ptr<crashpad::CrashReportDatabase::NewReport> report;
crashpad::CrashReportDatabase::NewReport* report = nullptr;
crashpad::CrashReportDatabase::OperationStatus status =
database->PrepareNewCrashReport(&report);
if (status != crashpad::CrashReportDatabase::kNoError)
return false;

// Make sure we release the report on early exit.
crashpad::CrashReportDatabase::CallErrorWritingCrashReport on_error(
database.get(), report);

crashpad::UUID client_id;
crashpad::Settings* settings = database->GetSettings();
if (settings) {
Expand All @@ -349,14 +357,16 @@ bool DumpAndReportProcess(const base::Process& process,
// Write the minidump to the temp file, and then copy the data to the
// Crashpad-provided handle, as the latter is only open for write.
if (!MiniDumpWriteDumpWithCrashpadInfo(process, minidump_type, exc_info,
crash_keys, client_id,
report->ReportID(), &dump_file) ||
!AppendFileContents(&dump_file, report->Writer())) {
crash_keys, client_id, report->uuid,
&dump_file) ||
!AppendFileContents(&dump_file, report->handle)) {
return false;
}

on_error.Disarm();

crashpad::UUID report_id = {};
status = database->FinishedWritingCrashReport(std::move(report), &report_id);
status = database->FinishedWritingCrashReport(report, &report_id);
if (status != crashpad::CrashReportDatabase::kNoError)
return false;

Expand Down
2 changes: 1 addition & 1 deletion third_party/crashpad/README.chromium
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Name: Crashpad
Short Name: crashpad
URL: https://crashpad.chromium.org/
Version: unknown
Revision: 4375233ad2dad48f2332ecc20221df10f98b668a
Revision: a8ecdbc973d969a87aaa2efffb1668efb52b799d
License: Apache 2.0
License File: crashpad/LICENSE
Security Critical: yes
Expand Down
3 changes: 0 additions & 3 deletions third_party/crashpad/crashpad/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
/third_party/fuchsia/qemu
/third_party/fuchsia/sdk
/third_party/gtest/gtest
/third_party/linux/.cipd
/third_party/linux/clang
/third_party/linux/sysroot
/third_party/gyp/gyp
/third_party/mini_chromium/mini_chromium
/third_party/zlib/zlib
Expand Down
41 changes: 6 additions & 35 deletions third_party/crashpad/crashpad/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

vars = {
'chromium_git': 'https://chromium.googlesource.com',
'pull_linux_clang': False
}

deps = {
Expand All @@ -29,7 +28,7 @@ deps = {
'5e2b3ddde7cda5eb6bc09a5546a76b00e49d888f',
'crashpad/third_party/mini_chromium/mini_chromium':
Var('chromium_git') + '/chromium/mini_chromium@' +
'ef0df1119b40cfa2773d5960e239d4b960310869',
'3b953302848580cdf23b50402befc0ae09d03ff9',
'crashpad/third_party/zlib/zlib':
Var('chromium_git') + '/chromium/src/third_party/zlib@' +
'13dc246a58e4b72104d35f9b1809af95221ebda7',
Expand Down Expand Up @@ -116,37 +115,8 @@ hooks = [
},
{
# This uses “cipd install” so that mac-amd64 and linux-amd64 can coexist
# peacefully. “cipd ensure” would remove the macOS package when running on a
# Linux build host and vice-versa. https://crbug.com/789364. This package is
# only updated when the solution in .gclient includes an entry like:
# "custom_vars": { "pull_linux_clang": True }
'name': 'clang_linux',
'pattern': '.',
'condition': 'checkout_linux and pull_linux_clang',
'action': [
'cipd',
'install',
# sic, using Fuchsia team's generic build of clang for linux-amd64 to
# build for linux-amd64 target too.
'fuchsia/clang/linux-amd64',
'latest',
'-root', 'crashpad/third_party/linux/clang/linux-amd64',
'-log-level', 'info',
],
},
{
# If using a local clang ("pull_linux_clang" above), also pull down a
# sysroot.
'name': 'clang_linux',
'pattern': '.',
'condition': 'checkout_linux and pull_linux_clang',
'action': [
'crashpad/build/install_linux_sysroot.py',
],
},
{
# Same rationale for using "install" rather than "ensure" as for first clang
# package. https://crbug.com/789364.
# peacefully. “cipd ensure” would remove the Linux package when running on a
# macOS build host and vice-versa. https://crbug.com/789364.
'name': 'fuchsia_clang_mac',
'pattern': '.',
'condition': 'checkout_fuchsia and host_os == "mac"',
Expand All @@ -160,8 +130,9 @@ hooks = [
],
},
{
# Same rationale for using "install" rather than "ensure" as for first clang
# package. https://crbug.com/789364.
# This uses “cipd install” so that mac-amd64 and linux-amd64 can coexist
# peacefully. “cipd ensure” would remove the macOS package when running on a
# Linux build host and vice-versa. https://crbug.com/789364.
'name': 'fuchsia_clang_linux',
'pattern': '.',
'condition': 'checkout_fuchsia and host_os == "linux"',
Expand Down
8 changes: 3 additions & 5 deletions third_party/crashpad/crashpad/build/BUILDCONFIG.gn
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if (current_cpu == "") {

if (current_os == "win") {
set_default_toolchain(
"//third_party/mini_chromium/mini_chromium/build:msvc_toolchain_$current_cpu")
"//third_party/mini_chromium/mini_chromium/build:msvc_toolchain")
} else {
set_default_toolchain(
"//third_party/mini_chromium/mini_chromium/build:gcc_like_toolchain")
Expand All @@ -54,10 +54,8 @@ _default_configs = [
]

_default_executable_configs =
_default_configs + [
"//third_party/mini_chromium/mini_chromium/build:executable",
"//third_party/mini_chromium/mini_chromium/build:win_console",
]
_default_configs +
[ "//third_party/mini_chromium/mini_chromium/build:executable" ]

set_defaults("source_set") {
configs = _default_configs
Expand Down
74 changes: 0 additions & 74 deletions third_party/crashpad/crashpad/build/install_linux_sysroot.py

This file was deleted.

Loading

0 comments on commit db6afd2

Please sign in to comment.