Bug 343559 - Desktop freeze randomly + black screen on 2nd monitor - kwin problem
Summary: Desktop freeze randomly + black screen on 2nd monitor - kwin problem
Status: RESOLVED DOWNSTREAM
Alias: None
Product: plasmashell
Classification: Plasma
Component: Desktop Containment (show other bugs)
Version: 5.2.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: 1.0
Assignee: Sebastian Kügler
URL:
Keywords:
: 344350 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-01-30 08:41 UTC by mhruscak
Modified: 2015-11-25 18:15 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
whereismyplasma_stdout (594.26 KB, text/plain)
2015-02-09 14:48 UTC, mhruscak
Details
second_whereismyplasma.txt_masks (72.22 KB, text/plain)
2015-02-11 08:17 UTC, mhruscak
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mhruscak 2015-01-30 08:41:20 UTC
specifications: Lenovo t440s with docking station, external monitor connected to docking station with DVI cable. Fedora 21 with KDE plasma-workstation 

This bug annoys me every time a turn-on my computer without docking station and external monitor. Then turn-off(not sleep or hibernate) plug in to docking station with attached ext. monitor and after that turn-on -> black screen (probably plasma-desktop not loaded correctly) Any other applications, shortcuts works fine. Nothing special in logs nor in processes observed. Seems like desktop wallpaper and all widget on second monitor are covered with black color, because when trying to unplug monitor or detach from docking station, the desktop shows for half a second or less.

I have found some workarounds, the best is restart kwin, but not working everytime.

Reproducible: Always

Steps to Reproduce:
1. power-on notebook without any connected HW(mouse, monitor, etc)
2. normal power-off 
3. attach to docking station with external monitor connected
4. power-on -> log-in
5. black desktop screen appears Actual results: plasma-desktop is all black and inactive

Actual Results:  
plasma-desktop freezes 
1)after restarting with different HW connected
2)after resuming from sleep
3)randomly

Expected Results:  
plasma-desktop should load and work after log-in 

Possible workaround: 
1) When I reinstall KDE plasma desktop group using yum, it works as expected for 1-2 times, then happened again. 
2) Start the notebook without plugging it into docking station, log-in -> attach to docking-station(monitor will not be detected automatically) -> system settings -> display and monitor -> manually enable external monitor - works for me Contact me pleae on email if you will need some log files or something.
3) Switch to tty2 -> kill kwin -> go back to tty1 -> run kwin
Comment 1 mhruscak 2015-01-30 08:42:45 UTC
I have reported it in similar bug before, logs should be attached there https://bugs.kde.org/show_bug.cgi?id=329958
Comment 2 Thomas Lübking 2015-01-30 15:14:26 UTC
1. Which KDE/Plasma/KWin version is this
2. does the desktop "return" when suspending the compositor (SHIFT+Alt+F12)
3. does the desktop respond to input events (eg. show a popup on RMB clicks or trigger a Virtual desktop switch on wheel events - given your system is configured this way)
4. please run "xwininfo" (in konsole) and when the cursor turns into a '+', click the black desktop. The n post the output here.


I doubt that the other bug is related to your observations, notably since it's largely resume from STR driven
Comment 3 mhruscak 2015-01-30 17:31:01 UTC
1)
kwin:
kwin-4.11.14-3.fc21.x86_64
kwin-libs-4.11.14-3.fc21.x86_64

plasma:
kde-settings-plasma-21-2.fc21.noarch
kde-plasma-nm-l2tp-0.9.3.5-4.fc21.x86_64
kde-plasma-nm-openvpn-0.9.3.5-4.fc21.x86_64
kde-plasma-nm-0.9.3.5-4.fc21.x86_64
kde-plasma-nm-openswan-0.9.3.5-4.fc21.x86_64
kdeplasma-addons-libs-4.14.3-1.fc21.x86_64
plasma-scriptengine-python-4.11.14-3.fc21.x86_64
kde-plasma-translatoid-1.30-12.svn01092011.fc21.x86_64
kde-plasma-nm-vpnc-0.9.3.5-4.fc21.x86_64
kde-plasma-nm-openconnect-0.9.3.5-4.fc21.x86_64
kdeplasma-addons-4.14.3-1.fc21.x86_64
kde-plasma-folderview-4.14.3-4.fc21.x86_64
kde-plasma-nm-pptp-0.9.3.5-4.fc21.x86_64

