New issue
Advanced search Search tips

Issue 678455 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows , Chrome
Pri: 1
Type: Bug



Sign in to add a comment

Chromium Debug DCHECK while launching, due to cache size mismatch

Project Member Reported by w...@chromium.org, Jan 5 2017

Issue description

Chrome Version: 57.0.2972.0
OS: Windows

What steps will reproduce the problem?
Not entirely sure; I was running Chromium having had the previous run crash while reloading my session.

It appears that this DCHECK was added in https://codereview.chromium.org/2416713002.
 
Screenshot 2017-01-04 at 17.02.06 - Display 2.png
1.1 MB View Download

Comment 1 by w...@chromium.org, Jan 5 2017

Labels: -Pri-3 Pri-1
Summary: Chromium Debug DCHECK while launching, due to cache size mismatch (was: Chromium Debug DCHECK while launching)
Cc: -cmumford@chromium.org
Components: -Internals>Network>Cache Blink>Storage>CacheStorage
Owner: cmumford@chromium.org
Status: Assigned (was: Untriaged)
Thanks for the report wez! cmumford@ on the bright side, it's only about 50 bytes off.
It looks like the size calculation can run concurrently with other mutable operations resulting in a temporary mismatch with the index size value. If a crash occurs before the index is updated then this bug can occur. One way to fix this is by removing the DCHECK, and another is to schedule the size calculation to avoid concurrency - but this will have a performance impact.

Comment 4 by w...@chromium.org, Jan 6 2017

What is the impact of a size mismatch? How is the cached size calculation
actually used?
It's used by the quota manager. If a cache is opened then the size will get fixed in the index, but if it ever gets mismatched, and isn't opened then the quota manager will never have the correct size.

I'm testing a fix for this now: https://codereview.chromium.org/2613183003/

Comment 6 by osh...@chromium.org, Jan 10 2017

Labels: OS-Chrome
This is happening on ChromeOS as well.
Project Member

Comment 7 by bugdroid1@chromium.org, Jan 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3418f524d88d8851f26ea6a9ea0ac04cf6aea332

commit 3418f524d88d8851f26ea6a9ea0ac04cf6aea332
Author: cmumford <cmumford@chromium.org>
Date: Wed Jan 11 23:50:14 2017

[CacheStorage] Updating cache size within the scheduled operation.

Previously scheduled cache mutation operations would begin the
size update calculation and then return to potentially begin
another mutation operation in parallel with the running size
update calculation. This could result in size held by CacheStorage
becoming mismatched with the actual cache size if Chrome were to
crash before the index could be written.

This change completes the size calculation before calling the
closure to begin the next scheduled operation.

BUG= 678455 

Review-Url: https://codereview.chromium.org/2613183003
Cr-Commit-Position: refs/heads/master@{#443059}

[modify] https://crrev.com/3418f524d88d8851f26ea6a9ea0ac04cf6aea332/content/browser/cache_storage/cache_storage_cache.cc
[modify] https://crrev.com/3418f524d88d8851f26ea6a9ea0ac04cf6aea332/content/browser/cache_storage/cache_storage_cache.h

Just a heads up that this is still happening after the fix in #7. Let me know if I can do anything to help debug!
{#443059} speculatively fixes the cause of this bug, but unfortunately the only to fix the cached size, is to open the cache - which hit's the DCHECK. I removed the DCHECK in {#444122}, and am adding some UMA logging (crrev.com/2636333002) to help verify this fix. Sorry for the hassle.
Status: Fixed (was: Assigned)
Closing. UMA reports 99.99% of all cached sizes are within 1KB of the actual size. Will probably look into this at some time in the future, but if so will be in a new bug.

Sign in to add a comment