Commit 0f079672 authored by Aaron Colwell's avatar Aaron Colwell Committed by Commit Bot

Add more debugging info to find the source of invalid appcache handles.

This is a follow-up to http://crrev.com/c/2216913. We are still
seeing invalid handles after that change so this CL adds some more
debugging info the help figure out what call stacks are creating
these invalid handles. I've also added a scoped crash key to
capture some RenderFrameHostImpl state since that seems like the most
likely caller to be triggering this problem.

Bug: 977169, 1086306
Change-Id: I023c159f4e1d2cd9a3fb018a7867dbdb42c2b0f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2220893
Auto-Submit: Aaron Colwell <acolwell@chromium.org>
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: default avatarMarijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773220}
parent 139d8e06
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "base/debug/dump_without_crashing.h"
#include "content/browser/appcache/appcache.h" #include "content/browser/appcache/appcache.h"
#include "content/browser/appcache/appcache_group.h" #include "content/browser/appcache/appcache_group.h"
#include "content/browser/appcache/appcache_service_impl.h" #include "content/browser/appcache/appcache_service_impl.h"
...@@ -27,6 +28,10 @@ AppCacheBackendImpl::AppCacheBackendImpl(AppCacheServiceImpl* service, ...@@ -27,6 +28,10 @@ AppCacheBackendImpl::AppCacheBackendImpl(AppCacheServiceImpl* service,
ChildProcessSecurityPolicyImpl::GetInstance()->CreateHandle( ChildProcessSecurityPolicyImpl::GetInstance()->CreateHandle(
process_id)) { process_id)) {
DCHECK(service); DCHECK(service);
DCHECK(security_policy_handle_.is_valid());
if (!security_policy_handle_.is_valid())
base::debug::DumpWithoutCrashing();
} }
AppCacheBackendImpl::~AppCacheBackendImpl() = default; AppCacheBackendImpl::~AppCacheBackendImpl() = default;
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/containers/queue.h" #include "base/containers/queue.h"
#include "base/debug/alias.h" #include "base/debug/alias.h"
#include "base/debug/crash_logging.h"
#include "base/debug/dump_without_crashing.h" #include "base/debug/dump_without_crashing.h"
#include "base/hash/hash.h" #include "base/hash/hash.h"
#include "base/i18n/character_encoding.h" #include "base/i18n/character_encoding.h"
...@@ -7384,6 +7385,15 @@ void RenderFrameHostImpl::GetInterface( ...@@ -7384,6 +7385,15 @@ void RenderFrameHostImpl::GetInterface(
void RenderFrameHostImpl::CreateAppCacheBackend( void RenderFrameHostImpl::CreateAppCacheBackend(
mojo::PendingReceiver<blink::mojom::AppCacheBackend> receiver) { mojo::PendingReceiver<blink::mojom::AppCacheBackend> receiver) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
static auto* crash_key = base::debug::AllocateCrashKeyString(
"CreateAppCacheBackend-data", base::debug::CrashKeySize::Size64);
std::string data = base::StringPrintf(
"f=%d br=%d irfl=%d iiand=%d fid=%d", frame_.is_bound(),
broker_receiver_.is_bound(), IsRenderFrameLive(),
GetProcess()->IsInitializedAndNotDead(),
RenderProcessHost::FromID(GetProcess()->GetID()) != nullptr);
base::debug::ScopedCrashKeyString scoped_crash_key(crash_key, data);
auto* storage_partition_impl = auto* storage_partition_impl =
static_cast<StoragePartitionImpl*>(GetProcess()->GetStoragePartition()); static_cast<StoragePartitionImpl*>(GetProcess()->GetStoragePartition());
storage_partition_impl->GetAppCacheService()->CreateBackend( storage_partition_impl->GetAppCacheService()->CreateBackend(
......
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