New issue
Advanced search Search tips

Issue 869540 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Aug 3
Cc:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 3
Type: Bug



Sign in to add a comment

URL mismatch fails DCHECK

Project Member Reported by jzw@chromium.org, Jul 31

Issue description

Chrome Version: 70.0.3509.0
OS: iOS

What steps will reproduce the problem?
(1) Open "https://i.ifeng.com"
(2) Visit a news article with scrollable images displayed in a lightbox.
    Look for an article whose thumbnail has a number in the bottom right corner.

What is the expected result?
No DCHECK.

What happens instead?
DCHECK fails:
Result: App crashes with exception: FATAL:error_retry_state_machine.mm(112)] Check failed: web::GetWebClient()->IsAppSpecificURL(url_) || web_view_url == url_. 


 
Cc: danyao@chromium.org
Danyao, is this a known bug?
Owner: danyao@chromium.org
Status: Assigned (was: Untriaged)
I've seen this DCHECK, but haven't tracked down the root cause. Will take a look with this set of repro steps.
I traced the WKNavigationDelegate callbacks on this page:

-- decidePolicy https://inews.ifeng.com/59537818/news.shtml, 0
-- didCommit [<WKNavigation: 0x7f83a7a499a0>, 12] https://inews.ifeng.com/59537818/news.shtml
-- decidePolicy https://inews.ifeng.com/59537818/news.shtml#imgnum=1, -1
-- didFinish [<WKNavigation: 0x7f83a7a499a0>, 12] https://inews.ifeng.com/59537818/news.shtml#imgnum=1

For some reason, WKWebView changed the URL on the navigation between commit and finish. There is no server redirect or replaceState calls. So I suspect this is due to a location.replace() in the onload handler.

This discrepancy triggers the DCHECK.

There is already code in |didCommit| that update navigation item URL. I think it's safe to update the item in |didFinish| as well, because item, context are both tied to WKNavigation* object.




Project Member

Comment 4 by bugdroid1@chromium.org, Aug 2

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

commit 46dccb72144637b29b2b39a259f9feae8d4acfea
Author: Danyao Wang <danyao@google.com>
Date: Thu Aug 02 21:06:27 2018

[Nav Experiment] Sync navigation item URL to WKWebView in edge case.

This works around a quirk of WKWebView that changes URL in between
didCommit and didFinish callback of the same WKNavigation. This fixes
DCHECK in error_try_state_machine.mm.

Bug:  869540 
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I5fd9b35732a9717de47bdfb43d1e943770b2f9ee
Reviewed-on: https://chromium-review.googlesource.com/1157911
Commit-Queue: Danyao Wang <danyao@chromium.org>
Reviewed-by: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580318}
[modify] https://crrev.com/46dccb72144637b29b2b39a259f9feae8d4acfea/ios/web/web_state/ui/crw_web_controller.mm

Status: Fixed (was: Assigned)
Status: Verified (was: Fixed)
Enabled Slim navigation manager flag for verification.

Verified on chrome canary version 70.0.3515.0 on iPhone 8 plus with iOS 12 beta 6 and iPad Pro wit hiOS 11.4.1, following the steps mentioned in comment #0, no crashes are noticed.


Sign in to add a comment