Disconnecting monitor crashes shell (wayland, gnome)

Bug #1952766 reported by bluppfisk
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
gnome-shell-extension-ubuntu-dock (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

This bug has been persisting since I've bought an external monitor for my laptop and started using Wayland (first on Ubuntu 20.04) until today (Ubuntu 21.10).

It isn't consistent, but it occurs about 90% of the time when I'm on Wayland. On Xorg, this has never occurred.

When I unplug my USB-C monitor from my laptop, the laptop screen freezes for a while before presenting me with the login screen. When I log back in, all my open applications have been shut down.

I assume Mutter crashes, taking the entire session with it.

Dmesg doesn't seem to contain anything useful.

A lot of other people seem to have this problem (see https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1733127), but all have been asked to file their own bug reports, so here I am.
---
ProblemType: Bug
ApportVersion: 2.20.11-0ubuntu71
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
DisplayManager: gdm3
DistroRelease: Ubuntu 21.10
InstallationDate: Installed on 2020-04-01 (613 days ago)
InstallationMedia: Ubuntu 19.10 "Eoan Ermine" - Release amd64 (20191017)
Package: gnome-shell 40.5-1ubuntu2
PackageArchitecture: amd64
ProcVersionSignature: Ubuntu 5.13.0-22.22-generic 5.13.19
RelatedPackageVersions: mutter-common 40.5-1ubuntu3~21.10.1
Tags: wayland-session impish third-party-packages
Uname: Linux 5.13.0-22-generic x86_64
UpgradeStatus: Upgraded to impish on 2021-10-05 (61 days ago)
UserGroups: adm cdrom dip docker libvirt lpadmin lxd plugdev sambashare sudo
_MarkForUpload: True
modified.conffile..etc.apport.crashdb.conf: [modified]
mtime.conffile..etc.apport.crashdb.conf: 2021-12-01T17:24:37.722144

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It sounds like some part of the system has crashed. To help us find the cause of the crash please follow these steps:

1. Look in /var/crash for crash files and if found run:
    ubuntu-bug YOURFILE.crash
Then tell us the ID of the newly-created bug.

2. If step 1 failed then look at https://errors.ubuntu.com/user/ID where ID is the content of file /var/lib/whoopsie/whoopsie-id on the machine. Do you find any links to recent problems on that page? If so then please send the links to us.

3. If step 2 also failed then apply the workaround from bug 994921, reboot, reproduce the crash, and retry step 1.

Please take care to avoid attaching .crash files to bugs as we are unable to process them as file attachments. It would also be a security risk for yourself.

tags: added: impish
Changed in gnome-shell (Ubuntu):
status: New → Incomplete
Revision history for this message
bluppfisk (bluppfisk) wrote (last edit ):

Thanks. The bug report is now attached to this bug.

(Some asides about the bug-uploading process:)

There was already a _usr_bin_gnome-shell.1000.crash.uploaded file, however I cannot see my bug in errors.ubuntu.com. So I went and tried doing it manually:

```
$ ubuntu-bug _usr_bin_gnome-shell.1000.crash
No such schema “org.gnome.settings-daemon.peripherals.mouse”
No such schema “org.gnome.settings-daemon.peripherals.mouse”
```

Still no uploaded bugs in errors.ubuntu.com, so I comment out the line mentioned in bug 994921.

I retried with ubuntu-bug. This time a progress indicator appeared, but it said HTTP Error 503: service unavailable.

I retried again, then it seemed to have gone through. After the bug report is uploaded, it suggested this bug and I selected "yes it affects me"

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

If 'ubuntu-bug' doesn't work then please try 'apport-cli'. Please also check https://errors.ubuntu.com/user/ID again.

Also, next time the crash happens please:

1. Wait 10 seconds.

2. Reboot.

3. Run:

   journalctl -b-1 > prevboot.txt

4. Attach the resulting text file here.

Revision history for this message
bluppfisk (bluppfisk) wrote :

attached is a log after reproducing the bug, crashing, logging in, waiting 10 seconds, rebooting, and logging. NOTE: edited for privacy reasons (names, references to VPN connections)

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Download full text (4.9 KiB)

This looks like the problem:

dec 02 23:11:31 tuhao2 gnome-shell[8076]: meta_monitor_manager_get_logical_monitor_from_number: assertion '(unsigned int) number < g_list_length (manager->logical_monitors)' failed
dec 02 23:11:31 tuhao2 gnome-shell[8076]: meta_workspace_get_work_area_for_monitor: assertion 'logical_monitor != NULL' failed
dec 02 23:11:31 tuhao2 gnome-shell[8076]: meta_display_get_monitor_in_fullscreen: assertion 'monitor >= 0 && monitor < n_logical_monitors' failed
dec 02 23:11:31 tuhao2 gnome-shell[8076]: meta_monitor_manager_get_logical_monitor_from_number: assertion '(unsigned int) number < g_list_length (manager->logical_monitors)' failed
dec 02 23:11:31 tuhao2 gnome-shell[8076]: meta_workspace_get_work_area_for_monitor: assertion 'logical_monitor != NULL' failed
dec 02 23:11:31 tuhao2 gnome-shell[8076]: meta_display_get_monitor_in_fullscreen: assertion 'monitor >= 0 && monitor < n_logical_monitors' failed
dec 02 23:11:31 tuhao2 gnome-shell[8076]: meta_monitor_manager_get_logical_monitor_from_number: assertion '(unsigned int) number < g_list_length (manager->logical_monitors)' failed
dec 02 23:11:31 tuhao2 gnome-shell[8076]: meta_workspace_get_work_area_for_monitor: assertion 'logical_monitor != NULL' failed
dec 02 23:11:31 tuhao2 gnome-shell[8076]: meta_display_get_monitor_in_fullscreen: assertion 'monitor >= 0 && monitor < n_logical_monitors' failed
dec 02 23:11:31 tuhao2 gnome-shell[8076]: meta_monitor_manager_get_logical_monitor_from_number: assertion '(unsigned int) number < g_list_length (manager->logical_monitors)' failed
dec 02 23:11:31 tuhao2 gnome-shell[8076]: meta_workspace_get_work_area_for_monitor: assertion 'logical_monitor != NULL' failed
dec 02 23:11:31 tuhao2 gnome-shell[8076]: meta_display_get_monitor_in_fullscreen: assertion 'monitor >= 0 && monitor < n_logical_monitors' failed
dec 02 23:11:31 tuhao2 gnome-shell[8076]: meta_display_get_monitor_in_fullscreen: assertion 'monitor >= 0 && monitor < n_logical_monitors' failed
dec 02 23:11:31 tuhao2 gnome-shell[8076]: DING: GNOME nautilus 40.2
dec 02 23:11:31 tuhao2 gnome-shell[8076]: meta_display_get_monitor_in_fullscreen: assertion 'monitor >= 0 && monitor < n_logical_monitors' failed
dec 02 23:11:31 tuhao2 gnome-shell[8076]: meta_monitor_manager_get_logical_monitor_from_number: assertion '(unsigned int) number < g_list_length (manager->logical_monitors)' failed
dec 02 23:11:31 tuhao2 gnome-shell[8076]: meta_workspace_get_work_area_for_monitor: assertion 'logical_monitor != NULL' failed
dec 02 23:11:33 tuhao2 gnome-shell[8076]: Window manager warning: Overwriting existing binding of keysym 37 with keysym 37 (keycode 10).
dec 02 23:11:33 tuhao2 gnome-shell[8076]: Window manager warning: Overwriting existing binding of keysym 31 with keysym 31 (keycode a).
dec 02 23:11:33 tuhao2 gnome-shell[8076]: Window manager warning: Overwriting existing binding of keysym 32 with keysym 32 (keycode b).
dec 02 23:11:33 tuhao2 gnome-shell[8076]: Window manager warning: Overwriting existing binding of keysym 33 with keysym 33 (keycode c).
dec 02 23:11:33 tuhao2 gnome-shell[8076]: Window manager warning: Overwriting existing binding of keysym 34 with keysym 34 (keycode d).
dec 0...

Read more...

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This particular bug has already been reported and is a duplicate of bug 1754687, so it is being marked as such. Please look at the other bug report to see if there is any missing information that you can provide, or to see if there is a workaround for the bug. Additionally, any further discussion regarding the bug should occur in the other report. Feel free to continue to report any other bugs you may find.

tags: removed: impish
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Since it sounds like you already have the fix for bug 1754687, this bug is now reopened.

Next please run 'apport-collect 1952766' to attach more information about the system. Once we confirm the package versions a new upstream bug will need to be created.

Revision history for this message
bluppfisk (bluppfisk) wrote : Dependencies.txt

apport information

tags: added: apport-collected impish third-party-packages wayland-session
description: updated
Revision history for this message
bluppfisk (bluppfisk) wrote : GsettingsChanges.txt

apport information

Revision history for this message
bluppfisk (bluppfisk) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
bluppfisk (bluppfisk) wrote : ProcEnviron.txt

apport information

Revision history for this message
bluppfisk (bluppfisk) wrote : ShellJournal.txt

apport information

Revision history for this message
bluppfisk (bluppfisk) wrote : monitors.xml.txt

apport information

Revision history for this message
bluppfisk (bluppfisk) wrote :

Hello Daniel, thanks for your help. Please find the requested information attached. Two extra points:

- I set the external monitor as my primary monitor, with the dock and title bar displaying here
- Since 40.1 already contains the fix for the symptoms you quoted from my report, while they are then probably unrelated to this bug, it is strange that those symptoms are still present in 40.5.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The log in comment #12 seems to mostly match bug 1951786 so maybe try briefly disabling the Ubuntu Dock extension in the 'Extensions' app and then log in again.

If that has not fixed the problem then please repeat the steps in comment #3. Then if you see the same messages as in comment #5 please open a new upstream issue at https://gitlab.gnome.org/GNOME/mutter/issues

Revision history for this message
bluppfisk (bluppfisk) wrote :

Funnily, after disabling the Ubuntu Dock (have not yet logged out and in again) and unplugging my cable, there was no crash. Then again, the crashes are not consistent so I'll try again.

This interferes with my work so much that I cannot test this constantly.

Revision history for this message
bluppfisk (bluppfisk) wrote :

After a few more disconnects with the Ubuntu Dock disabled and no crashes, it sounds like the culprit may be the Ubuntu Dock. The solution should be relatively simple then (although I'm a bit shocked that it can take down mutter)

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Extensions have free reign to do anything, including crash the shell. They are the causes of lots of our bugs. The alternative would be to disallow extensions which would be more stable but probably less popular.

Revision history for this message
bluppfisk (bluppfisk) wrote :

I'm sure the discussion has been held elsewhere, and there's been made a case against sandboxing them or handling their crashes, as lack of freedom would defeat the very purpose of these extensions?

At any rate I'm happy to have reached a solution. 3 monitor unplugs without crashes convinces me that that was the problem. Many thanks for your intervention!

I don't miss the Dock very much but it'd be interesting to see where it has been patched and when to expect it in a release. Is there any info on that? On the bug you shared, it only says "fix committed" but I am too dumb to find out where I can see the code change.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Bug 1951786 would not explain these crashes, it's just something I saw in your log.

To track down the crashes further you would need to repeat the steps in comments #1 and #3. But at least it sounds like we can assign it to ubuntu-dock now. Probably.

affects: gnome-shell (Ubuntu) → gnome-shell-extension-ubuntu-dock (Ubuntu)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Regarding your other question; sandboxing would of course be best but that's something that would need to be designed from the ground up. And then new APIs specifically for sandboxed extensions would be needed. And then we would still find either most extensions want to do things not possible in the sandbox, or most extensions never get ported to the sandbox model. So sandboxing is unlikely to ever happen. More likely that extensions would just be forbidden, but more likely than that is maintaining the status quo - extensions are allowed to do anything and break anything.

Revision history for this message
bluppfisk (bluppfisk) wrote :

Thanks for the explanation, I can understand the difficulty and hope misbehaving external extensions don't affect the image of GNOME too much.

I will reactivate the dock and repeat the steps in comments #1 and #3 at the next crash, although I'm unsure how that will bring new information as I would imagine we'll get the same information as when it happened before?

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for gnome-shell-extension-ubuntu-dock (Ubuntu) because there has been no activity for 60 days.]

Changed in gnome-shell-extension-ubuntu-dock (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Pierre A (palba-deactivatedaccount-deactivatedaccount) wrote :

I have the error

meta_monitor_manager_get_logical_monitor_from_number: assertion '(unsigned int) number < g_list_length (manager->logical_monitors)' failed

with GNOME Shell 45.3 in Manjaro after suspend and only with external monitor connected to laptop.

Revision history for this message
Pierre A (palba-deactivatedaccount-deactivatedaccount) wrote :

X11 not Wayland

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

That assertion seems to repeat in comment #5, so it's not fatal and not the root cause of any crash. Everyone still experiencing crashes please open a new bug from the affected machine and follow:

https://wiki.ubuntu.com/Bugs/Responses#Missing_a_crash_report_or_having_a_.crash_attachment

I don't think commenting here is helpful anymore. Also this bug is already closed.

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.