2015-11-06 10:52:09 -08:00
|
|
|
|
// Copyright 2014 The Crashpad Authors. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
|
//
|
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
//
|
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
|
|
#include "handler/handler_main.h"
|
|
|
|
|
|
2017-02-07 13:55:48 -05:00
|
|
|
|
#include <errno.h>
|
2015-11-06 10:52:09 -08:00
|
|
|
|
#include <getopt.h>
|
2016-01-06 12:22:50 -05:00
|
|
|
|
#include <stdint.h>
|
2015-11-06 10:52:09 -08:00
|
|
|
|
#include <stdlib.h>
|
2017-02-07 13:55:48 -05:00
|
|
|
|
#include <sys/types.h>
|
2015-11-06 10:52:09 -08:00
|
|
|
|
|
|
|
|
|
#include <map>
|
2016-04-25 12:13:07 -07:00
|
|
|
|
#include <memory>
|
2015-11-06 10:52:09 -08:00
|
|
|
|
#include <string>
|
2015-12-09 17:36:32 -05:00
|
|
|
|
#include <utility>
|
2017-02-22 13:39:46 -05:00
|
|
|
|
#include <vector>
|
2015-11-06 10:52:09 -08:00
|
|
|
|
|
2015-11-09 16:29:25 -05:00
|
|
|
|
#include "base/auto_reset.h"
|
2017-02-22 13:39:46 -05:00
|
|
|
|
#include "base/compiler_specific.h"
|
2015-11-06 10:52:09 -08:00
|
|
|
|
#include "base/files/file_path.h"
|
|
|
|
|
#include "base/files/scoped_file.h"
|
|
|
|
|
#include "base/logging.h"
|
2016-09-16 13:21:50 -07:00
|
|
|
|
#include "base/metrics/persistent_histogram_allocator.h"
|
2015-11-09 16:29:25 -05:00
|
|
|
|
#include "base/scoped_generic.h"
|
2015-11-06 10:52:09 -08:00
|
|
|
|
#include "base/strings/utf_string_conversions.h"
|
|
|
|
|
#include "build/build_config.h"
|
|
|
|
|
#include "client/crash_report_database.h"
|
|
|
|
|
#include "client/crashpad_client.h"
|
2016-01-05 15:09:00 -05:00
|
|
|
|
#include "client/prune_crash_reports.h"
|
2015-11-06 10:52:09 -08:00
|
|
|
|
#include "handler/crash_report_upload_thread.h"
|
2016-01-05 15:09:00 -05:00
|
|
|
|
#include "handler/prune_crash_reports_thread.h"
|
2016-01-06 12:22:50 -05:00
|
|
|
|
#include "tools/tool_support.h"
|
2015-11-06 10:52:09 -08:00
|
|
|
|
#include "util/file/file_io.h"
|
2017-02-07 13:55:48 -05:00
|
|
|
|
#include "util/misc/metrics.h"
|
|
|
|
|
#include "util/numeric/in_range_cast.h"
|
2015-11-06 10:52:09 -08:00
|
|
|
|
#include "util/stdlib/map_insert.h"
|
|
|
|
|
#include "util/stdlib/string_number_conversion.h"
|
|
|
|
|
#include "util/string/split_string.h"
|
|
|
|
|
#include "util/synchronization/semaphore.h"
|
|
|
|
|
|
|
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
|
#include <libgen.h>
|
2015-11-09 16:29:25 -05:00
|
|
|
|
#include <signal.h>
|
|
|
|
|
|
2015-11-06 10:52:09 -08:00
|
|
|
|
#include "base/mac/scoped_mach_port.h"
|
|
|
|
|
#include "handler/mac/crash_report_exception_handler.h"
|
|
|
|
|
#include "handler/mac/exception_handler_server.h"
|
|
|
|
|
#include "util/mach/child_port_handshake.h"
|
|
|
|
|
#include "util/mach/mach_extensions.h"
|
|
|
|
|
#include "util/posix/close_stdio.h"
|
|
|
|
|
#elif defined(OS_WIN)
|
|
|
|
|
#include <windows.h>
|
2015-11-09 16:29:25 -05:00
|
|
|
|
|
2015-11-06 10:52:09 -08:00
|
|
|
|
#include "handler/win/crash_report_exception_handler.h"
|
|
|
|
|
#include "util/win/exception_handler_server.h"
|
|
|
|
|
#include "util/win/handle.h"
|
2016-10-21 13:08:18 -07:00
|
|
|
|
#include "util/win/initial_client_data.h"
|
2017-02-22 13:39:46 -05:00
|
|
|
|
#include "util/win/session_end_watcher.h"
|
2015-11-06 10:52:09 -08:00
|
|
|
|
#endif // OS_MACOSX
|
|
|
|
|
|
|
|
|
|
namespace crashpad {
|
|
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
|
|
void Usage(const base::FilePath& me) {
|
|
|
|
|
fprintf(stderr,
|
|
|
|
|
"Usage: %" PRFilePath " [OPTION]...\n"
|
|
|
|
|
"Crashpad's exception handler server.\n"
|
|
|
|
|
"\n"
|
|
|
|
|
" --annotation=KEY=VALUE set a process annotation in each crash report\n"
|
|
|
|
|
" --database=PATH store the crash report database at PATH\n"
|
|
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
|
" --handshake-fd=FD establish communication with the client over FD\n"
|
|
|
|
|
" --mach-service=SERVICE register SERVICE with the bootstrap server\n"
|
|
|
|
|
#elif defined(OS_WIN)
|
2016-10-21 13:08:18 -07:00
|
|
|
|
" --initial-client-data=HANDLE_request_crash_dump,\n"
|
|
|
|
|
" HANDLE_request_non_crash_dump,\n"
|
|
|
|
|
" HANDLE_non_crash_dump_completed,\n"
|
|
|
|
|
" HANDLE_pipe,\n"
|
|
|
|
|
" HANDLE_client_process,\n"
|
|
|
|
|
" Address_crash_exception_information,\n"
|
|
|
|
|
" Address_non_crash_exception_information,\n"
|
|
|
|
|
" Address_debug_critical_section\n"
|
|
|
|
|
" use precreated data to register initial client\n"
|
2016-01-06 09:59:54 -08:00
|
|
|
|
#endif // OS_MACOSX
|
2016-09-16 13:21:50 -07:00
|
|
|
|
" --metrics-dir=DIR store metrics files in DIR (only in Chromium)\n"
|
2016-01-06 09:59:54 -08:00
|
|
|
|
" --no-rate-limit don't rate limit crash uploads\n"
|
2017-02-15 19:54:19 -05:00
|
|
|
|
" --no-upload-gzip don't use gzip compression when uploading\n"
|
2016-01-06 09:59:54 -08:00
|
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
|
" --reset-own-crash-exception-port-to-system-default\n"
|
|
|
|
|
" reset the server's exception handler to default\n"
|
|
|
|
|
#elif defined(OS_WIN)
|
2015-11-06 10:52:09 -08:00
|
|
|
|
" --pipe-name=PIPE communicate with the client over PIPE\n"
|
|
|
|
|
#endif // OS_MACOSX
|
|
|
|
|
" --url=URL send crash reports to this Breakpad server URL,\n"
|
|
|
|
|
" only if uploads are enabled for the database\n"
|
|
|
|
|
" --help display this help and exit\n"
|
|
|
|
|
" --version output version information and exit\n",
|
|
|
|
|
me.value().c_str());
|
|
|
|
|
ToolSupport::UsageTail(me);
|
|
|
|
|
}
|
|
|
|
|
|
2017-02-22 13:39:46 -05:00
|
|
|
|
// Calls Metrics::HandlerLifetimeMilestone, but only on the first call. This is
|
|
|
|
|
// to prevent multiple exit events from inadvertently being recorded, which
|
|
|
|
|
// might happen if a crash occurs during destruction in what would otherwise be
|
|
|
|
|
// a normal exit, or if a CallMetricsRecordNormalExit object is destroyed after
|
|
|
|
|
// something else logs an exit event.
|
|
|
|
|
void MetricsRecordExit(Metrics::LifetimeMilestone milestone) {
|
|
|
|
|
static bool once = [](Metrics::LifetimeMilestone milestone) {
|
|
|
|
|
Metrics::HandlerLifetimeMilestone(milestone);
|
|
|
|
|
return true;
|
|
|
|
|
}(milestone);
|
|
|
|
|
ALLOW_UNUSED_LOCAL(once);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Calls MetricsRecordExit() to record a failure, and returns EXIT_FAILURE for
|
|
|
|
|
// the convenience of callers in main() which can simply write “return
|
|
|
|
|
// ExitFailure();”.
|
|
|
|
|
int ExitFailure() {
|
|
|
|
|
MetricsRecordExit(Metrics::LifetimeMilestone::kFailed);
|
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class CallMetricsRecordNormalExit {
|
|
|
|
|
public:
|
|
|
|
|
CallMetricsRecordNormalExit() {}
|
|
|
|
|
~CallMetricsRecordNormalExit() {
|
|
|
|
|
MetricsRecordExit(Metrics::LifetimeMilestone::kExitedNormally);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(CallMetricsRecordNormalExit);
|
|
|
|
|
};
|
|
|
|
|
|
2015-11-09 16:29:25 -05:00
|
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
|
|
2017-02-22 13:39:46 -05:00
|
|
|
|
void InstallSignalHandler(const std::vector<int>& signals,
|
|
|
|
|
void (*handler)(int, siginfo_t*, void*)) {
|
|
|
|
|
struct sigaction sa = {};
|
|
|
|
|
sigemptyset(&sa.sa_mask);
|
|
|
|
|
sa.sa_flags = SA_SIGINFO;
|
|
|
|
|
sa.sa_sigaction = handler;
|
|
|
|
|
|
|
|
|
|
for (int sig : signals) {
|
|
|
|
|
int rv = sigaction(sig, &sa, nullptr);
|
|
|
|
|
PCHECK(rv == 0) << "sigaction " << sig;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RestoreDefaultSignalHandler(int sig) {
|
|
|
|
|
struct sigaction sa = {};
|
|
|
|
|
sigemptyset(&sa.sa_mask);
|
|
|
|
|
sa.sa_flags = 0;
|
|
|
|
|
sa.sa_handler = SIG_DFL;
|
|
|
|
|
int rv = sigaction(sig, &sa, nullptr);
|
|
|
|
|
DPLOG_IF(ERROR, rv != 0) << "sigaction " << sig;
|
2017-02-23 09:50:52 -05:00
|
|
|
|
ALLOW_UNUSED_LOCAL(rv);
|
2017-02-22 13:39:46 -05:00
|
|
|
|
}
|
2017-02-07 13:55:48 -05:00
|
|
|
|
|
|
|
|
|
void HandleCrashSignal(int sig, siginfo_t* siginfo, void* context) {
|
2017-02-22 13:39:46 -05:00
|
|
|
|
MetricsRecordExit(Metrics::LifetimeMilestone::kCrashed);
|
|
|
|
|
|
2017-02-07 13:55:48 -05:00
|
|
|
|
// Is siginfo->si_code useful? The only interesting values on macOS are 0 (not
|
|
|
|
|
// useful, signals generated asynchronously such as by kill() or raise()) and
|
|
|
|
|
// small positive numbers (useful, signal generated via a hardware fault). The
|
|
|
|
|
// standard specifies these other constants, and while xnu never uses them,
|
|
|
|
|
// they are intended to denote signals generated asynchronously and are
|
|
|
|
|
// included here. Additionally, existing practice on other systems
|
|
|
|
|
// (acknowledged by the standard) is for negative numbers to indicate that a
|
|
|
|
|
// signal was generated asynchronously. Although xnu does not do this, allow
|
|
|
|
|
// for the possibility for completeness.
|
|
|
|
|
bool si_code_valid = !(siginfo->si_code <= 0 ||
|
|
|
|
|
siginfo->si_code == SI_USER ||
|
|
|
|
|
siginfo->si_code == SI_QUEUE ||
|
|
|
|
|
siginfo->si_code == SI_TIMER ||
|
|
|
|
|
siginfo->si_code == SI_ASYNCIO ||
|
|
|
|
|
siginfo->si_code == SI_MESGQ);
|
|
|
|
|
|
|
|
|
|
// 0x5343 = 'SC', signifying “signal and code”, disambiguates from the schema
|
|
|
|
|
// used by ExceptionCodeForMetrics(). That system primarily uses Mach
|
|
|
|
|
// exception types and codes, which are not available to a POSIX signal
|
|
|
|
|
// handler. It does provide a way to encode only signal numbers, but does so
|
|
|
|
|
// with the understanding that certain “raw” signals would not be encountered
|
|
|
|
|
// without a Mach exception. Furthermore, it does not allow siginfo->si_code
|
|
|
|
|
// to be encoded, because that’s not available to Mach exception handlers. It
|
|
|
|
|
// would be a shame to lose that information available to a POSIX signal
|
|
|
|
|
// handler.
|
|
|
|
|
int metrics_code = 0x53430000 | (InRangeCast<uint8_t>(sig, 0xff) << 8);
|
|
|
|
|
if (si_code_valid) {
|
|
|
|
|
metrics_code |= InRangeCast<uint8_t>(siginfo->si_code, 0xff);
|
|
|
|
|
}
|
|
|
|
|
Metrics::HandlerCrashed(metrics_code);
|
|
|
|
|
|
2017-02-22 13:39:46 -05:00
|
|
|
|
RestoreDefaultSignalHandler(sig);
|
2017-02-07 13:55:48 -05:00
|
|
|
|
|
|
|
|
|
// If the signal was received synchronously resulting from a hardware fault,
|
|
|
|
|
// returning from the signal handler will cause the kernel to re-raise it,
|
|
|
|
|
// because this handler hasn’t done anything to alleviate the condition that
|
2017-02-22 13:39:46 -05:00
|
|
|
|
// caused the signal to be raised in the first place. With the default signal
|
|
|
|
|
// handler in place, it will cause the same behavior to be taken as though
|
|
|
|
|
// this signal handler had never been installed at all (expected to be a
|
|
|
|
|
// crash). This is ideal, because the signal is re-raised with the same
|
|
|
|
|
// properties and from the same context that initially triggered it, providing
|
|
|
|
|
// the best debugging experience.
|
2017-02-07 13:55:48 -05:00
|
|
|
|
|
|
|
|
|
if ((sig != SIGILL && sig != SIGFPE && sig != SIGBUS && sig != SIGSEGV) ||
|
|
|
|
|
!si_code_valid) {
|
|
|
|
|
// Signals received other than via hardware faults, such as those raised
|
|
|
|
|
// asynchronously via kill() and raise(), and those arising via hardware
|
|
|
|
|
// traps such as int3 (resulting in SIGTRAP but advancing the instruction
|
|
|
|
|
// pointer), will not reoccur on their own when returning from the signal
|
2017-02-22 13:39:46 -05:00
|
|
|
|
// handler. Re-raise them.
|
2017-02-07 13:55:48 -05:00
|
|
|
|
//
|
|
|
|
|
// Unfortunately, when SIGBUS is received asynchronously via kill(),
|
|
|
|
|
// siginfo->si_code makes it appear as though it was actually received via a
|
|
|
|
|
// hardware fault. See 10.12.3 xnu-3789.41.3/bsd/dev/i386/unix_signal.c
|
|
|
|
|
// sendsig(). An asynchronous SIGBUS will thus cause the handler-crashed
|
|
|
|
|
// metric to be logged but will not cause the process to terminate. This
|
|
|
|
|
// isn’t ideal, but asynchronous SIGBUS is an unexpected condition. The
|
|
|
|
|
// alternative, to re-raise here on any SIGBUS, is a bad idea because it
|
|
|
|
|
// would lose properties associated with the the original signal, which are
|
|
|
|
|
// very valuable for debugging and are visible to a Mach exception handler.
|
|
|
|
|
// Since SIGBUS is normally received synchronously in response to a hardware
|
|
|
|
|
// fault, don’t sweat the unexpected asynchronous case.
|
2017-02-22 13:39:46 -05:00
|
|
|
|
//
|
|
|
|
|
// Because this signal handler executes with the signal blocked, this
|
|
|
|
|
// raise() cannot immediately deliver the signal. Delivery is deferred until
|
|
|
|
|
// this signal handler returns and the signal becomes unblocked. The
|
|
|
|
|
// re-raised signal will appear with the same context as where it was
|
|
|
|
|
// initially triggered.
|
|
|
|
|
int rv = raise(sig);
|
|
|
|
|
DPLOG_IF(ERROR, rv != 0) << "raise";
|
2017-02-23 09:50:52 -05:00
|
|
|
|
ALLOW_UNUSED_LOCAL(rv);
|
2017-02-07 13:55:48 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-02-22 13:39:46 -05:00
|
|
|
|
void HandleTerminateSignal(int sig, siginfo_t* siginfo, void* context) {
|
|
|
|
|
MetricsRecordExit(Metrics::LifetimeMilestone::kTerminated);
|
2017-02-07 13:55:48 -05:00
|
|
|
|
|
2017-02-22 13:39:46 -05:00
|
|
|
|
RestoreDefaultSignalHandler(sig);
|
|
|
|
|
|
|
|
|
|
// Re-raise the signal. See the explanation in HandleCrashSignal(). Note that
|
|
|
|
|
// no checks for signals arising from synchronous hardware faults are made
|
|
|
|
|
// because termination signals never originate in that way.
|
|
|
|
|
int rv = raise(sig);
|
|
|
|
|
DPLOG_IF(ERROR, rv != 0) << "raise";
|
2017-02-23 09:50:52 -05:00
|
|
|
|
ALLOW_UNUSED_LOCAL(rv);
|
2017-02-22 13:39:46 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void InstallCrashHandler() {
|
2017-02-07 13:55:48 -05:00
|
|
|
|
// These are the core-generating signals from 10.12.3
|
|
|
|
|
// xnu-3789.41.3/bsd/sys/signalvar.h sigprop: entries with SA_CORE are in the
|
|
|
|
|
// set.
|
2017-02-22 13:39:46 -05:00
|
|
|
|
const int kCrashSignals[] = {SIGQUIT,
|
|
|
|
|
SIGILL,
|
|
|
|
|
SIGTRAP,
|
|
|
|
|
SIGABRT,
|
|
|
|
|
SIGEMT,
|
|
|
|
|
SIGFPE,
|
|
|
|
|
SIGBUS,
|
|
|
|
|
SIGSEGV,
|
|
|
|
|
SIGSYS};
|
|
|
|
|
InstallSignalHandler(
|
|
|
|
|
std::vector<int>(&kCrashSignals[0],
|
|
|
|
|
&kCrashSignals[arraysize(kCrashSignals)]),
|
|
|
|
|
HandleCrashSignal);
|
|
|
|
|
|
|
|
|
|
// Not a crash handler, but close enough. These are non-core-generating but
|
|
|
|
|
// terminating signals from 10.12.3 xnu-3789.41.3/bsd/sys/signalvar.h sigprop:
|
|
|
|
|
// entries with SA_KILL but not SA_CORE are in the set. SIGKILL is excluded
|
|
|
|
|
// because it is uncatchable.
|
|
|
|
|
const int kTerminateSignals[] = {SIGHUP,
|
|
|
|
|
SIGINT,
|
|
|
|
|
SIGPIPE,
|
|
|
|
|
SIGALRM,
|
|
|
|
|
SIGTERM,
|
|
|
|
|
SIGXCPU,
|
|
|
|
|
SIGXFSZ,
|
|
|
|
|
SIGVTALRM,
|
|
|
|
|
SIGPROF,
|
|
|
|
|
SIGUSR1,
|
|
|
|
|
SIGUSR2};
|
|
|
|
|
InstallSignalHandler(
|
|
|
|
|
std::vector<int>(&kTerminateSignals[0],
|
|
|
|
|
&kTerminateSignals[arraysize(kTerminateSignals)]),
|
|
|
|
|
HandleTerminateSignal);
|
2017-02-07 13:55:48 -05:00
|
|
|
|
}
|
|
|
|
|
|
2015-11-09 16:29:25 -05:00
|
|
|
|
struct ResetSIGTERMTraits {
|
|
|
|
|
static struct sigaction* InvalidValue() {
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void Free(struct sigaction* sa) {
|
|
|
|
|
int rv = sigaction(SIGTERM, sa, nullptr);
|
|
|
|
|
PLOG_IF(ERROR, rv != 0) << "sigaction";
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
using ScopedResetSIGTERM =
|
|
|
|
|
base::ScopedGeneric<struct sigaction*, ResetSIGTERMTraits>;
|
|
|
|
|
|
|
|
|
|
ExceptionHandlerServer* g_exception_handler_server;
|
|
|
|
|
|
|
|
|
|
// This signal handler is only operative when being run from launchd.
|
|
|
|
|
void HandleSIGTERM(int sig, siginfo_t* siginfo, void* context) {
|
2017-02-22 13:39:46 -05:00
|
|
|
|
// Don’t call MetricsRecordExit(). This is part of the normal exit path when
|
|
|
|
|
// running from launchd.
|
|
|
|
|
|
2015-11-09 16:29:25 -05:00
|
|
|
|
DCHECK(g_exception_handler_server);
|
|
|
|
|
g_exception_handler_server->Stop();
|
|
|
|
|
}
|
|
|
|
|
|
2017-02-07 13:55:48 -05:00
|
|
|
|
#elif defined(OS_WIN)
|
2015-11-09 16:29:25 -05:00
|
|
|
|
|
2016-12-15 14:50:58 -05:00
|
|
|
|
LONG(WINAPI* g_original_exception_filter)(EXCEPTION_POINTERS*) = nullptr;
|
|
|
|
|
|
2016-09-28 12:49:46 -07:00
|
|
|
|
LONG WINAPI UnhandledExceptionHandler(EXCEPTION_POINTERS* exception_pointers) {
|
2017-02-22 13:39:46 -05:00
|
|
|
|
MetricsRecordExit(Metrics::LifetimeMilestone::kCrashed);
|
2016-09-28 12:49:46 -07:00
|
|
|
|
Metrics::HandlerCrashed(exception_pointers->ExceptionRecord->ExceptionCode);
|
2016-12-15 14:50:58 -05:00
|
|
|
|
|
|
|
|
|
if (g_original_exception_filter)
|
|
|
|
|
return g_original_exception_filter(exception_pointers);
|
|
|
|
|
else
|
|
|
|
|
return EXCEPTION_CONTINUE_SEARCH;
|
2016-09-28 12:49:46 -07:00
|
|
|
|
}
|
2017-02-07 13:55:48 -05:00
|
|
|
|
|
2017-02-22 13:39:46 -05:00
|
|
|
|
// Handles events like Control-C and Control-Break on a console.
|
|
|
|
|
BOOL WINAPI ConsoleHandler(DWORD console_event) {
|
|
|
|
|
MetricsRecordExit(Metrics::LifetimeMilestone::kTerminated);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Handles a WM_ENDSESSION message sent when the user session is ending.
|
|
|
|
|
class TerminateHandler final : public SessionEndWatcher {
|
|
|
|
|
public:
|
|
|
|
|
TerminateHandler() : SessionEndWatcher() {}
|
|
|
|
|
~TerminateHandler() override {}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
// SessionEndWatcher:
|
|
|
|
|
void SessionEnding() override {
|
|
|
|
|
MetricsRecordExit(Metrics::LifetimeMilestone::kTerminated);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(TerminateHandler);
|
|
|
|
|
};
|
|
|
|
|
|
2017-02-07 13:55:48 -05:00
|
|
|
|
void InstallCrashHandler() {
|
|
|
|
|
g_original_exception_filter =
|
|
|
|
|
SetUnhandledExceptionFilter(&UnhandledExceptionHandler);
|
2017-02-22 13:39:46 -05:00
|
|
|
|
|
|
|
|
|
// These are termination handlers, not crash handlers, but that’s close
|
|
|
|
|
// enough. Note that destroying the TerminateHandler would wait for its thread
|
|
|
|
|
// to exit, which isn’t necessary or desirable.
|
|
|
|
|
SetConsoleCtrlHandler(ConsoleHandler, true);
|
|
|
|
|
static TerminateHandler* terminate_handler = new TerminateHandler();
|
2017-02-22 20:08:03 -05:00
|
|
|
|
ALLOW_UNUSED_LOCAL(terminate_handler);
|
2017-02-07 13:55:48 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif // OS_MACOSX
|
2016-09-28 12:49:46 -07:00
|
|
|
|
|
2015-11-06 10:52:09 -08:00
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
|
|
int HandlerMain(int argc, char* argv[]) {
|
2017-02-07 13:55:48 -05:00
|
|
|
|
InstallCrashHandler();
|
2017-02-22 13:39:46 -05:00
|
|
|
|
CallMetricsRecordNormalExit metrics_record_normal_exit;
|
2016-09-28 12:49:46 -07:00
|
|
|
|
|
2015-11-06 10:52:09 -08:00
|
|
|
|
const base::FilePath argv0(
|
|
|
|
|
ToolSupport::CommandLineArgumentToFilePathStringType(argv[0]));
|
|
|
|
|
const base::FilePath me(argv0.BaseName());
|
|
|
|
|
|
|
|
|
|
enum OptionFlags {
|
|
|
|
|
// Long options without short equivalents.
|
|
|
|
|
kOptionLastChar = 255,
|
|
|
|
|
kOptionAnnotation,
|
|
|
|
|
kOptionDatabase,
|
|
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
|
kOptionHandshakeFD,
|
2016-10-21 13:08:18 -07:00
|
|
|
|
#endif // OS_MACOSX
|
|
|
|
|
#if defined(OS_WIN)
|
|
|
|
|
kOptionInitialClientData,
|
|
|
|
|
#endif // OS_WIN
|
|
|
|
|
#if defined(OS_MACOSX)
|
2015-11-06 10:52:09 -08:00
|
|
|
|
kOptionMachService,
|
2016-01-06 09:59:54 -08:00
|
|
|
|
#endif // OS_MACOSX
|
2016-09-16 13:21:50 -07:00
|
|
|
|
kOptionMetrics,
|
2016-01-06 09:59:54 -08:00
|
|
|
|
kOptionNoRateLimit,
|
2017-02-15 19:54:19 -05:00
|
|
|
|
kOptionNoUploadGzip,
|
2016-01-06 09:59:54 -08:00
|
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
|
kOptionResetOwnCrashExceptionPortToSystemDefault,
|
|
|
|
|
#elif defined(OS_WIN)
|
2015-11-06 10:52:09 -08:00
|
|
|
|
kOptionPipeName,
|
|
|
|
|
#endif // OS_MACOSX
|
|
|
|
|
kOptionURL,
|
|
|
|
|
|
|
|
|
|
// Standard options.
|
|
|
|
|
kOptionHelp = -2,
|
|
|
|
|
kOptionVersion = -3,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct {
|
|
|
|
|
std::map<std::string, std::string> annotations;
|
|
|
|
|
std::string url;
|
|
|
|
|
const char* database;
|
2016-09-16 13:21:50 -07:00
|
|
|
|
const char* metrics;
|
2015-11-06 10:52:09 -08:00
|
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
|
int handshake_fd;
|
|
|
|
|
std::string mach_service;
|
|
|
|
|
bool reset_own_crash_exception_port_to_system_default;
|
|
|
|
|
#elif defined(OS_WIN)
|
|
|
|
|
std::string pipe_name;
|
2016-10-21 13:08:18 -07:00
|
|
|
|
InitialClientData initial_client_data;
|
2015-11-06 10:52:09 -08:00
|
|
|
|
#endif // OS_MACOSX
|
2016-01-06 09:59:54 -08:00
|
|
|
|
bool rate_limit;
|
2017-02-15 19:54:19 -05:00
|
|
|
|
bool upload_gzip;
|
2015-11-06 10:52:09 -08:00
|
|
|
|
} options = {};
|
|
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
|
options.handshake_fd = -1;
|
|
|
|
|
#endif
|
2016-01-06 09:59:54 -08:00
|
|
|
|
options.rate_limit = true;
|
2017-02-15 19:54:19 -05:00
|
|
|
|
options.upload_gzip = true;
|
2015-11-06 10:52:09 -08:00
|
|
|
|
|
|
|
|
|
const option long_options[] = {
|
2016-10-21 13:08:18 -07:00
|
|
|
|
{"annotation", required_argument, nullptr, kOptionAnnotation},
|
|
|
|
|
{"database", required_argument, nullptr, kOptionDatabase},
|
2015-11-06 10:52:09 -08:00
|
|
|
|
#if defined(OS_MACOSX)
|
2016-10-21 13:08:18 -07:00
|
|
|
|
{"handshake-fd", required_argument, nullptr, kOptionHandshakeFD},
|
|
|
|
|
#endif // OS_MACOSX
|
|
|
|
|
#if defined(OS_WIN)
|
|
|
|
|
{"initial-client-data",
|
|
|
|
|
required_argument,
|
|
|
|
|
nullptr,
|
|
|
|
|
kOptionInitialClientData},
|
2016-01-06 09:59:54 -08:00
|
|
|
|
#endif // OS_MACOSX
|
|
|
|
|
#if defined(OS_MACOSX)
|
2016-10-21 13:08:18 -07:00
|
|
|
|
{"mach-service", required_argument, nullptr, kOptionMachService},
|
|
|
|
|
#endif // OS_MACOSX
|
|
|
|
|
{"metrics-dir", required_argument, nullptr, kOptionMetrics},
|
|
|
|
|
{"no-rate-limit", no_argument, nullptr, kOptionNoRateLimit},
|
2017-02-15 19:54:19 -05:00
|
|
|
|
{"no-upload-gzip", no_argument, nullptr, kOptionNoUploadGzip},
|
2016-10-21 13:08:18 -07:00
|
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
|
{"reset-own-crash-exception-port-to-system-default",
|
|
|
|
|
no_argument,
|
|
|
|
|
nullptr,
|
|
|
|
|
kOptionResetOwnCrashExceptionPortToSystemDefault},
|
2015-11-06 10:52:09 -08:00
|
|
|
|
#elif defined(OS_WIN)
|
2016-10-21 13:08:18 -07:00
|
|
|
|
{"pipe-name", required_argument, nullptr, kOptionPipeName},
|
2015-11-06 10:52:09 -08:00
|
|
|
|
#endif // OS_MACOSX
|
2016-10-21 13:08:18 -07:00
|
|
|
|
{"url", required_argument, nullptr, kOptionURL},
|
|
|
|
|
{"help", no_argument, nullptr, kOptionHelp},
|
|
|
|
|
{"version", no_argument, nullptr, kOptionVersion},
|
|
|
|
|
{nullptr, 0, nullptr, 0},
|
2015-11-06 10:52:09 -08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
int opt;
|
|
|
|
|
while ((opt = getopt_long(argc, argv, "", long_options, nullptr)) != -1) {
|
|
|
|
|
switch (opt) {
|
|
|
|
|
case kOptionAnnotation: {
|
|
|
|
|
std::string key;
|
|
|
|
|
std::string value;
|
2016-10-21 13:08:18 -07:00
|
|
|
|
if (!SplitStringFirst(optarg, '=', &key, &value)) {
|
2015-11-06 10:52:09 -08:00
|
|
|
|
ToolSupport::UsageHint(me, "--annotation requires KEY=VALUE");
|
2017-02-22 13:39:46 -05:00
|
|
|
|
return ExitFailure();
|
2015-11-06 10:52:09 -08:00
|
|
|
|
}
|
|
|
|
|
std::string old_value;
|
|
|
|
|
if (!MapInsertOrReplace(&options.annotations, key, value, &old_value)) {
|
|
|
|
|
LOG(WARNING) << "duplicate key " << key << ", discarding value "
|
|
|
|
|
<< old_value;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case kOptionDatabase: {
|
|
|
|
|
options.database = optarg;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
|
case kOptionHandshakeFD: {
|
|
|
|
|
if (!StringToNumber(optarg, &options.handshake_fd) ||
|
|
|
|
|
options.handshake_fd < 0) {
|
|
|
|
|
ToolSupport::UsageHint(me,
|
|
|
|
|
"--handshake-fd requires a file descriptor");
|
2017-02-22 13:39:46 -05:00
|
|
|
|
return ExitFailure();
|
2015-11-06 10:52:09 -08:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case kOptionMachService: {
|
|
|
|
|
options.mach_service = optarg;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
#elif defined(OS_WIN)
|
2016-10-21 13:08:18 -07:00
|
|
|
|
case kOptionInitialClientData: {
|
|
|
|
|
if (!options.initial_client_data.InitializeFromString(optarg)) {
|
|
|
|
|
ToolSupport::UsageHint(
|
|
|
|
|
me, "failed to parse --initial-client-data");
|
2017-02-22 13:39:46 -05:00
|
|
|
|
return ExitFailure();
|
2015-11-06 10:52:09 -08:00
|
|
|
|
}
|
break; after handling --initial-client-data on command line
Not surprisingly,
"0x278,0x27c,0x280,0x274,0x288,0x978a70,0x978a80,0x978a90" is not a
valid directory to store metrics in.
Fortunately --metrics was processed before --initial-client-data in a
local build, otherwise this could have lurked for a long time. :(
R=mark@chromium.org
BUG=655788,656800
Change-Id: I3ac3d1b487f55ddf0172bac51f8d9efc411c3329
Reviewed-on: https://chromium-review.googlesource.com/406938
Reviewed-by: Mark Mentovai <mark@chromium.org>
2016-11-02 15:34:53 -07:00
|
|
|
|
break;
|
2015-11-06 10:52:09 -08:00
|
|
|
|
}
|
2016-01-06 09:59:54 -08:00
|
|
|
|
#endif // OS_MACOSX
|
2016-09-16 13:21:50 -07:00
|
|
|
|
case kOptionMetrics: {
|
|
|
|
|
options.metrics = optarg;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2016-01-06 09:59:54 -08:00
|
|
|
|
case kOptionNoRateLimit: {
|
|
|
|
|
options.rate_limit = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2017-02-15 19:54:19 -05:00
|
|
|
|
case kOptionNoUploadGzip: {
|
|
|
|
|
options.upload_gzip = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2016-01-06 09:59:54 -08:00
|
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
|
case kOptionResetOwnCrashExceptionPortToSystemDefault: {
|
|
|
|
|
options.reset_own_crash_exception_port_to_system_default = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
#elif defined(OS_WIN)
|
2015-11-06 10:52:09 -08:00
|
|
|
|
case kOptionPipeName: {
|
|
|
|
|
options.pipe_name = optarg;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
#endif // OS_MACOSX
|
|
|
|
|
case kOptionURL: {
|
|
|
|
|
options.url = optarg;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case kOptionHelp: {
|
|
|
|
|
Usage(me);
|
2017-02-22 13:39:46 -05:00
|
|
|
|
MetricsRecordExit(Metrics::LifetimeMilestone::kExitedEarly);
|
2015-11-06 10:52:09 -08:00
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
|
}
|
|
|
|
|
case kOptionVersion: {
|
|
|
|
|
ToolSupport::Version(me);
|
2017-02-22 13:39:46 -05:00
|
|
|
|
MetricsRecordExit(Metrics::LifetimeMilestone::kExitedEarly);
|
2015-11-06 10:52:09 -08:00
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
|
}
|
|
|
|
|
default: {
|
|
|
|
|
ToolSupport::UsageHint(me, nullptr);
|
2017-02-22 13:39:46 -05:00
|
|
|
|
return ExitFailure();
|
2015-11-06 10:52:09 -08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
argc -= optind;
|
|
|
|
|
argv += optind;
|
|
|
|
|
|
|
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
|
if (options.handshake_fd < 0 && options.mach_service.empty()) {
|
|
|
|
|
ToolSupport::UsageHint(me, "--handshake-fd or --mach-service is required");
|
2017-02-22 13:39:46 -05:00
|
|
|
|
return ExitFailure();
|
2015-11-06 10:52:09 -08:00
|
|
|
|
}
|
|
|
|
|
if (options.handshake_fd >= 0 && !options.mach_service.empty()) {
|
|
|
|
|
ToolSupport::UsageHint(
|
|
|
|
|
me, "--handshake-fd and --mach-service are incompatible");
|
2017-02-22 13:39:46 -05:00
|
|
|
|
return ExitFailure();
|
2015-11-06 10:52:09 -08:00
|
|
|
|
}
|
|
|
|
|
#elif defined(OS_WIN)
|
2016-10-21 13:08:18 -07:00
|
|
|
|
if (!options.initial_client_data.IsValid() && options.pipe_name.empty()) {
|
|
|
|
|
ToolSupport::UsageHint(me,
|
|
|
|
|
"--initial-client-data or --pipe-name is required");
|
2017-02-22 13:39:46 -05:00
|
|
|
|
return ExitFailure();
|
2015-11-06 10:52:09 -08:00
|
|
|
|
}
|
2016-10-21 13:08:18 -07:00
|
|
|
|
if (options.initial_client_data.IsValid() && !options.pipe_name.empty()) {
|
2015-11-06 10:52:09 -08:00
|
|
|
|
ToolSupport::UsageHint(
|
2016-10-21 13:08:18 -07:00
|
|
|
|
me, "--initial-client-data and --pipe-name are incompatible");
|
2017-02-22 13:39:46 -05:00
|
|
|
|
return ExitFailure();
|
2015-11-06 10:52:09 -08:00
|
|
|
|
}
|
|
|
|
|
#endif // OS_MACOSX
|
|
|
|
|
|
|
|
|
|
if (!options.database) {
|
|
|
|
|
ToolSupport::UsageHint(me, "--database is required");
|
2017-02-22 13:39:46 -05:00
|
|
|
|
return ExitFailure();
|
2015-11-06 10:52:09 -08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (argc) {
|
|
|
|
|
ToolSupport::UsageHint(me, nullptr);
|
2017-02-22 13:39:46 -05:00
|
|
|
|
return ExitFailure();
|
2015-11-06 10:52:09 -08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
|
if (options.mach_service.empty()) {
|
|
|
|
|
// Don’t do this when being run by launchd. See launchd.plist(5).
|
|
|
|
|
CloseStdinAndStdout();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (options.reset_own_crash_exception_port_to_system_default) {
|
|
|
|
|
CrashpadClient::UseSystemDefaultHandler();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
base::mac::ScopedMachReceiveRight receive_right;
|
|
|
|
|
|
|
|
|
|
if (options.handshake_fd >= 0) {
|
|
|
|
|
receive_right.reset(
|
|
|
|
|
ChildPortHandshake::RunServerForFD(
|
|
|
|
|
base::ScopedFD(options.handshake_fd),
|
|
|
|
|
ChildPortHandshake::PortRightType::kReceiveRight));
|
|
|
|
|
} else if (!options.mach_service.empty()) {
|
|
|
|
|
receive_right = BootstrapCheckIn(options.mach_service);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!receive_right.is_valid()) {
|
2017-02-22 13:39:46 -05:00
|
|
|
|
return ExitFailure();
|
2015-11-06 10:52:09 -08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ExceptionHandlerServer exception_handler_server(
|
2015-12-09 17:36:32 -05:00
|
|
|
|
std::move(receive_right), !options.mach_service.empty());
|
2015-11-09 16:29:25 -05:00
|
|
|
|
base::AutoReset<ExceptionHandlerServer*> reset_g_exception_handler_server(
|
|
|
|
|
&g_exception_handler_server, &exception_handler_server);
|
|
|
|
|
|
|
|
|
|
struct sigaction old_sa;
|
|
|
|
|
ScopedResetSIGTERM reset_sigterm;
|
|
|
|
|
if (!options.mach_service.empty()) {
|
|
|
|
|
// When running from launchd, no no-senders notification could ever be
|
|
|
|
|
// triggered, because launchd maintains a send right to the service. When
|
|
|
|
|
// launchd wants the job to exit, it will send a SIGTERM. See
|
|
|
|
|
// launchd.plist(5).
|
|
|
|
|
//
|
|
|
|
|
// Set up a SIGTERM handler that will call exception_handler_server.Stop().
|
2017-02-22 13:39:46 -05:00
|
|
|
|
// This replaces the HandleTerminateSignal handler for SIGTERM.
|
2015-11-09 16:29:25 -05:00
|
|
|
|
struct sigaction sa = {};
|
|
|
|
|
sigemptyset(&sa.sa_mask);
|
|
|
|
|
sa.sa_flags = SA_SIGINFO;
|
|
|
|
|
sa.sa_sigaction = HandleSIGTERM;
|
|
|
|
|
int rv = sigaction(SIGTERM, &sa, &old_sa);
|
|
|
|
|
PCHECK(rv == 0) << "sigaction";
|
|
|
|
|
reset_sigterm.reset(&old_sa);
|
|
|
|
|
}
|
2015-11-06 10:52:09 -08:00
|
|
|
|
#elif defined(OS_WIN)
|
2015-12-08 16:55:02 -08:00
|
|
|
|
// Shut down as late as possible relative to programs we're watching.
|
|
|
|
|
if (!SetProcessShutdownParameters(0x100, SHUTDOWN_NORETRY))
|
|
|
|
|
PLOG(ERROR) << "SetProcessShutdownParameters";
|
|
|
|
|
|
2015-11-06 10:52:09 -08:00
|
|
|
|
ExceptionHandlerServer exception_handler_server(!options.pipe_name.empty());
|
|
|
|
|
|
|
|
|
|
if (!options.pipe_name.empty()) {
|
|
|
|
|
exception_handler_server.SetPipeName(base::UTF8ToUTF16(options.pipe_name));
|
|
|
|
|
}
|
|
|
|
|
#endif // OS_MACOSX
|
|
|
|
|
|
2016-09-16 13:21:50 -07:00
|
|
|
|
base::GlobalHistogramAllocator* histogram_allocator = nullptr;
|
|
|
|
|
if (options.metrics) {
|
|
|
|
|
const base::FilePath metrics_dir(
|
|
|
|
|
ToolSupport::CommandLineArgumentToFilePathStringType(options.metrics));
|
|
|
|
|
static const char kMetricsName[] = "CrashpadMetrics";
|
|
|
|
|
const size_t kMetricsFileSize = 1 << 20;
|
|
|
|
|
if (base::GlobalHistogramAllocator::CreateWithActiveFileInDir(
|
|
|
|
|
metrics_dir, kMetricsFileSize, 0, kMetricsName)) {
|
|
|
|
|
histogram_allocator = base::GlobalHistogramAllocator::Get();
|
|
|
|
|
histogram_allocator->CreateTrackingHistograms(kMetricsName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-02-22 13:39:46 -05:00
|
|
|
|
Metrics::HandlerLifetimeMilestone(Metrics::LifetimeMilestone::kStarted);
|
|
|
|
|
|
2016-04-25 12:13:07 -07:00
|
|
|
|
std::unique_ptr<CrashReportDatabase> database(CrashReportDatabase::Initialize(
|
2015-11-06 10:52:09 -08:00
|
|
|
|
base::FilePath(ToolSupport::CommandLineArgumentToFilePathStringType(
|
|
|
|
|
options.database))));
|
|
|
|
|
if (!database) {
|
2017-02-22 13:39:46 -05:00
|
|
|
|
return ExitFailure();
|
2015-11-06 10:52:09 -08:00
|
|
|
|
}
|
|
|
|
|
|
2016-01-06 09:59:54 -08:00
|
|
|
|
// TODO(scottmg): options.rate_limit should be removed when we have a
|
|
|
|
|
// configurable database setting to control upload limiting.
|
|
|
|
|
// See https://crashpad.chromium.org/bug/23.
|
|
|
|
|
CrashReportUploadThread upload_thread(
|
2017-02-15 19:54:19 -05:00
|
|
|
|
database.get(), options.url, options.rate_limit, options.upload_gzip);
|
2015-11-06 10:52:09 -08:00
|
|
|
|
upload_thread.Start();
|
|
|
|
|
|
2016-01-05 15:09:00 -05:00
|
|
|
|
PruneCrashReportThread prune_thread(database.get(),
|
|
|
|
|
PruneCondition::GetDefault());
|
|
|
|
|
prune_thread.Start();
|
|
|
|
|
|
2015-11-06 10:52:09 -08:00
|
|
|
|
CrashReportExceptionHandler exception_handler(
|
|
|
|
|
database.get(), &upload_thread, &options.annotations);
|
|
|
|
|
|
2016-10-21 13:08:18 -07:00
|
|
|
|
#if defined(OS_WIN)
|
|
|
|
|
if (options.initial_client_data.IsValid()) {
|
|
|
|
|
exception_handler_server.InitializeWithInheritedDataForInitialClient(
|
|
|
|
|
options.initial_client_data, &exception_handler);
|
|
|
|
|
}
|
|
|
|
|
#endif // OS_WIN
|
|
|
|
|
|
2015-11-06 10:52:09 -08:00
|
|
|
|
exception_handler_server.Run(&exception_handler);
|
|
|
|
|
|
|
|
|
|
upload_thread.Stop();
|
2016-01-05 15:09:00 -05:00
|
|
|
|
prune_thread.Stop();
|
2015-11-06 10:52:09 -08:00
|
|
|
|
|
2016-09-16 13:21:50 -07:00
|
|
|
|
if (histogram_allocator)
|
|
|
|
|
histogram_allocator->DeletePersistentLocation();
|
|
|
|
|
|
2015-11-06 10:52:09 -08:00
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace crashpad
|