Bug 361799 - Crashes/visual curruption/lost windows on HIGH-dpi (4k) scaled multiscreen
Summary: Crashes/visual curruption/lost windows on HIGH-dpi (4k) scaled multiscreen
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: xrandr (show other bugs)
Version: 5.5.4
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-15 08:58 UTC by Vincenzo Di Massa
Modified: 2018-12-02 03:47 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
xorg patch I'mk using to fix mouse cursor problems (2.81 KB, patch)
2016-04-15 09:21 UTC, Vincenzo Di Massa
Details
script to setup an external (non HIGH DPI monitor) using xrandr (1020 bytes, application/x-shellscript)
2016-04-15 09:23 UTC, Vincenzo Di Massa
Details
qdbus org.kde.KWin /KWin supportInformation (5.53 KB, text/plain)
2016-04-15 09:27 UTC, Vincenzo Di Massa
Details
xorg log (49.02 KB, text/plain)
2016-04-15 09:28 UTC, Vincenzo Di Massa
Details
KWin hangs (32.03 KB, text/plain)
2016-04-18 12:16 UTC, Vincenzo Di Massa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vincenzo Di Massa 2016-04-15 08:58:32 UTC
When using the fixDisplay.sh script I get a working extended desktop on my laptop's HDMI-attached external screen. The three (related ?) problems I get are:

As soon as I run the script I (sometimes)  in one random case of the following:
1) end up with an Xorg crash (problem1)
2) end up with some of the open windows disappearing (not on any display/desktop/activity), but the processes are still running and it is still possible to list the x window ID
3) kwin works ok for a while (problem2)

While kwin is working I get reversible and temporary visual corruptions (expecially in konsole) while scrolling.

I have a patched Xorg  xorg-server-1.17.2 (because of a bug related to randr and scaling) 

xrandr -q
Screen 0: minimum 8 x 8, current 7680 x 4320, maximum 32767 x 32767
eDP1 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   3840x2160     60.00*+  48.00  
   3200x1800     60.00  
   2880x1620     60.00  
   2560x1440     60.00  
   2048x1536     60.00  
   1920x1440     60.00  
   1856x1392     60.01  
   1792x1344     60.01  
   2048x1152     60.00  
   1920x1200     59.95  
   1920x1080     60.00    59.93  
   1600x1200     60.00  
   1680x1050     59.95    59.88  
   1600x1024     60.17  
   1400x1050     59.98  
   1600x900      60.00  
   1280x1024     60.02  
   1440x900      59.89  
   1280x960      60.00  
   1368x768      60.00  
   1360x768      59.80    59.96  
   1152x864      60.00  
   1280x720      60.00  
   1024x768      60.00  
   1024x576      60.00  
   960x540       60.00  
   800x600       60.32    56.25  
   864x486       60.00  
   640x480       59.94  
   720x405       60.00  
   640x360       60.00  
HDMI1 connected 3840x2160+3840+0 (normal left inverted right x axis y axis) 443mm x 249mm
   1600x900      60.00*+
   1280x1024     60.02  
   1440x900      59.90  
   1280x720      60.00  
   1024x768      60.00  
   800x600       60.32  
   640x480       60.00  
   720x400       70.08  
VIRTUAL1 disconnected (normal left inverted right x axis y axis)





Reproducible: Sometimes

Steps to Reproduce:
1. run the patched xorg (not sure this prerequisite is ncessary)
2. attach a secondary screen
3. run the script

Actual Results:  
crash/corruption/visual problems

Expected Results:  
The external screen should just work after just running xrandr, without the need to kill kwin and kwin should not present the described problems.
Comment 1 Thomas Lübking 2016-04-15 09:05:20 UTC
(In reply to Vincenzo Di Massa from comment #0)
> When using the fixDisplay.sh script
What fixDisplay.sh script?

> 1) end up with an Xorg crash (problem1)
Xorg bug, check /var/log/Xorg.*.log for possible backtraces.

> 2) end up with some of the open windows disappearing (not on any
> display/desktop/activity), but the processes are still running and it is
> still possible to list the x window ID

Qt5 is completely broken on randr events, see bug #341497

> While kwin is working I get reversible and temporary visual corruptions
> (expecially in konsole) while scrolling.

What makes you believe this is a bug in KWin?
Does it happen with suspended compositor as well (SHIFT+Alt+F12)
Please attach the output of "qdbus org.kde.KWin /KWin supportInformation" and /var/log/Xorg.0.log

----
nb. that multiscreen is completely dysfunctional and that will remain at least until Qt5.6 & Plasma 5.7
Comment 2 Vincenzo Di Massa 2016-04-15 09:21:15 UTC
Created attachment 98404 [details]
xorg patch I'mk using to fix mouse cursor problems

https://bugs.freedesktop.org/attachment.cgi?id=94929

https://bugs.freedesktop.org/show_bug.cgi?id=39949
Comment 3 Vincenzo Di Massa 2016-04-15 09:23:48 UTC
Created attachment 98405 [details]
script to setup an external (non HIGH DPI monitor) using xrandr

