New issue
Advanced search Search tips

Issue 735449 link

Starred by 2 users

Issue metadata

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

Blocking:
issue 671355



Sign in to add a comment

Unified desktop does not work on ozone x11

Project Member Reported by osh...@chromium.org, Jun 21 2017

Issue description

rjkroege@, can you find the right owner?

Repro step:
1) build chrome for chromeos on linux
2) run with ----ash-dev-shortcuts --ash-enable-unified-desktop
3) ctrl+shift+D

Received signal 11 SEGV_MAPERR 000000000008
#0 0x7f7d3135a92b base::debug::StackTrace::StackTrace()
#1 0x7f7d3135966c base::debug::StackTrace::StackTrace()
#2 0x7f7d3135a43f base::debug::(anonymous namespace)::StackDumpSignalHandler()
#3 0x7f7d317c4330 <unknown>
#4 0x7f7d27c10378 display::Display::SetSize()
#5 0x7f7d22fa35f2 display::DisplayManager::UpdateDisplayBounds()
#6 0x7f7d2227388e ash::WindowTreeHostManager::OnHostResized()
#7 0x7f7d269b2da8 aura::WindowTreeHost::OnHostResizedInPixels()
#8 0x7f7d269bad58 aura::WindowTreeHostPlatform::OnBoundsChanged()
#9 0x7f7d142391c0 ui::X11WindowBase::ProcessXWindowEvent()
#10 0x7f7d1423c5c8 ui::X11WindowOzone::DispatchXEvent()
#11 0x7f7d1429795b ui::X11EventSourceLibevent::DispatchXEventToXEventDispatchers()
#12 0x7f7d14297580 ui::X11EventSourceLibevent::ProcessXEvent()
#13 0x7f7d14289178 ui::X11EventSource::ExtractCookieDataDispatchEvent()
#14 0x7f7d1428927c ui::X11EventSource::BlockOnWindowStructureEvent()
#15 0x7f7d14289212 ui::X11EventSource::BlockUntilWindowMapped()
#16 0x7f7d14238963 ui::X11WindowBase::Show()
#17 0x7f7d269ba83d aura::WindowTreeHostPlatform::ShowImpl()
#18 0x7f7d269b391d aura::WindowTreeHost::Show()
#19 0x7f7d22255df3 ash::MirrorWindowController::UpdateWindow()
#20 0x7f7d2227398e ash::WindowTreeHostManager::CreateOrUpdateMirroringDisplay()
#21 0x7f7d22fa3796 display::DisplayManager::CreateMirrorWindowIfAny()
#22 0x7f7d22fc25ef _ZN4base8internal13FunctorTraitsIMN7display14DisplayManagerEFvvEvE6InvokeIRKNS_7WeakPtrIS3_EEJEEEvS5_OT_DpOT0_
#23 0x7f7d22fc254a _ZN4base8internal12InvokeHelperILb1EvE8MakeItSoIRKMN7display14DisplayManagerEFvvERKNS_7WeakPtrIS5_EEJEEEvOT_OT0_DpOT1_
#24 0x7f7d22fc24d2 _ZN4base8internal7InvokerINS0_9BindStateIMN7display14DisplayManagerEFvvEJNS_7WeakPtrIS4_EEEEEFvvEE7RunImplIRKS6_RKSt5tupleIJS8_EEJLm0EEEEvOT_OT0_NS_13IndexSequenceIJXspT1_EEEE
#25 0x7f7d22fc241c _ZN4base8internal7InvokerINS0_9BindStateIMN7display14DisplayManagerEFvvEJNS_7WeakPtrIS4_EEEEEFvvEE3RunEPNS0_13BindStateBaseE
#26 0x7f7d31319cfe _ZNO4base8CallbackIFvvELNS_8internal8CopyModeE0ELNS2_10RepeatModeE0EE3RunEv
#27 0x7f7d3135fe21 base::debug::TaskAnnotator::RunTask()
#28 0x7f7d313eedde base::MessageLoop::RunTask()
#29 0x7f7d313ef047 base::MessageLoop::DeferOrRunPendingTask()
#30 0x7f7d313ef35f base::MessageLoop::DoWork()
#31 0x7f7d314017bc base::MessagePumpLibevent::Run()
#32 0x7f7d313ee843 base::MessageLoop::Run()
#33 0x7f7d3148e5b7 base::RunLoop::Run()
#34 0x55d49303c716 ChromeBrowserMainParts::MainMessageLoopRun()
#35 0x7f7d2a70a8fb content::BrowserMainLoop::RunMainMessageLoopParts()
#36 0x7f7d2a7162f5 content::BrowserMainRunnerImpl::Run()
#37 0x7f7d2a704708 content::BrowserMain()
#38 0x7f7d2bff84b6 content::RunNamedProcessTypeMain()
#39 0x7f7d2bffa76f content::ContentMainRunnerImpl::Run()
#40 0x7f7d2bff727a content::ContentServiceManagerMainDelegate::RunEmbedderProcess()
#41 0x7f7d31a7cf37 service_manager::Main()
#42 0x7f7d2bff7fdb content::ContentMain()
#43 0x55d490f8e02c ChromeMain
#44 0x55d490f8df22 main
#45 0x7f7d1589df45 __libc_start_main

 
Cc: rjkroege@chromium.org
Owner: kylec...@chromium.org
Status: Started (was: Untriaged)
That'd be me.
Blocking: 671355
When ctrl+d is used to open the second display we enter unified mode. There are two XWindows that correspond to the displays with ids 2200000000 and 2200000001. As unified mode is enabled those two displays are not present in |active_display_list_|. Instead only the unified display id -10 is in |active_display_list_|.