KDE4 probably:
kde-runtime-docs-4.14.3-3.fc21.noarch
kdelibs-4.14.3-8.fc21.x86_64
lockdev-1.0.4-0.17.20111007git.fc21.x86_64
kde-baseapps-libs-4.14.3-4.fc21.x86_64
kde-settings-plasma-21-2.fc21.noarch
kde-l10n-4.14.3-1.fc21.noarch
kdepim-runtime-4.14.3-1.fc21.x86_64
kde-plasma-nm-l2tp-0.9.3.5-4.fc21.x86_64
kdepimlibs-gpgme-4.14.3-1.fc21.x86_64
xsettings-kde-0.12.3-10.fc21.x86_64
kde-plasma-nm-openvpn-0.9.3.5-4.fc21.x86_64
polkit-kde-0.99.1-5.20130311git.fc21.x86_64
heisenbug-kde-theme-19.90.5-3.fc21.noarch
kde-filesystem-4-49.fc21.x86_64
kde-plasma-nm-0.9.3.5-4.fc21.x86_64
kde-runtime-flags-4.14.3-3.fc21.noarch
kde-style-oxygen-4.11.14-3.fc21.x86_64
kdepim-runtime-libs-4.14.3-1.fc21.x86_64
kdegraphics-strigi-analyzer-4.14.3-1.fc21.x86_64
kde-plasma-nm-openswan-0.9.3.5-4.fc21.x86_64
kde-baseapps-common-4.14.3-4.fc21.noarch
kdepimlibs-kxmlrpcclient-4.14.3-1.fc21.x86_64
kdepasswd-4.14.3-4.fc21.x86_64
kde-settings-pulseaudio-21-2.fc21.noarch
kdeplasma-addons-libs-4.14.3-1.fc21.x86_64
kde-plasma-translatoid-1.30-12.svn01092011.fc21.x86_64
f21-kde-theme-20.90-1.fc21.noarch
pykde4-4.14.3-1.fc21.x86_64
kdelibs-common-4.14.3-8.fc21.x86_64
kdepim-libs-4.14.3-1.fc21.x86_64
kde-workspace-4.11.14-3.fc21.x86_64
kdepim-common-4.14.3-1.fc21.x86_64
heisenbug-backgrounds-kde-20.0.0-2.fc21.noarch
kde-partitionmanager-1.1.0-3.fc21.x86_64
kdepim-4.14.3-1.fc21.x86_64
kde-plasma-nm-vpnc-0.9.3.5-4.fc21.x86_64
libkdegames-4.14.3-1.fc21.x86_64
kde-runtime-4.14.3-3.fc21.x86_64
libreoffice-kde-4.3.5.2-11.fc21.x86_64
kde-settings-ksplash-21-2.fc21.noarch
kdepimlibs-akonadi-4.14.3-1.fc21.x86_64
kde-print-manager-4.14.3-1.fc21.x86_64
kdeaccessibility-4.14.3-1.fc21.noarch
kde-plasma-nm-openconnect-0.9.3.5-4.fc21.x86_64
colord-kde-0.3.0-4.fc21.x86_64
kde-settings-21-2.fc21.noarch
kdeplasma-addons-4.14.3-1.fc21.x86_64
f21-backgrounds-kde-21.1.0-1.fc21.noarch
kde-runtime-drkonqi-4.14.3-3.fc21.x86_64
kde-workspace-libs-4.11.14-3.fc21.x86_64
kde-baseapps-4.14.3-4.fc21.x86_64
kdegames-minimal-4.14.3-1.fc21.noarch
kde-runtime-libs-4.14.3-3.fc21.x86_64
kdepimlibs-4.14.3-1.fc21.x86_64
kde-print-manager-libs-4.14.3-1.fc21.x86_64
kde-settings-kdm-21-2.fc21.noarch
kde-plasma-folderview-4.14.3-4.fc21.x86_64
kdelibs-webkit-4.14.3-8.fc21.x86_64
kdegraphics-thumbnailers-4.14.3-1.fc21.x86_64
kde-plasma-nm-pptp-0.9.3.5-4.fc21.x86_64

