Hit a DCHECK in offline_metrics_collector_impl.cc(244) |
||||
Issue description
Chrome Version: (copy from chrome://version)
Chrome built from head.
OS: (e.g. Win10, MacOS 10.12, etc...)
Android.
What steps will reproduce the problem?
(1) Build (with is_debug=true) and install Chrome app from head.
(2) Travel to place with different time zone (or set it manually).
(3) Re-open app
What is the expected result?
App crashed.
What happens instead?
App not crash.
Please use labels and text to provide additional information.
Error messages:
06-20 16:06:07.262 3423-3423/com.google.android.apps.chrome A/chromium: [FATAL:offline_metrics_collector_impl.cc(244)] Check failed: days_in_between >= 0.
#00 0xd34d9985 /data/app/com.google.android.apps.chrome-82HULYE7ey3rZYGN-NUThg==/lib/arm/libbase.cr.so+0x000d2985
#01 0xc89eca8d /data/app/com.google.android.apps.chrome-82HULYE7ey3rZYGN-NUThg==/lib/arm/libchrome.cr.so+0x0071da8d
06-20 16:06:07.262 3423-3423/com.google.android.apps.chrome A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 3423 (oid.apps.chrome), pid 3423 (oid.apps.chrome)
I checked the code (https://cs.chromium.org/chromium/src/chrome/browser/offline_pages/prefetch/offline_metrics_collector_impl.cc?q=offline_metrics_collector_impl.cc&sq=package:chromium&dr):
Line 207 checks 'tracking_day_midnight_' must be less than 'current_midnight', but it could not make sure that the DCHECK in line 242 is always safe, in case of timezone changed, value of 'tracking_day_midnight_' may not be aligned to the midnight of new timezone any more, so it is possible than
tracking_day_midnight_ < current_midnight
but (current_midnight - tracking_day_midnight_).InDays() == 0
in case current_midnight - tracking_day_midnight_ < [one whole day]
In this case, DCHECK in line 242 failed and crashed the app.
I tried to fix this issue by set 'tracking_day_midnight_' to midnight at beginning of function 'UpdatePastDaysIfNeeded', but seems it may change the metrics as well, not sure it is the right way to do.
Thanks!
,
Sep 17
+dimich who wrote the metrics collector code.
,
Sep 18
,
Nov 9
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/09142f77c551ba7e95ce975970d1cd58ba947455 commit 09142f77c551ba7e95ce975970d1cd58ba947455 Author: Dmitry Titov <dimich@chromium.org> Date: Fri Nov 09 21:22:09 2018 Fix calculation of a next day in OfflineMetricsCollector to avoid DCHECK when DST kicks in. Bug: 861647 Change-Id: I405a0221ff7a26b6e892ab738efca6102d2f54c9 Reviewed-on: https://chromium-review.googlesource.com/c/1329885 Commit-Queue: Dmitry Titov <dimich@chromium.org> Reviewed-by: Dan H <harringtond@google.com> Cr-Commit-Position: refs/heads/master@{#606970} [modify] https://crrev.com/09142f77c551ba7e95ce975970d1cd58ba947455/chrome/browser/offline_pages/prefetch/offline_metrics_collector_impl.cc
,
Nov 10
,
Nov 19
902486 looks like a duplicate then?
,
Nov 19
seems they are the same one.
,
Nov 27
Issue 902486 has been merged into this issue. |
||||
►
Sign in to add a comment |
||||
Comment 1 by dtapu...@chromium.org
, Sep 17