New issue
Advanced search Search tips

Issue 890381 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 13
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 1
Type: Bug-Regression



Sign in to add a comment

SigninInteractionControllerTestCase/testSignInSwitchManagedAccount fails with WKBasedNavigationManager

Project Member Reported by danyao@chromium.org, Sep 28

Issue description

SigninInteractionControllerTestCase/testSignInSwitchManagedAccount fails with --enable-features=SlimNavigationManager flag.

Stacktrace:
[0925/124745.077167:FATAL:wk_based_navigation_manager_impl.mm(456)] Check failed: !is_restore_session_in_progress_.
  0   ios_chrome_ui_egtests               0x0000000106bc591d base::debug::StackTrace::StackTrace(unsigned long) + 157
  1   ios_chrome_ui_egtests               0x0000000106bc595d base::debug::StackTrace::StackTrace(unsigned long) + 29
  2   ios_chrome_ui_egtests               0x000000010688bbec base::debug::StackTrace::StackTrace() + 28
  3   ios_chrome_ui_egtests               0x00000001068d1e4c logging::LogMessage::~LogMessage() + 460
  4   ios_chrome_ui_egtests               0x00000001068cfaf5 logging::LogMessage::~LogMessage() + 21
  5   ios_chrome_ui_egtests               0x0000000105488566 web::WKBasedNavigationManagerImpl::Restore(int, std::__1::vector<std::__1::unique_ptr<web::NavigationItem, std::__1::default_delete<web::NavigationItem> >, std::__1::allocator<std::__1::unique_ptr<web::NavigationItem, std::__1::default_delete<web::NavigationItem> > > >) + 246
  6   ios_chrome_ui_egtests               0x000000010548952d web::WKBasedNavigationManagerImpl::LoadIfNecessary() + 173
  7   ios_chrome_ui_egtests               0x000000010647e75d -[Tab view] + 525
  8   ios_chrome_ui_egtests               0x00000001057a8041 -[BrowserViewController displayTab:] + 593
  9   ios_chrome_ui_egtests               0x00000001057957a8 -[BrowserViewController setActive:] + 1000
 
Components: UI>Browser>Navigation
Project Member

Comment 2 by sheriffbot@chromium.org, Oct 2

This issue is marked as a release blocker with no milestone associated. Please add an appropriate milestone.

All release blocking issues should have milestones associated to it, so that the issue can tracked and the fixes can be pushed promptly.

Thanks for your time! To disable nags, add the Disable-Nags label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: M-72
Labels: Proj-WKBackForwardListTestFailures
Labels: -ReleaseBlock-Stable -M-72
The crash is triggered by this assert:

[SigninEarlGreyUtils assertSignedInWithIdentity:identity];

Somehow this calls -[BrowserViewController setActive] in a wait loop, which ends up calling NavigationManagerImpl::Restore() multiple times.

A solution is to early return if Restore() is called before the previous one finishes.
I misunderstood the problem earlier. The actual cause of the crash is setting web usage to false while there is an in-progress Restore(). The authentication flow (managed by ios/chrome/browser/ui/authentication/authentication_flow.mm) triggers this use case:

- In the SignOutIfNeeded step, -[MainController removeBrowsingDataForBrowserState:] calls WebStateImpl::SetWebUsageEnabled(false) immediately followed by WebStateImpl::SetWebUsageEnabled(true). This kicks off the session restore in navigation manager.
- In the subsequent ClearData state, -[MainController removeBrowsingDataForBrowserState:] is called again and interrupts the in-progress session restore.

I'm not sure if removing browsing data twice is necessary for authentication, but it seems reasonable that NavigationManager should support entering detached mode during session restore.
Project Member

Comment 8 by bugdroid1@chromium.org, Nov 13

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

commit 169e31d00bea9e9d7875f2a14bb967634c130da6
Author: Danyao Wang <danyao@chromium.org>
Date: Tue Nov 13 17:27:33 2018

[Nav Experiment] Use restore completion callback to clear browsing data.

This CL adds a new AddRestoreCompletionCallback APIs to
NavigationManager. Since session restore is asynchronous in slim nav,
this allows callers to registers a completion callback that
NavigationManager will execute when session restore completes.
LegacyNavigationManager always runs the completion handler synchronously.

[MainController -removeBrowsingDataForBrowserState:] is refactored to
wait for session restore completion.

This fixes SigninInteractionControllerTestCase/
testSignInSwitchManagedAccount.

Bug:  890381 
Change-Id: Iae660ab054514a9db8d75804a7a8d9599b234d7e
Reviewed-on: https://chromium-review.googlesource.com/c/1331568
Commit-Queue: Danyao Wang <danyao@chromium.org>
Reviewed-by: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607633}
[modify] https://crrev.com/169e31d00bea9e9d7875f2a14bb967634c130da6/ios/chrome/app/main_controller.mm
[modify] https://crrev.com/169e31d00bea9e9d7875f2a14bb967634c130da6/ios/web/navigation/navigation_manager_impl.h
[modify] https://crrev.com/169e31d00bea9e9d7875f2a14bb967634c130da6/ios/web/navigation/navigation_manager_impl.mm
[modify] https://crrev.com/169e31d00bea9e9d7875f2a14bb967634c130da6/ios/web/navigation/navigation_manager_impl_unittest.mm
[modify] https://crrev.com/169e31d00bea9e9d7875f2a14bb967634c130da6/ios/web/navigation/wk_based_navigation_manager_impl.h
[modify] https://crrev.com/169e31d00bea9e9d7875f2a14bb967634c130da6/ios/web/navigation/wk_based_navigation_manager_impl.mm
[modify] https://crrev.com/169e31d00bea9e9d7875f2a14bb967634c130da6/ios/web/public/navigation_manager.h
[modify] https://crrev.com/169e31d00bea9e9d7875f2a14bb967634c130da6/ios/web/public/test/fakes/test_navigation_manager.h
[modify] https://crrev.com/169e31d00bea9e9d7875f2a14bb967634c130da6/ios/web/public/test/fakes/test_navigation_manager.mm

Status: Fixed (was: Assigned)

Sign in to add a comment