DCHECK failure in page_load_metrics::QueryContainsComponentHelper() call from ServiceWorkerPageLoadMetricsObserver |
||||
Issue descriptionChrome Version: Chromium 66.0.3330.0 (Developer Build) (64-bit) Revision e3882dbe4ca8dc822bbb6549428208cf278d703d-refs/heads/master@{#531359} OS: Linux What steps will reproduce the problem? (0) Compile a Debug build (1) Visit https://www.google.com/webmasters/ (2) Click "Search Console" button (3) After auth page finishes loading, hit Back, wait for previous page to finish loading. What is the expected result? Previous page loads with no problems. What happens instead? DCHECK failure [204246:204246:0123/124333.042166:FATAL:page_load_metrics_util.cc(56)] Check failed: query[0] != '?' && query[0] != '#'. This happens because page_load_metrics::IsGoogleSearchResultUrl() called on "https://www.google.com/webmasters/#?modal_active=none" results in a call to QueryContainsComponentHelper with a query (ref) of "?modal_active=none". The DCHECK, intending to verify that GURL::query_piece() and GURL::ref_piece() are written correctly, incorrectly catches this valid ref string. I've written a quick CL that adds a regression test case to PageLoadMetricsUtilTest.IsGoogleSearchResultUrl, and removes the DCHECK: https://crrev.com/c/882211 I think the goal of the DCHECK is better served by existing unittests, and that if GURL breaks conformance to the URL spec then a lot of other things break as well. Another option would be to split the query and the ref case of the DCHECK into two separate checks to verify the conformance of url.query_piece() and url.ref_piece() before passing them to QueryContainsComponentHelper.
,
Jan 23 2018
+bmcquade: As an owner, does this fix seem reasonable to you, or could you suggest someone to take a look?
,
Jan 23 2018
Thanks so much for debugging this. Apologies for the DCHECK firing. It sounds like we can just remove the DCHECK, since it's invalid and fires for the case you cite. cthomp feel free to send a patch to remove the DCHECK, or you can reassign this bug to me and I'll remove it. Thanks!
,
Jan 24 2018
Happy to help -- it was weird serendipity that I found it while clicking around in a debug build while working on another PageLoadMetricsObserver. I've added you as reviewer on the CL.
,
Jan 29 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/aa7ce1ef93eb79bcb410afc628e3d2a7c7e4b06e commit aa7ce1ef93eb79bcb410afc628e3d2a7c7e4b06e Author: Christopher Thompson <cthomp@chromium.org> Date: Mon Jan 29 21:31:27 2018 Remove DCHECK in QueryContainsComponentHelper page_load_metrics::IsGoogleSearchResultUrl() can, if given a URL where the query identifier is after the fragment identifier (e.g., https://www.google.com/webmasters/#?modal_active=none), cause a DCHECK to fail in QueryContainsComponentHelper. This adds a unit test which triggers the DCHECK failure. It also removes the DCHECK in favor of trimming initial [?#] characters. Change-Id: Ibdc5d6d0aee2089deea2c777d94c0dd70ef1ffd0 Bug: 805155 Reviewed-on: https://chromium-review.googlesource.com/882211 Reviewed-by: Bryan McQuade <bmcquade@chromium.org> Commit-Queue: Christopher Thompson <cthomp@chromium.org> Cr-Commit-Position: refs/heads/master@{#532595} [modify] https://crrev.com/aa7ce1ef93eb79bcb410afc628e3d2a7c7e4b06e/chrome/browser/page_load_metrics/page_load_metrics_util.cc [modify] https://crrev.com/aa7ce1ef93eb79bcb410afc628e3d2a7c7e4b06e/chrome/browser/page_load_metrics/page_load_metrics_util.h [modify] https://crrev.com/aa7ce1ef93eb79bcb410afc628e3d2a7c7e4b06e/chrome/browser/page_load_metrics/page_load_metrics_util_unittest.cc
,
Jan 30 2018
|
||||
►
Sign in to add a comment |
||||
Comment 1 by cthomp@chromium.org
, Jan 23 2018