Created attachment 985711 [details] Backtrace Description of problem: When changing displays, one reason plasmashell can crash is an unsafe access to ShellCorona::m_screenConfiguration which can be null, see attached backtrace (other crash reasons are various issues with Qt5, see #1083664). The minimal fix for this particular crash is to check m_screenConfiguration in ShellCorona::reconsiderOutputs, there are however many other unsafe accesses to reconsiderOutputs all over. See first attached patch. Another fix would be to ensure screenConfiguration is always initialized with a default constructed KScreen::Config and let KScreen::Config take care of returning sane values when no outputs are connected. See second attached patch. Version-Release number of selected component (if applicable): plasma-workspace-5.2.0-3.fc22.x86_64
Created attachment 985712 [details] Proposed patch 1: check m_screenConfiguration in ShellCorona::reconsiderOutputs
Created attachment 985713 [details] Proposed patch 2: initialize m_screenConfiguration with default constructed KScreen::Config
Would you mind submitting the patches to upstream for review? You should upload it to git.reviewboard.kde.org and set group to "plasma". Although I'm partially responsible for this code, the Plasma devs will know better if this is a sufficient and correct fix.
Before posting upstream: this patch together with what I posted here [1] seems to stop things from crashing when changing display configuration. As noted in [1] however, plasmashell (and kwin) occasionally seem to get their geometry messed up, but I suspect this is a kscreen issue. Daniel, since you are one of the authors of kscreen, do you have any idea whether the messed up geometry might indeed be a kscreen issue? [1] https://bugreports.qt.io/browse/QTBUG-42985?focusedCommentId=271750
See also, https://bugs.kde.org/show_bug.cgi?id=342413 which looks a lot like what we're seeing here (I added a comment there saying as much)
The geometry mess is probably caused by another problems in KScreen-Plasma integration, but you crash fix seems OK to me. It should be tackled in a different patch.
Posted for review: https://git.reviewboard.kde.org/r/122506/ By the way, to what extent are KDE upstream and the F21 Plasma5 feature authors aware of all these screen related issues? Upstream Qt5 issues have been open and largely ignored for the past two or so years. Some patches for the most severe issues (i.e. those resulting in unconditional crashes of any qt5 application as a result of screen switching) have now been accepted (resp. are being reviewing), but there are still a number of harder to debug issues causing pain, not only crashes but also things like menus popping up misplaced and windows not correctly redrawing anymore. Honestly, the chance of having a usable desktop after a screen configuration change as it stands now is very very low. Unless there is a reasonable expectation of things getting more stable soonish, I really think that shipping Plasma5 in F21 should be reconsidered.
Dan is one upstream kscreen developer, he's CC'd here and monitoring situation closely.
I guess this has been fixed at the source with the fixes which landed in Qt (and are in the Fedora package). Closing.