Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(603)

Issue 4960001: Fix a DCHECK that could fire in PassiveLogCollector for a particular stream o... (Closed)

Created:
10 years, 1 month ago by eroman
Modified:
9 years, 6 months ago
Reviewers:
mmenke
CC:
chromium-reviews, cbentzel+watch_chromium.org, Paweł Hajdan Jr., darin-cc_chromium.org, ben+cc_chromium.org
Visibility:
Public.

Description

Fix a DCHECK that could fire in PassiveLogCollector for a particular stream of events. The sequence of events needed to trigger the assertion is a little complicated (see unittest for specifics). The general pattern goes something like this: (1) Add a dependency between two sources of different types. (This increments the refcount on the dependency.) (2) Saturate the "graveyard" containing the dependency causing it to be nuked. (3) Add a new entry to the original dependency, causing it to re-create the source (but now with 0 refcount). (4) Force the buffer containing the source in step (1) to be nuked (5) In releasing the dependencies, it will now try to release reference on non-existent source. While this was crashing debug mode, I don't believe there would have been an impact on release builds (since DeleteSourceInfo() early returns if it can't find the source). BUG=58847 TEST=PassiveLogCollectorTest.ReleaseDependencyToUnreferencedSource Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=66147

Patch Set 1 #

Total comments: 2

Patch Set 2 : rename x --> log #

Unified diffs Side-by-side diffs Delta from patch set Stats (+71 lines, -6 lines) Patch
M chrome/browser/net/passive_log_collector.h View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/net/passive_log_collector.cc View 3 chunks +14 lines, -6 lines 0 comments Download
M chrome/browser/net/passive_log_collector_unittest.cc View 1 1 chunk +54 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
eroman
10 years, 1 month ago (2010-11-13 04:15:47 UTC) #1
mmenke
LGTM. Doesn't look like it would have caused issues in release builds to me, either. ...
10 years, 1 month ago (2010-11-15 16:21:52 UTC) #2
eroman
10 years, 1 month ago (2010-11-15 19:28:10 UTC) #3
http://codereview.chromium.org/4960001/diff/1/chrome/browser/net/passive_log_...
File chrome/browser/net/passive_log_collector_unittest.cc (right):

http://codereview.chromium.org/4960001/diff/1/chrome/browser/net/passive_log_...
chrome/browser/net/passive_log_collector_unittest.cc:443: PassiveLogCollector x;
On 2010/11/15 16:21:52, Matt Menke wrote:
> nit:  You're undoubtedly more familiar with Google style guidelines than I,
but
> you might want to give this a better name.  Would make lines longer and a
little
> messier, though, so maybe not.

Done.

You are right, |x| is a bad name. (carry over from some test code I had).

I have renamed it to |log| to be consistent with the other tests in this file.

Powered by Google App Engine
This is Rietveld 408576698