Plasma crashes when the monitor is disconnected (when it sleeps, in some cases)

Bug #1548766 reported by Shawn Rutledge on 2016-02-23
This bug affects 14 people
Affects Status Importance Assigned to Milestone
qtbase-opensource-src (Ubuntu)
Timo Jyrinki

Bug Description

I'm reporting this on behalf of a coworker who has a 4K monitor, which disconnects whenever it sleeps. Older monitors didn't do that; but Qt 5.5 tries to be honest about it: the QScreen is destroyed whenever its corresponding monitor is disconnected, QGuiApplication::primaryScreen() returns null, and so on. KDE developers have been complaining. So in Qt 5.6 we made it keep the last-remaining QScreen as a fake instance, whenever the last monitor is disconnected. The main patch is here

You might need to cherry-pick that (a094af001795c9651b299d700a992150d1aba33a in qtbase) for as long as you are shipping Qt 5.5, to get Kubuntu behaving decently. It's relevant on Ubuntu 16.04. Too bad that Ubuntu LTS is not shipping the LTS Qt 5.6 release, but I know we are behind on our release schedule.

Some users have also reported that their laptop's screen disconnects when it sleeps. And I have often experienced 5.5-based builds of Creator crashing or disappearing when I switch machines on my KVM. So, sorry that we didn't fix it sooner. It was my mistake for believing that modeling disappearing screens "correctly" was a good idea: it turned out to be a platform inconsistency which developers were not ready for.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in qtbase-opensource-src (Ubuntu):
status: New → Confirmed
summary: - KDE crashes when the monitor is disconnected (when it sleeps, in some
+ Plasma crashes when the monitor is disconnected (when it sleeps, in some
Timo Jyrinki (timo-jyrinki) wrote :

Thank you for the report, that one hasn't been cherry-picked yet in Debian or Ubuntu while many others have been.

Changed in qtbase-opensource-src (Ubuntu):
assignee: nobody → Timo Jyrinki (timo-jyrinki)
status: Confirmed → In Progress
Joseph Yasi (joe-yasi) wrote :

I've been suffering the same issue. Plasma crashes every time my 4K monitor sleeps or is turned off in Kubuntu 15.10. I had to pull in Qt 5.5 and this patch to make my desktop usable.

macolu (f-ubuntu-g) wrote :

This will also solve issues with laptops using docking station (and attached screens): when you dock/undock laptop, Plasma crashes almost all the times.

Timo Jyrinki (timo-jyrinki) wrote :

Hi! Could you test by upgrading to ppa:ci-train-ppa-service/landing-031 on xenial? (qtbase version 5.5.1+dfsg-14ubuntu2~xenial1~test10)

The patch in question was not trivial to backport due to multitude of changes after 5.5 but before this patch in 5.6, but in the end I managed to leave the rebasing modifications quite small, while taking in two other patches and one line of code from a third patch.

It seems to continue to work fine in single monitor case with KDE but I can't test the actual bug at the moment.

Ryan (carbonfreeze) wrote :

I tested the ppa in comment #5, and I note the following changes.

Environment is a docked laptop with 2 external displays.

When the laptop is removed from the dock (external displays disconnected), I no longer receive a segfault for plasmashell, but the panel does not automagicailly resize to the new resolution.

When the external displays are reconnected, plasmashell segfaults (same as previous/xenial behavior). I think this issue is resolved in QT5.5, but not specific to this bug/patch.

Atleast I don't have to restart plasma every time I dock/undock, but behavior is still less than optimal. Progress though.

I installed the ppa. I have two monitors. Disconnecting and reconnecting one is OK, but I have a script for disconnecting and reconnecting both; in that case plasma still crashes.

outputs=`xrandr | grep -i "^\\w" | grep connected | cut -d' ' -f1`
for o in $outputs
        alloff="$alloff --output $o --off"
echo $alloff
echo $restore
sleep 2

Timo Jyrinki (timo-jyrinki) wrote :

I'm publishing the current silo as it seems to improve things and no regressions spotted. I'll ask you to test yet another build next week with Paul's promising sounding patch if I get it backported:

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtbase-opensource-src - 5.5.1+dfsg-14ubuntu2

qtbase-opensource-src (5.5.1+dfsg-14ubuntu2) xenial; urgency=medium

  * debian/patches/enable-tests.patch: some qnetworkcookiejar tests have
    started failing without any Qt changes (LP: #1548686)
  * Notify-when-the-primary-screen-changes.patch
    - Another multi-monitor crasher fix and its pre-requirement patches
      (LP: #1548766)
    - Rebase the patches slightly to apply to Qt 5.5.
  * Merge with unreleased Debian's 5.5.1+dfsg-15

 -- Timo Jyrinki <email address hidden> Fri, 26 Feb 2016 07:03:24 +0000

Changed in qtbase-opensource-src (Ubuntu):
status: In Progress → Fix Released
Timo Jyrinki (timo-jyrinki) wrote :

Continuing at bug #1551122

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers