thunderbird snap does not work without x11 interface connected

Bug #2003192 reported by A333
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mozilla Thunderbird
Invalid
Unknown
thunderbird (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When I disconnect the thunderbird from the x11 interface thunderbird crashes saying it can not find the wayland socket. If I add a link to the wayland socket inside the container thunderbird works fine. That is on kubuntu 22.04 in a plasma/wayland session, MOZ_ENABLE_WAYLAND=1 is set on the host and in the container as well.

This also probably means that the thunderbird snap actually never uses native wayland and falls back to xwayland (because the wayland socket can not be found).

This unintended use of xwayland could be construed as a security issue, but someone who mistrusts snaps using x11 (like me) will remove the permission which leads to failure instead of a security issue.

$ snap run thunderbird ## BROKEN
...
[GFX1-]: glxtest: libpci missing
[GFX1-]: glxtest: Could not connect to wayland socket
[GFX1-]: No GPUs detected via PCI

(thunderbird:103861): Gtk-WARNING **: 12:37:14.162: cannot open display: :1
ExceptionHandler::GenerateDump cloned child 103976
ExceptionHandler::SendContinueSignalToChild sent continue signal to child
ExceptionHandler::WaitForContinueSignal waiting for continue signal...

$ snap run --shell thunderbird ## FIXING IT
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

user@user-mycomputer:/$ ln -s /run/user/1000/wayland-0 $XDG_RUNTIME_DIR/ ; exit
$ snap run thunderbird ## NOW IT WORKS

$ lsb_release -rd ## UBUNTU VERSION
Description: Ubuntu 22.04.1 LTS
Release: 22.04

$ snap interfaces thunderbird ## SNAP CONFIGURATION
Slot Plug
gnome-3-38-2004:gnome-3-38-2004 thunderbird
gtk-common-themes:gtk-3-themes thunderbird
gtk-common-themes:icon-themes thunderbird
gtk-common-themes:sound-themes thunderbird
:audio-playback thunderbird
:browser-support thunderbird:browser-sandbox
:cups-control thunderbird
:desktop thunderbird
:desktop-legacy thunderbird
:gsettings thunderbird
:home thunderbird
:network thunderbird
:opengl thunderbird
:system-files thunderbird:etc-thunderbird-policies
:wayland thunderbird
thunderbird:dbus-daemon -
- thunderbird:avahi-observe
- thunderbird:camera
- thunderbird:gpg-keys
- thunderbird:network-control
- thunderbird:removable-media
- thunderbird:u2f-devices
- thunderbird:x11

$ snap info thunderbird ## THUNDERBIRD SNAP VERSION
...
installed: 102.7.0-1 (288) 106MB -

$ snap --version ## SNAPD etc VERSION
snap 2.58
snapd 2.58
series 16
ubuntu 22.04
kernel 5.15.0-57-generic

A333 (agrrr3)
description: updated
description: updated
summary: - thunderbird snap does not work without x11
+ thunderbird snap does not work without x11 interface connected
A333 (agrrr3)
description: updated
Revision history for this message
A333 (agrrr3) wrote :

Note: such a workaround is basically necessary for every snap using wayland. The mir project mentions this in their documentation about using ubuntu-frame in IoT and provides a wayland-launch helper script.

For documentation and script see the “wayland interface dance” in https://mir-server.io/docs/iot-gui-snaps-made-easy

Revision history for this message
In , A333 (agrrr3) wrote :
Download full text (3.2 KiB)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0

Steps to reproduce:

In a wayland session: I disconnect the thunderbird snap from the x11 interface in order to run it native on wayland.

If I do not disconnect it, it seems to use xwayland as information leaks out to other X11 applications.

Note: i tried to report this first to https://bugs.launchpad.net/ubuntu/+source/thunderbird/+bug/2003192 and will try to link that bug to this one

Actual results:

Thunderbird crashes saying it can not find the wayland socket.
If I add a link to the wayland socket inside the container thunderbird works fine. That is on kubuntu 22.04 in a plasma/wayland session, MOZ_ENABLE_WAYLAND=1 is set on the host and in the container as well.

This also probably means that the thunderbird snap actually never uses native wayland and falls back to xwayland (because the wayland socket can not be found).

This unintended use of xwayland could be interpreted as a security issue.
Someone who mistrusts snaps using X11 (like me) will remove the permission which leads to failure instead of a security issue.

$ snap run thunderbird ## BROKEN
...
[GFX1-]: glxtest: libpci missing
[GFX1-]: glxtest: Could not connect to wayland socket
[GFX1-]: No GPUs detected via PCI

(thunderbird:103861): Gtk-WARNING **: 12:37:14.162: cannot open display: :1
ExceptionHandler::GenerateDump cloned child 103976
ExceptionHandler::SendContinueSignalToChild sent continue signal to child
ExceptionHandler::WaitForContinueSignal waiting for continue signal...

$ snap run --shell thunderbird ## FIXING IT
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

user@user-mycomputer:/$ ln -s /run/user/1000/wayland-0 $XDG_RUNTIME_DIR/ ; exit
$ snap run thunderbird ## NOW IT WORKS

$ lsb_release -rd ## UBUNTU VERSION
Description: Ubuntu 22.04.1 LTS
Release: 22.04

$ snap interfaces thunderbird ## SNAP CONFIGURATION
Slot Plug
gnome-3-38-2004:gnome-3-38-2004 thunderbird
gtk-common-themes:gtk-3-themes thunderbird
gtk-common-themes:icon-themes thunderbird
gtk-common-themes:sound-themes thunderbird
:audio-playback thunderbird
:browser-support thunderbird:browser-sandbox
:cups-control thunderbird
:desktop thunderbird
:desktop-legacy thunderbird
:gsettings thunderbird
:home thunderbird
:network thunderbird
:opengl thunderbird
:system-files thunderbird:etc-thunderbird-policies
:wayland thunderbird
thunderbird:dbus-daemon -
- thunderbird:avahi-observe
- thunderbird:camera
- thunderbird:gpg-keys
- thunderbird:network-control
- thunderbird:removable-media
- thunderbird:u2f-devices
- thunderbird:x11

$ snap info thunderbird ## THUNDERBIRD SNAP VERSION
...
installed: 102.7.0-1 (288) 106MB -

$ snap --version ## SNAPD etc VERSION
snap 2.58
snapd 2.58
series 16
ubuntu 22.04
kernel 5.15.0-57-generic

Expected results:

Thunderbird should have run natively on wayland (without me having to fiddle inside the snap container).

Note: such a workaround is basically necessary for every snap using wayland. The mir project mentions this in their documentation about using ubuntu-frame in IoT and provides a wayland-launch helper script.
For documentat...

Read more...

Changed in thunderbird:
status: Unknown → New
Revision history for this message
In , A333 (agrrr3) wrote :

here the interfaces with better formatting
```
$ snap interfaces thunderbird ## SNAP CONFIGURATION
Slot Plug
gnome-3-38-2004:gnome-3-38-2004 thunderbird
gtk-common-themes:gtk-3-themes thunderbird
gtk-common-themes:icon-themes thunderbird
gtk-common-themes:sound-themes thunderbird
:audio-playback thunderbird
:browser-support thunderbird:browser-sandbox
:cups-control thunderbird
:desktop thunderbird
:desktop-legacy thunderbird
:gsettings thunderbird
:home thunderbird
:network thunderbird
:opengl thunderbird
:system-files thunderbird:etc-thunderbird-policies
:wayland thunderbird
thunderbird:dbus-daemon -
- thunderbird:avahi-observe
- thunderbird:camera
- thunderbird:gpg-keys
- thunderbird:network-control
- thunderbird:removable-media
- thunderbird:u2f-devices
- thunderbird:x11
```

Revision history for this message
In , Vseerror-i (vseerror-i) wrote :

Does this also reproduce when using version 115 started in Help > Troubleshoot Mode?
If it does, and you have not already done so, please list complete steps to reproduce.

Revision history for this message
In , A333 (agrrr3) wrote :

Yes it does reproduce in 115 .

Hinting it to use wayland using MOZ_ENABLE_WAYLAND=1 snap run thunderbird gives more errors but finally also fails when looking for a X display.

Adding the link to the wayland socket still solves it.

No, it is not possible to start Help > Troubleshoot Mode without the modification (because there is no UI). Also running snap thunderbird -safe-mode tells one that cannot open display: 1 (failing to find wayland and then trying X11).

How to reproduce?
* start a wayland session
* sudo snap install thunderbird
* sudo snap disconnect thunderbird:x11
* MOZ_ENABLE_WAYLAND=1 snap run thunderbird

Revision history for this message
In , A333 (agrrr3) wrote :

still a problem with snap stable revisision 389 (115.3.1-1) and snap beta revision 389 (119.0b3-1)

Revision history for this message
In , A333 (agrrr3) wrote :

err: that broken thunderbird snap beta revision is 391 (119.0b3-1)

Revision history for this message
Sebastien Bacher (seb128) wrote :

Could you try if the new revision in the candidate (or beta) channel fixes the issue?

Revision history for this message
A333 (agrrr3) wrote :

It looks this is fixed in stable|candidate 115.3.2-2 (395) and in beta 119.0b5-1 (397) as well.

Revision history for this message
A333 (agrrr3) wrote :

How i tested: I tried on ubuntu with disconnected x11, with two users (uid 1000, uid 1001). Starting with fresh ~/snap/thunderbird dirs. For beta I also updated from a profile in use. LGTM

Revision history for this message
In , A333 (agrrr3) wrote :

Already commented on the ubuntu bug tracker:

It looks this is fixed in stable|candidate 115.3.2-2 (395) and in beta 119.0b5-1 (397) as well.

How i tested: I tried on ubuntu with disconnected x11, with two users (uid 1000, uid 1001). Starting with fresh ~/snap/thunderbird dirs. For beta I also updated from a profile in use. LGTM

Changed in thunderbird (Ubuntu):
status: New → Fix Released
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks!

Changed in thunderbird:
status: New → Invalid
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.