New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 646982 link

Starred by 2 users

Issue metadata

Status: Duplicate
Merged: issue 777594
Owner:
Closed: Nov 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug

Blocking:
issue 361137



Sign in to add a comment

X Error when closing secondary display Ozone GLX

Project Member Reported by kylec...@chromium.org, Sep 14 2016

Issue description

When running Chrome for Ozone X11 and using GLX there is an X Error that occurs when closing a secondary display. Closing the primary display does not cause the same error.

Sample Error:
X Error:  BadWindow
  Request Major code 4 ()
  ResourceID 0x4200006
  Error Serial #161
  Current Serial #165

Steps To Reproduce:
gn gen out/oxygen --args="use_goma=true is_component_build=true is_debug=false use_ozone=true ozone_auto_platforms=false ozone_platform_x11=true ozone_platform=\"x11\" target_os=\"chromeos\""
$ ninja -C out/oxygen chrome
$ out/oxygen/chrome --use-gl=desktop --ash-debug-shortcuts
Hit ctrl+shift+d to create a new display (opens a new XWindow).
Hit ctrl+shift+d to close the new display (closes a new XWindow).

The X Error is caused by SGIVideoSyncProviderThreadShim::~SGIVideoSyncProviderThreadShim:

https://cs.chromium.org/chromium/src/ui/gl/gl_surface_glx.cc?type=cs&q=~SGIVideoSyncProviderThreadShim

It's XDestroyWindow(display_, window_) that cause it. When running a similar configuration built with USE_X11 instead of USE_OZONE the same XWindow is destroyed without any errors.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Sep 15 2016

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

commit 91c50202bdc063ddb898c62c84eb183fbb317759
Author: kylechar <kylechar@chromium.org>
Date: Thu Sep 15 15:59:58 2016

Default to EGL instead of GLX with Ozone X11.

There is a bug destroying one of the XWindows created for the
VSyncProvider. When that bug is fixed the default should be GLX again.

BUG= 646982 

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

[modify] https://crrev.com/91c50202bdc063ddb898c62c84eb183fbb317759/ui/ozone/platform/x11/x11_surface_factory.cc

Blocking: 361137
Cc: halliwell@chromium.org
Hey Kyle, wanted to check in and get an update on this bug - thanks :)
I haven't had a chance to look at it yet :(

Comment 6 by sadrul@chromium.org, Jan 25 2017

Cc: sadrul@chromium.org reve...@chromium.org
When this bug is fixed (i.e. GLX is the default), the --show-overdraw-feedback flag will work correctly with ozone-x11 on a desktop build. Until then, we need to explicit use --use-gl=desktop for the overdraw flag to work.
Cc: kylec...@chromium.org
Owner: ----
Status: Available (was: Untriaged)
Blocking: 671355
Project Member

Comment 9 by bugdroid1@chromium.org, Jun 21 2017

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

commit a684564707cab9131ffeb1eba84cf1b92beb03fb
Author: kylechar <kylechar@chromium.org>
Date: Wed Jun 21 14:47:49 2017

Make --use-gl=desktop default for Ozone X11.

This switches Ozone X11 from --use-gl=egl as the default to
--use-gl=desktop. This is consistent with X11 CrOS build. Desktop GL
uses GLX which has better driver support.

Ozone X11 didn't use --use-gl=desktop originally because there was a
crash running mus when closing XWindows. I can't reproduce the original
crash from  crbug.com/646982  but the problem has to do with shutdown
order. In mus we destroy the PlatformWindow before the GPU destroys the
GLSurface for that window. GLX adds a nested XWindow inside that
PlatformWindows XWindow. When the outer XWindow is destroyed all nested
XWindows are also destroyed. The GPU ends up calling XMakeCurrent() on
an XWindow that has been destroyed.

Change the shutdown order in mus-ws to avoid this problem.

Bug:  646982 
Change-Id: Ieaf764df1417cf740e6a316f91055435029c970e
Reviewed-on: https://chromium-review.googlesource.com/537032
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#481205}
[modify] https://crrev.com/a684564707cab9131ffeb1eba84cf1b92beb03fb/services/ui/ws/window_server.cc
[modify] https://crrev.com/a684564707cab9131ffeb1eba84cf1b92beb03fb/ui/ozone/platform/x11/x11_surface_factory.cc

Status: Fixed (was: Available)
This should be fixed. I can't actually reproduce the original bug anymore but have fixed a related bug in mus.

halliwell@: If the error still reproduces for cast tests then it's probably shutdown order related.
I can't reproduce this any more on latest build, seems to be fixed :)
Owner: kylec...@chromium.org
Status: Started (was: Fixed)
With ctrl+d developer shortcut working mustash I can reproduce the original problem again. It's exactly the same issue, we are not destroying the GL things for the AcceleratedWidget before we destroy the PlatformWindow (and it's XWindow).

I finally tracked down why this works in non-mustash Chrome. There is a sync IPC from browser to gpu to destroy GL things that happens before the PlatformWindow is destroyed.

https://cs.chromium.org/chromium/src/gpu/ipc/client/command_buffer_proxy_impl.cc?sq=package:chromium&dr=CSs&l=952
Blocking: -671355
Mergedinto: 777594
Status: Duplicate (was: Started)

Sign in to add a comment