The script scales the resolution of my laptop monitor down to the resolution of the attached monitor using xrandr
Comment 4 Vincenzo Di Massa 2016-04-15 09:27:08 UTC
Created attachment 98406 [details]
qdbus org.kde.KWin /KWin supportInformation
Comment 5 Vincenzo Di Massa 2016-04-15 09:28:35 UTC
Created attachment 98407 [details]
xorg log
Comment 6 Martin Flöser 2016-04-15 09:33:56 UTC
(In reply to Vincenzo Di Massa from comment #5)
> Created attachment 98407 [details]
> xorg log

that doesn't contain an xorg crash. You have to look into the old log after a crash.
Comment 7 Vincenzo Di Massa 2016-04-15 09:41:06 UTC
(In reply to Thomas Lübking from comment #1)
> (In reply to Vincenzo Di Massa from comment #0)
> What fixDisplay.sh script?
Really fast answer, I have now made it an attachment.

> > 1) end up with an Xorg crash (problem1)
> Xorg bug, check /var/log/Xorg.*.log for possible backtraces.
I'll attach next crash log.

> > 2) end up with some of the open windows disappearing (not on any
> > display/desktop/activity), but the processes are still running and it is
> > still possible to list the x window ID
> 
> Qt5 is completely broken on randr events, see bug #341497
I suspected this. Anyways it is working "sort of ok" except that in my setup (when none or all of the displays are HIGH dpi, and thus I'm not scaling.

> > While kwin is working I get reversible and temporary visual corruptions
> > (expecially in konsole) while scrolling.
> 
> What makes you believe this is a bug in KWin?
Kwin often crashes, its output spawns (cryptic for me) errors. (see attached file). I have windows listed by X that kwin does not render (I'm not sure I get how compositing works BTW).

> Does it happen with suspended compositor as well (SHIFT+Alt+F12)
> Please attach the output of "qdbus org.kde.KWin /KWin supportInformation"
> and /var/log/Xorg.0.log
Done, I'll try disablin the compositor and report back.


> ----
> nb. that multiscreen is completely dysfunctional and that will remain at
> least until Qt5.6 & Plasma 5.7
Great news! I'm really looking forward. Do you reccomend any workaround to make kwin/kde apps play nicely with my monitors in the meantime?
Comment 8 Vincenzo Di Massa 2016-04-15 09:49:45 UTC
Whooops, I realize just now that in the description I did not tell that that kwin also crashes may times a day, but ONLY in this setup.

BTW you, and the kde people, rock!
Comment 9 Thomas Lübking 2016-04-15 10:13:06 UTC
for kwin crashes, please attach the developer informations from the crash dialog (backtrace)

(reg. xorg.0.log, i wanted to check for egl/dri3 - xorg.1.log will contain x11 backtraces only directly after an xorg server crash)
Comment 10 Vincenzo Di Massa 2016-04-15 11:22:50 UTC
I tried to get such logs, but the system becomes unresponsive in such cases. I have to terminate kwin from a vt like this.

killall -9 kwin_x11 && sleep 1 ; kwin_x11 --replace & chvt 7

I realze I should s/crashes/hungs/g on my prevoius sentences.

notice that sending sigterm (or just calling kwin --replace ) does not work, thus I use sigkill.

I could run kwin into a debugger to backtrace where it crashes, would this help?
Comment 11 Thomas Lübking 2016-04-15 14:25:13 UTC
You may run into bug #353428 (is the kwin process stopped?)
And yes, a backtrace would be tremendously helpful, TIA =)
Comment 12 Vincenzo Di Massa 2016-04-18 12:16:36 UTC
Created attachment 98444 [details]
KWin hangs

Here Kwin hangs, it does not actually crash. It just gets unresponsive and clicking on anything becomes impossible even if the mouse can still be moved around. I think this happens more often than crashes. I will wait for a crash log to happen in the meantime I share this backtrace (btw I posted it yesterday on the wrong bug).

Killing kwin and restaring it does recover the situation momentarily.

I suspect I have more than one problem
Comment 13 Thomas Lübking 2016-04-18 13:50:29 UTC
This is not bug #353428 - that bug happens when kwin segfaults and fails to recover because the process stopped by drkonqui still has the WM selection on the X11 server (and can't release it since it's stopped)

The backtraces you posted look like a race condition between the QtScript and QXcbEventReader thread (at least both wait for a mutex)

Do you use some XIM (fcitx etc.)?
Comment 14 Vincenzo Di Massa 2016-04-19 08:29:49 UTC
I'm not sure what XIM is, I know it is used to extend input methods capabilities in X (if I got it correctly) but I don't know how to configure it and check if I'm using it. I guess I'm not using it since I installed an english version of kubuntu, but I'll investigate (and learn what XIM really is, btw :-) ).
Comment 15 Thomas Lübking 2016-04-19 21:07:16 UTC
It's typilcally used by Asians and Slavs and other people using the wrong alphabet - ie. not the one your ancestors stole from the Greek and propagated to the rest of the (European) world ;-)

Just asked because there's a bug about a hanging QXcbEventReader which seems tied to XIM.

I'd try w/o the Xorg patch.
While I don't really know what it changes, it does seem to introduce randr queries during input clamping (what will typically happen during input events) - it certainly looks related (but there's oc. not guarantee that this is the problem)
Comment 16 Andrew Crouthamel 2018-11-01 13:54:23 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 17 Bug Janitor Service 2018-11-16 11:40:57 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 18 Bug Janitor Service 2018-12-02 03:47:08 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!