2. - not tried yet, will try and update soon

3. - RMB click - responding
      wheel event - not tried yet

4. - will update soon
Comment 4 mhruscak 2015-02-05 08:22:46 UTC
4) 
-screen goes black after start of the system
-xwininfo stdout
[mhruscak@mhruscak ~]$ xwininfo #right_external_monitor

xwininfo: Please select the window about which you
          would like information by clicking the
          mouse in that window.

xwininfo: Window id: 0xb2 (the root window) (has no name)

  Absolute upper-left X:  0
  Absolute upper-left Y:  0
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 3840
  Height: 1080
  Depth: 24
  Visual: 0x20
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x22 (installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +0+0  -0+0  -0-0  +0-0
  -geometry 3840x1080+0+0

[mhruscak@mhruscak ~]$ xwininfo #left_builtin_monitor

xwininfo: Please select the window about which you
          would like information by clicking the
          mouse in that window.

xwininfo: Window id: 0xb2 (the root window) (has no name)

  Absolute upper-left X:  0
  Absolute upper-left Y:  0
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 3840
  Height: 1080
  Depth: 24
  Visual: 0x20
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x22 (installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +0+0  -0+0  -0-0  +0-0
  -geometry 3840x1080+0+0
Comment 5 Thomas Lübking 2015-02-05 12:02:07 UTC
There's no visible desktop window.

Is a "plasma-desktop" process running?
Did you perhaps receive a notification that it crashed or similar?
Comment 6 mhruscak 2015-02-06 07:47:18 UTC
2. no, it is not returning when press ctrl-alt-F12 and bask F1 - just shows desktop background for half an second and then goes black
3. no, wheel scrolling is not responding even if it is configured to switch over virtual desktops

plasma-desktop is running

not even the smallest trace of failing or error connected to plasma-desktop in all /var/log/ files
Comment 7 Thomas Lübking 2015-02-06 10:50:23 UTC
(In reply to mhruscak from comment #6)

> plasma-desktop is running

Ok, let's sett where it has stashed its windows then:

Please run:

xwininfo -root -tree | grep -i plasma > wheresmyplasma.txt
for ID in `xwininfo -root -tree | grep -i plasma | sed 's/\s*\([^\s]*\) .*/\1/'`; do xwininfo -id $ID >> wheresmyplasma.txt; xprop -id  $ID  >> wheresmyplasma.txt; done

(!these are two lines only, beware ony copying if bugzially dares to split them up!)

and attach the resulting "wheresmyplasma.txt"
Comment 8 mhruscak 2015-02-09 14:48:33 UTC
Created attachment 90993 [details]
whereismyplasma_stdout
Comment 9 Thomas Lübking 2015-02-09 15:36:38 UTC
That's more than odd - there're two desktop type plasma windows that cover exactly the geometry of the root window.
Both are mapped (and, ftr., on all VDs and activities) and InputOutput.

=> Was that dump really taken when there are no desktop windows (but a black background which would provide the xwininfo of the root window)?

In case, I could only imagine the windows where totally shaped away:

xwininfo -root -tree | grep -i plasma > wheresmyplasma.txt
for ID in `xwininfo -root -tree | grep -i plasma | sed 's/\s*\([^\s]*\) .*/\1/'`; do xwininfo -shape -id $ID >> wheresmyplasma.txt; done

This should tell about masks.
Comment 10 mhruscak 2015-02-11 08:17:34 UTC
Created attachment 91022 [details]
second_whereismyplasma.txt_masks

commands executed right after login with both black desktops
Comment 11 mhruscak 2015-02-11 08:18:26 UTC
yes, first whereismayplasma.txt file was generated right after login too
Comment 12 Thomas Lübking 2015-02-11 15:06:37 UTC
The second dup does not contain anythhing that would possibly qualify for a plasma desktop window - what seems a plasmashell bug, but - while it explains the described setup - does not fit the suggested "Switch to tty2 -> kill kwin -> go back to tty1 -> run kwin" workaround.

(Such windows do simply not exist, kwin cannot show them)

The only explanation would be that the restart of kwin implies a restart in the compositor and that causes plasma to reconfigure (and thus add the desktop windows)

Please suspend the compositor, wait ~30 seconds and resume it (both by Alt+Shift+F12, notice: SHIFTT, you're not supposed to alter the VT, I overread that in comment #6) to see whether that makes the desktop windows show up as well.
Comment 13 mhruscak 2015-02-16 12:43:06 UTC
In fact this workaround was more complicated as I wrote it, I have tried many more thing before get it work, so just these steps would not solve the problem. It worked just in one case so nevermind that.

Suspend compositor with ctrl-alt-f12 for 30sec or more did not worked

The simpliest solution is not to connect notebook to docking station during booting, and connect it to dock after login and then manually turn on monitor System Settings -> Display and Monitor -> thick second monitor -> apply - this works everytime

I forgot to test removing .kde settings(or create new user), if the problem is not in some settings forgotten from Fedora 20
Comment 14 Thomas Lübking 2015-02-16 21:46:15 UTC
@plasma devs:
It seems that under certain conditions (notably a dualscreen setup on login) *no* desktop window is created, see https://bugs.kde.org/attachment.cgi?id=91022

This might be due to an interim setup with all screens removed and/or the root size (thus) shrinked to 0x0px.

However, the rootwindow is at some point properly sized, so the windows should have been added then.
Comment 15 mhruscak 2015-02-18 11:53:34 UTC
so, finally I have find out probably the root cause of the problem.
When I have changed System Settings -> Desktop Effects -> Advanced -> Composition type: from OpenGL to XRender the problem stopped.
I was trying install latest Intel drivers, but it did not loaded Desktop at all, so I remove it. But after that I do not change Composition type back to XRender.
Maybe installing and removing of the drivers was trigger for this behaviour.
Comment 16 Thomas Lübking 2015-02-18 17:12:14 UTC
(In reply to mhruscak from comment #15)
> so, finally I have find out probably the root cause of the problem.
> When I have changed System Settings -> Desktop Effects -> Advanced ->
> Composition type: from OpenGL to XRender the problem stopped.

I severely doubt the compositor could cause plasmashell to just not create desktop windows.

I could assume the coexistence of multiple GL contexts to cause a crash (in the driver) of either plasmashell or kwin.
Also a totally black screen or desktop window (GL errors, invalid textures) would be in the cards.

But the total absence of desktop windows (comment #4) must have another reason.
Comment 17 mhruscak 2015-02-19 08:35:55 UTC
sorry for wrong input. I have logged in this morning and it happens again. Even with the XRender setting...so problem still opened.

I will reinstall whole Fedora this weekend and post the results, hope this last possible option will work.
Comment 18 Thomas Lübking 2015-02-19 14:25:59 UTC
I suspect some interim broken screen layout and a missed update by plasmashell (ie. kscreen removes all screens to re-add them and plasmashell gets stuck in the "no screen" state)

You could try (needs konsole or xterm etc.) to
$ xrandr -q
to check the present sceren layout. Now assuming your external monitor is labeled DVI-I-1:
$ xrandr --output DVI-I-1 --off
$ xrandr --output DVI-I-1 --auto

and see what happens.
Comment 19 mhruscak 2015-02-20 08:39:51 UTC
xrandr command worked, but it only clone screens(default set is 2 extended monitor), so I need to set it back to extended. Plasma desktop not show at all.
The second monitor is turned on when I start comp, but it is black.

Strange is, that if I kill -9 plasma-desktop and rerun it, the following errors goes to errOUT:

plasma-desktop(3050)/libplasma Plasma::isPluginVersionCompatible: unversioned plugin detected, may result in instability                                                                                                                  
QGraphicsLinearLayout::insertItem: cannot insert null item                                                           
plasma-desktop(3050)/libplasma Plasma::AppletPrivate::mainConfigGroup: requesting config for "Translator" without a containment! 
plasma-desktop(3050)/libplasma Plasma::Applet::itemChange: Configuration object was requested prior to init(), which is too early. Please fix this item: QGraphicsItem(0) FolderView (this = 0x21bfbd0 , parent = 0x0 , pos = QPointF(0, 3708) , z = 0 , flags =  ( ItemIsFocusable | ItemClipsChildrenToShape | ItemUsesExtendedStyleOption | ItemSendsGeometryChanges ) ) "Translator" 
plasma-desktop(3050)/libplasma Plasma::isPluginVersionCompatible: unversioned plugin detected, may result in instability 
plasma-desktop(3050)/libplasma Plasma::isPluginVersionCompatible: unversioned plugin detected, may result in instability 
plasma-desktop(3050)/libplasma Plasma::isPluginVersionCompatible: unversioned plugin detected, may result in instability 
plasma-desktop(3050)/libplasma Plasma::isPluginVersionCompatible: unversioned plugin detected, may result in instability 
plasma-desktop(3050)/libplasma Plasma::isPluginVersionCompatible: unversioned plugin detected, may result in instability 
plasma-desktop(3050)/libplasma Plasma::isPluginVersionCompatible: unversioned plugin detected, may result in instability 
plasma-desktop(3050)/libplasma Plasma::isPluginVersionCompatible: unversioned plugin detected, may result in instability 
Object::connect: No such signal org::freedesktop::UPower::Device::Changed()
Object::connect: No such signal org::freedesktop::UPower::Device::Changed()
Object::connect: No such signal org::freedesktop::UPower::Device::Changed()
Object::connect: No such signal org::freedesktop::UPower::Device::Changed()
Object::connect: No such signal org::freedesktop::UPower::Device::Changed()
[mhruscak@mhruscak ~]$ ========================>  7 0
static bool QDeclarativeMetaType::isModule(const QByteArray&, int, int) Qt 4.7 import detected; please note that Qt 4.7 is directly reusable as QtQuick 1.x with no code changes. Continuing, but startup time will be slower.

I cannot find them in any log files, it just appears by plasma-desktop startup.
Comment 20 mhruscak 2015-02-26 10:24:14 UTC
so, after OS reinstallation to Fedora 21 with KDE desktops it works flawlessly even using backuped ~/.kde settings.
It normally load both monitors and then load plasma (icons, backgrounds) - so the problem must lie somewhere in wrong update.
Nice to know commands used to debug, they can be useful in future.
Thank You Thomas for your support, I appreciate it very much.
Comment 21 Thomas Lübking 2015-02-26 12:40:09 UTC
Thanks for the update.

This looks suspicious, but I've no knowledge in this context:
--------------------------
plasma-desktop(3050)/libplasma Plasma::AppletPrivate::mainConfigGroup: requesting config for "Translator" without a containment! 
plasma-desktop(3050)/libplasma Plasma::Applet::itemChange: Configuration object was requested prior to init(), which is too early. Please fix this item: QGraphicsItem(0) FolderView (this = 0x21bfbd0 , parent = 0x0 , pos = QPointF(0, 3708) , z = 0 , flags =  ( ItemIsFocusable | ItemClipsChildrenToShape | ItemUsesExtendedStyleOption | ItemSendsGeometryChanges ) ) "Translator" 

Fyi, usually the default kill (-15, SIGTERM) is sufficient.
You should not use -9 (SIGINT) unless *really*required (and if it is, that usually/often indicates a deadlock in the client)
Comment 22 Rex Dieter 2015-03-13 18:41:12 UTC
*** Bug 344350 has been marked as a duplicate of this bug. ***