New issue
Advanced search Search tips

Issue 699765 link

Starred by 0 users

Issue metadata

Status: Verified
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Crash when changing display with virtual keyboard and unified desktop enabled

Project Member Reported by xiy...@chromium.org, Mar 8 2017

Issue description

Repro:
1. Run chrome with VK and unified desktop;
  e.g.
   out/Debug/chrome --user-data-dir=/tmp/chrome_test --ash-host-window-bounds="0+0-1280x768,0+800-800x800" --login-user=stub-user@example.com --login-profile=user --enable-virtual-keyboard --ash-enable-unified-desktop
2. Activate virtual keyboard by clicking on any text field;
3. Change display to trigger DisplayManager to add/remove display,
  e.g. Ctrl+F4 to toggle mirror/extended mode;

At step 3 chrome crashes.

Stack:
Received signal 11 SEGV_MAPERR 000000000020
#0 0x7f3ffa32bf9b base::debug::StackTrace::StackTrace()
#1 0x7f3ffa32a66c base::debug::StackTrace::StackTrace()
#2 0x7f3ffa32baaf base::debug::(anonymous namespace)::StackDumpSignalHandler()
#3 0x7f3ffa771330 <unknown>
#4 0x7f3feb2a303c std::basic_streambuf<>::pbase()
#5 0x7f3feb620a54 ash::RootWindowController::DeactivateKeyboard()
#6 0x7f3feb6203f6 ash::RootWindowController::CloseChildWindows()
#7 0x7f3feb61ec65 ash::RootWindowController::Shutdown()
#8 0x7f3feb5dcc6d ash::WindowTreeHostManager::DeleteHost()
#9 0x7f3feb5dc6bf ash::WindowTreeHostManager::OnDisplayAdded()
#10 0x7f3fec284993 display::DisplayManager::NotifyDisplayAdded()
#11 0x7f3fec28118f display::DisplayManager::UpdateDisplaysWith()
#12 0x7f3fec28226b display::DisplayManager::ReconfigureDisplays()
#13 0x7f3fec28534c display::DisplayManager::SetMirrorMode()
#14 0x7f3feb5b07e0 ash::DisplayConfigurationController::SetMirrorModeImpl()

==== 
Happened in AshPopupAlignmentDelegateTest.Unified while working on the SessionStateDelegate replacment CL (https://codereview.chromium.org/2734933004/). The CL makes SessionStateChanged happen during test setup (contrary to TestSessionStateDelegate which silent set its session state), thus WmShellAura::SessionStateChanged->Shell::CreateKeyboard->RootWindowController::ActivateKeyboard is executed. ActivateKeyboard add workspace_controller()->layout_manager() as its observer [1].

However, when display is changed, we do the following in WindowTreeHostManager::DeleteHost [2]:
    controller->MoveWindowsTo(GetPrimaryRootWindow());
    controller->Shutdown();

In RootWindowController::MoveWindowsTo, we do [3]
    workspace_controller_.reset();

But workspace_controller_->layout_manager() is still in the observer list of KeyboardController. After this point, crash happens when KeyboardController needs to notify its observers. Usually, this would happen RootWindowController::Shutdown() where we have Shutdown->CloseChildWindows->DeactivateKeyboard, as observed in the stack above.

[1]: https://cs.chromium.org/chromium/src/ash/root_window_controller.cc?rcl=549709e6de482297978cd245b82f78c900b22515&l=680
[2]: https://cs.chromium.org/chromium/src/ash/display/window_tree_host_manager.cc?rcl=95ff5bc751ba619a7c37155eec85c1adcadb01bc&l=659,662
[3]: https://cs.chromium.org/chromium/src/ash/root_window_controller.cc?rcl=99a36d9c50e75619f5f5203137869009c2b88bbc&l=646
 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 14 2017

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

commit 3816018a25a5da936828fa62a2eae92e14fe363e
Author: xiyuan <xiyuan@chromium.org>
Date: Tue Mar 14 22:50:13 2017

ash: Start/stop observing KeyboardController via ShellObserver

- Add ScopedObserver to layout managers that observes KeyboardController
  so that they stop observing it when destructed;
- Layout managers start/stop observing KeyboardController via ShellObserver;

BUG= 699765 

Review-Url: https://codereview.chromium.org/2747543002
Cr-Commit-Position: refs/heads/master@{#456874}

[modify] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/ash/BUILD.gn
[add] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/ash/common/keyboard/keyboard_observer_register.cc
[add] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/ash/common/keyboard/keyboard_observer_register.h
[modify] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/ash/common/shelf/shelf_layout_manager.cc
[modify] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/ash/common/shelf/shelf_layout_manager.h
[modify] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/ash/common/shell_observer.h
[modify] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/ash/common/wm/dock/docked_window_layout_manager.cc
[modify] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/ash/common/wm/dock/docked_window_layout_manager.h
[modify] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/ash/common/wm/lock_layout_manager.cc
[modify] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/ash/common/wm/lock_layout_manager.h
[modify] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/ash/common/wm/panels/panel_layout_manager.cc
[modify] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/ash/common/wm/panels/panel_layout_manager.h
[modify] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/ash/common/wm/workspace/workspace_layout_manager.cc
[modify] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/ash/common/wm/workspace/workspace_layout_manager.h
[modify] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/ash/root_window_controller.cc
[modify] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/ash/shell.cc
[modify] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/ash/shell.h
[modify] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/chrome/browser/chromeos/login/lock/webui_screen_locker.cc
[modify] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/chrome/browser/chromeos/login/lock/webui_screen_locker.h
[modify] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/chrome/browser/chromeos/login/ui/login_display_host_impl.cc
[modify] https://crrev.com/3816018a25a5da936828fa62a2eae92e14fe363e/chrome/browser/chromeos/login/ui/login_display_host_impl.h

Comment 2 by xiy...@chromium.org, Mar 15 2017

Status: Fixed (was: Assigned)
Status: Verified (was: Fixed)

Sign in to add a comment