The new XWindow gets repositioned after it is created (it extends beyond the edge of my 1080p monitor). This triggers DisplayManager::UpdateDisplayBounds() to get called for display id 2200000001.

https://cs.chromium.org/chromium/src/ui/display/manager/display_manager.cc?l=1113

When FindDisplayForId(2200000001) is called it returns nullptr because only the unified display id -10 is in |active_display_list_|. The nullptr Display* is used without checking if it is valid and it segfaults.

I can reproduce the same error with a USE_X11 build if I resize one of the XWindows in unified display mode. I'm not sure why the USE_X11 build doesn't reposition the new XWindow when opening the second display.
The reason for the difference in behaviour between X11 and Ozone is because of differences in WindowTreeHostX11 vs WindowTreeHostPlatform. The new XWindow is repositioned on both.

WindowTreeHostPlatform has size (0, 0) initially and only the PlatformWindow knows the size. When the XWindow is reposition WindowTreeHostPlatform thinks the position changed (which is correct) and the bounds changed (which is incorrect).

WindowTreeHostX11 owns the XWindow and knows the requested size initially. When the XWindow is repositioned WindowTreeHostX11 only thinks the position changed.
Project Member

Comment 5 by bugdroid1@chromium.org, Jun 26 2017

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

commit ebbb797504b1af1fc69e0cee251aa7670ec09724
Author: kylechar <kylechar@chromium.org>
Date: Mon Jun 26 17:02:30 2017

Fix unified mode crash with CrOS running on Linux.

DisplayManager crashes when the size of WindowTreeHost changes in
unified mode. Add logic to look for the display in the software
mirroring list if in unified mode and then reconfigure the displays.

Bug:  735449 
Change-Id: I830d17e0d43e766835a26c6e8ca7d463a44ecb84
Reviewed-on: https://chromium-review.googlesource.com/545876
Commit-Queue: kylechar <kylechar@chromium.org>
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#482299}
[modify] https://crrev.com/ebbb797504b1af1fc69e0cee251aa7670ec09724/ui/display/manager/display_manager.cc

Project Member

Comment 6 by bugdroid1@chromium.org, Jun 26 2017

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

commit 52b3fa865e5be5eb8533fdbac751ea489705fad5
Author: kylechar <kylechar@chromium.org>
Date: Mon Jun 26 20:15:59 2017

Fix incorrect resized message in WindowTreeHostPlatform.

Fix WindowTreeHostPlatform calling OnHostResizedInPixels() incorrectly
if PlatformWindow is moved before it is resized. Since
WindowTreeHostPlatform wasn't storing the requested bounds, if the
PlatformWindow is moved before it is resized then WindowTreeHostPlatform
thinks the size of the window changed from (0, 0) to whatever the
requested size is.

This produces different behaviour depending on if the PlatformWindow is
moved or resized first. After the first move or resize
WindowTreeHostPlatform works as expected.

This is also divergent from WindowTreeHostX11 which works as expected.

Bug:  735449 
Change-Id: I33e76fd4ae40b03f78bd7a95a18906bc1decf9ee
Reviewed-on: https://chromium-review.googlesource.com/548816
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#482374}
[modify] https://crrev.com/52b3fa865e5be5eb8533fdbac751ea489705fad5/ui/aura/window_tree_host_platform.cc

Status: Fixed (was: Started)

Comment 8 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Sign in to add a comment