[kwin] [Bug 397767] Selecting Desktop On-Screen Display Crashes Kwin on Virtual Desktop Change

2018-09-13 Thread David Edmundson
https://bugs.kde.org/show_bug.cgi?id=397767

David Edmundson  changed:

   What|Removed |Added

 Resolution|--- |FIXED
  Latest Commit||https://commits.kde.org/kwi
   ||n/d485dfe7ef1910a7f66526103
   ||88ae2d93cdec29f
 Status|CONFIRMED   |RESOLVED

--- Comment #9 from David Edmundson  ---
Git commit d485dfe7ef1910a7f6652610388ae2d93cdec29f by David Edmundson.
Committed on 13/09/2018 at 09:19.
Pushed by davidedmundson into branch 'master'.

Avoid crash with on scripted window teardown with threaded quick render loop

Summary:
Qt render loops behave quite differently to each other.

KWin scripting as a workaround for another situation cleans
(17553e5a1fb72a92dbbff3fa6bc7d55b8f1a0123) handles tracking of script
windows by deleting the underlying window handle on hide.

This currently happens before the window gets the hideEvent.

Arguably this is a quirk with Qt, but in the current state:

- QSGThreadedRenderLoop deletes the platform window and cleans up
- We then get the hide() event. This no-ops because there's no window.
   (else branch of case WM_TryRelease in qsgthreadedrenderloop.cpp)
- We carry on rendering animations despite having no platform
- undefined behaviour

Normally this isn't a problem as typically destruction of the platform window
happens only when a window is being deleted, we're messing with Qt
internals here.

If we make sure the QHideEvent is processed by the render loop first,
things seem fine.

Test Plan:
Ran QSG_RENDER_LOOP=threaded
Read output with scenegraph logging rules on

Reviewers: #kwin, broulik

Reviewed By: broulik

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D15025

M  +2-2scripting/scripting.cpp

https://commits.kde.org/kwin/d485dfe7ef1910a7f6652610388ae2d93cdec29f

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 397767] Selecting Desktop On-Screen Display Crashes Kwin on Virtual Desktop Change

2018-08-23 Thread David Edmundson
https://bugs.kde.org/show_bug.cgi?id=397767

David Edmundson  changed:

   What|Removed |Added

 Status|REOPENED|CONFIRMED

--- Comment #8 from David Edmundson  ---
>Would you mind explaining to me what is happening?

We have a bug.

I don't get a crash if I force my system to be threaded, but I do see in the
logs it doing something stupid and the wrong way round.

We have destruction and cleanup in a separate thread in QtQuick, and we're
pulling out the surface and context at a weird point.

scripting.cpp
connect(window, ::visibilityChanged, [window](QWindow::Visibility
visibility) {

 if (visibility == QWindow::Hidden) {
 window->destroy();
 }

fine if you're synced. Qt has special code if you're in the window destructor,
but not for calling destroy on the platform window explicitly.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 397767] Selecting Desktop On-Screen Display Crashes Kwin on Virtual Desktop Change

2018-08-23 Thread dD_
https://bugs.kde.org/show_bug.cgi?id=397767

--- Comment #7 from dD_  ---
I tried it as you said and I cannot make it crash.  Just to be sure I returned
to my previous settings, and it wouldn't crash either.  

So I opened chromium on both screens (which is what I had done yesterday) and
it crashes again on my previous settings, but not with OSG_RENDER_LOOP=basic. 
I've been trying it for several minutes with all rendering backends (open gl
3.1, xrender, and opengl 2.0) and cannot make it crash at all. 

So it seems that was the problem, thank you!  Would you mind explaining to me
what is happening? And how can I make the changes permanent?

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 397767] Selecting Desktop On-Screen Display Crashes Kwin on Virtual Desktop Change

2018-08-23 Thread dD_
https://bugs.kde.org/show_bug.cgi?id=397767

--- Comment #6 from dD_  ---
Sure, just so I understand, you want me to reenable the desktop switch
on-screen display with kwin as: QSG_RENDER_LOOP=basic kwin_x11 --replace and
then try to crash it, correct?

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 397767] Selecting Desktop On-Screen Display Crashes Kwin on Virtual Desktop Change

2018-08-23 Thread David Edmundson
https://bugs.kde.org/show_bug.cgi?id=397767

--- Comment #5 from David Edmundson  ---
Please can you run with

QSG_RENDER_LOOP=basic kwin_x11 --replace

and report back

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 397767] Selecting Desktop On-Screen Display Crashes Kwin on Virtual Desktop Change

2018-08-23 Thread dD_
https://bugs.kde.org/show_bug.cgi?id=397767

dD_  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|RESOLVED|REOPENED
 Resolution|UPSTREAM|---

--- Comment #4 from dD_  ---
> qdbus org.kde.kwin /KWin supportInformation

Attached the output for qdbus org.kde.KWin /KWin supportInformation above. 
Output does not change with Desktop Switch On-Screen Display.

> and clarify which Desktop Switch On-Screen Display you're referring to

I'm not sure what this means, but I selected the Desktop Switch On-Screen
Display, with 500 msec and show desktop indicators selected.  I tried with and
without the desktop cube animation, and it crashes no matter which desktop I'm
changing from.  


About the crash happening in the nvidia driver (if it does).  It  happens only
when a particular trivial setting is on (that does not require additional
animation), even if it is an issue with nvidia drivers, wouldn't that make it
is fixable? 

Let me know if you need anything else.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 397767] Selecting Desktop On-Screen Display Crashes Kwin on Virtual Desktop Change

2018-08-23 Thread dD_
https://bugs.kde.org/show_bug.cgi?id=397767

--- Comment #3 from dD_  ---
Created attachment 114559
  --> https://bugs.kde.org/attachment.cgi?id=114559=edit
output of qdbus org.kde.KWin /KWin supportInformation

This is the output of org.kde.KWin /KWin support information. 

The output does not change if I select or remove the desktop on-screen display.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 397767] Selecting Desktop On-Screen Display Crashes Kwin on Virtual Desktop Change

2018-08-23 Thread David Edmundson
https://bugs.kde.org/show_bug.cgi?id=397767

David Edmundson  changed:

   What|Removed |Added

 CC||k...@davidedmundson.co.uk

--- Comment #2 from David Edmundson  ---
This is relevant in the stderr:

QOpenGLContext::swapBuffers() called with non-exposed window, behavior is
undefined

if it is undefined, we can't necessarily blame nvidia just yet.

dD can you post output of

 qdbus org.kde.kwin /KWin supportInformation

and clarify which  Desktop Switch On-Screen Display you're referring to

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 397767] Selecting Desktop On-Screen Display Crashes Kwin on Virtual Desktop Change

2018-08-22 Thread Martin Flöser
https://bugs.kde.org/show_bug.cgi?id=397767

Martin Flöser  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |UPSTREAM

--- Comment #1 from Martin Flöser  ---
Crash happens in the proprietary Nvidia driver. Nothing we can do.

-- 
You are receiving this mail because:
You are watching all bug changes.