linux: Disable DumpWithoutCrash() if Crashpad isn't initialized

When sampling has disabled crash reporting for WebView, no signal
handler is initialized, causing later calls to DumpWithoutCrash()
to crash.

Bug: 949295
Change-Id: Ib93986f81bc83404ac9f4d8f40fb34e54f1b3bec
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1558817
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
Joshua Peraza 2019-04-08 15:29:04 -07:00 committed by Commit Bot
parent 71d2291f4e
commit ae431a1ae5

View File

@ -377,7 +377,10 @@ bool CrashpadClient::StartHandlerForClient(
// static
void CrashpadClient::DumpWithoutCrash(NativeCPUContext* context) {
DCHECK(g_crash_handler);
if (!g_crash_handler) {
DLOG(ERROR) << "Crashpad isn't enabled";
return;
}
#if defined(ARCH_CPU_ARMEL)
memset(context->uc_regspace, 0, sizeof(context->uc_regspace));