flathub / com.discordapp.Discord

https://flathub.org/apps/details/com.discordapp.Discord
128 stars 41 forks source link

Crash on startup (Fedora 34 / GNOME / Wayland) #181

Closed Igetin closed 1 month ago

Igetin commented 3 years ago

Description of the issue

Trying to run a fresh install of the Discord Flatpak package results in the application crashing. The app briefly shows the small loading window with the text “Starting…”, after which it loads up a screen-sized empty window with windows decorations. Then that window seems to reopen once, and then the window closes with nothing happening after that.

Log output

Running flatpak run com.discordapp.Discord gives the following output:

Disabling updates already done
[6 preload-host-spawn-strategy] Running: /app/bin/zypak-helper child - /app/discord/Discord --type=zygote
Discord 0.0.16
Gtk-Message: 19:01:11.226: Failed to load module "canberra-gtk-module"
Gtk-Message: 19:01:11.226: Failed to load module "pk-gtk-module"
Gtk-Message: 19:01:11.226: Failed to load module "canberra-gtk-module"
Gtk-Message: 19:01:11.226: Failed to load module "pk-gtk-module"
Starting app.
Starting updater.
[Modules] Modules initializing
[Modules] Distribution: remote
[Modules] Host updates: disabled
[Modules] Module updates: enabled
[Modules] Module install path: /home/ige/.var/app/com.discordapp.Discord/config/discord/0.0.16/modules
[Modules] Module installed file path: /home/ige/.var/app/com.discordapp.Discord/config/discord/0.0.16/modules/installed.json
[Modules] Module download path: /home/ige/.var/app/com.discordapp.Discord/config/discord/0.0.16/modules/pending
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[Modules] No updates to install
[Modules] Host is up to date.
[Modules] Checking for module updates at https://discord.com/api/modules/stable/versions.json
[Modules] No module updates available.
Cannot upload crash dump: failed to open
--2021-10-20 19:01:11--  https://sentry.io/api/146342/minidump/?sentry_key=384ce4413de74fe0be270abe03b2b35a
Resolving sentry.io (sentry.io)... 35.188.42.15
Connecting to sentry.io (sentry.io)|35.188.42.15|:443... connected.
HTTP request sent, awaiting response... [WebContents] crashed (crashed)... reloading
400 Bad Request
2021-10-20 19:01:12 ERROR 400: Bad Request.

Unexpected crash report id length
Failed to get crash dump id.
Report Id: 
Cannot upload crash dump: failed to open
--2021-10-20 19:01:12--  https://sentry.io/api/146342/minidump/?sentry_key=384ce4413de74fe0be270abe03b2b35a
Resolving sentry.io (sentry.io)... 35.188.42.15
Connecting to sentry.io (sentry.io)|35.188.42.15|:443... connected.
HTTP request sent, awaiting response... [WebContents] double crashed (crashed)... RIP =(
400 Bad Request
2021-10-20 19:01:13 ERROR 400: Bad Request.

Unexpected crash report id length
Failed to get crash dump id.
Report Id:

App information

Running flatpak info com.discordapp.Discord gives the following output:

Discord - Messaging, Voice, and Video Client

          ID: com.discordapp.Discord
         Ref: app/com.discordapp.Discord/x86_64/stable
        Arch: x86_64
      Branch: stable
     Version: 0.0.16
     License: LicenseRef-proprietary
      Origin: flathub
  Collection: org.flathub.Stable
Installation: system
   Installed: 197.3 MB
     Runtime: org.freedesktop.Platform/x86_64/21.08
         Sdk: org.freedesktop.Sdk/x86_64/21.08

      Commit: 50cdba1d069ca5b215ea4e5ab14ea81fe48cee3a5c45a78bd7d3beaedad66073
      Parent: 7b1e7dbd12d4eb214e5dfb9285dbdb1a82e847530b49e8f39fe45c00f1906bba
     Subject: Use backups from the Internet Archive. (ecdf680c)
        Date: 2021-10-03 17:25:05 +0000

System information

Operating system: Fedora 34 GNOME version: 40.4 (mutter 40.5) Windowing system: Wayland

FilBot3 commented 3 years ago

This also happens on KDE with Fedora 34 as well. I switched from Xorg to Wayland to try it out with Nvidia cards.

Operating System: Fedora 34
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2
Kernel Version: 5.14.15-200.fc34.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 3800X 8-Core Processor
Memory: 31.3 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 2070 SUPER/PCIe/SSE2

Flatpak Permissions for Discord

➜  ~ flatpak info --show-permissions com.discordapp.Discord 
[Context]
shared=network;ipc;
sockets=x11;pulseaudio;fallback-x11;
devices=all;
filesystems=xdg-download;xdg-pictures:ro;xdg-videos:ro;/proc;

[Session Bus Policy]
org.kde.StatusNotifierWatcher=talk
org.freedesktop.Notifications=talk
com.canonical.AppMenu.Registrar=talk
com.canonical.indicator.application=talk
com.canonical.Unity.LauncherEntry=talk

When I toggle the switch in Flatseal for socket=wayland, Discord barfs and doesn't start up.

Discord with out flatpak override --socket=wayland com.discordapp.Discord

➜  ~ flatpak run com.discordapp.Discord 
Disabling updates already done
[6 preload-host-spawn-strategy] Running: /app/bin/zypak-helper child - /app/discord/Discord --type=zygote
Discord 0.0.16
Starting app.
Starting updater.
[Modules] Modules initializing
[Modules] Distribution: remote
[Modules] Host updates: disabled
[Modules] Module updates: enabled
[Modules] Module install path: /home/filbot/.var/app/com.discordapp.Discord/config/discord/0.0.16/modules
[Modules] Module installed file path: /home/filbot/.var/app/com.discordapp.Discord/config/discord/0.0.16/modules/installed.json
[Modules] Module download path: /home/filbot/.var/app/com.discordapp.Discord/config/discord/0.0.16/modules/pending
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[Modules] No updates to install
[Modules] Host is up to date.
[Modules] Checking for module updates at https://discord.com/api/modules/stable/versions.json
[Modules] No module updates available.
[2021-11-04 16:14:45.956] [136] (audio_device_generic.cc:67): SetRecordingDevice: Not supported on this platform
[...hangs here with black screen that is clickable...]

The buttons are clickable, and I can see the title bar change when I click on random elements on the screen.

Discord with flatpak override --socket=wayland com.discordapp.Discord

➜  ~ flatpak --user override --socket=wayland com.discordapp.Discord
➜  ~ flatpak run com.discordapp.Discord                      
Disabling updates already done
[6 preload-host-spawn-strategy] Running: /app/bin/zypak-helper child - /app/discord/Discord --type=zygote
Traceback (most recent call last):
  File "/app/bin/set-gtk-dark-theme.py", line 17, in <module>
    disp = Xlib.display.Display()
  File "/app/lib/python3.9/site-packages/Xlib/display.py", line 89, in __init__
    self.display = _BaseDisplay(display)
  File "/app/lib/python3.9/site-packages/Xlib/display.py", line 71, in __init__
    protocol_display.Display.__init__(self, *args, **keys)
  File "/app/lib/python3.9/site-packages/Xlib/protocol/display.py", line 84, in __init__
    name, protocol, host, displayno, screenno = connect.get_display(display)
  File "/app/lib/python3.9/site-packages/Xlib/support/connect.py", line 73, in get_display
    return mod.get_display(display)
  File "/app/lib/python3.9/site-packages/Xlib/support/unix_connect.py", line 76, in get_display
    raise error.DisplayNameError(display)
Xlib.error.DisplayNameError: Bad display name ""
Discord 0.0.16
Failed to generate minidump./app/bin/discord: line 10:     6 Segmentation fault      (core dumped) env TMPDIR=$XDG_CACHE_HOME zypak-wrapper /app/discord/Discord "$@"
vchernin commented 3 years ago

@I-g-e are you also on Nvidia?

@FilBot3 do you have xwayland 21.1.2.901 or newer on your system? It includes some important Nvidia Xwayland fixes.

Igetin commented 3 years ago

@I-g-e are you also on Nvidia?

Nope, I'm on AMD (RX 6800 XT).

FilBot3 commented 3 years ago

@FilBot3 do you have xwayland 21.1.2.901 or newer on your system? It includes some important Nvidia Xwayland fixes.

I will check. Hopefully Fedora 34 KDE has them ready. I keep it fairly up-to-date. How does one check?

vchernin commented 3 years ago

rpm -q xorg-x11-server-Xwayland

If you're up-to-date you should already have 21.1.2.901 or 21.1.3 (they're basically the same).

However note KDE 5.23.2 (in 35 testing) has GBM support for Nvidia-this is a good thing, but unfortunately due to this Qt bug: https://codereview.qt-project.org/c/qt/qtwayland/+/373473 the interface will be extremely slow (but otherwise should mostly work). Unfortunately since KDE is removing the EGLStreams backend from Plasma anyways, I doubt you will find much support on 34 with EGLStreams currently. Hopefully in a few months things will work well on 35.

lionirdeadman commented 2 years ago

Does this also happen on a non-flatpaked Discord for you? Would be rather interesting if it was specific to Flatpak.

Also, this issue doesn't happen in a Xorg session?

Igetin commented 2 years ago

The crash only happened for me on Wayland when I used the Flatpak package installed via Flathub. The RPM package installed via DNF from the RPM Fusion repository does not have the problem (which is why I'm currently using that).

I just tried logging into a Xorg session, and the Flatpak package seems to launch and run fine there.

vchernin commented 2 years ago

Can you try running Flatpak+Wayland with no gpu? flatpak run com.discordapp.Discord --disable-gpu

It is strange to have such bugs with AMD on Wayland...

For Nvidia: https://github.com/flathub/org.freedesktop.Platform.GL.nvidia/issues/76 https://github.com/flathub/org.chromium.Chromium/issues/166

lionirdeadman commented 2 years ago

I have some ideas.

@I-g-e Can you paste your permission overrides? flatpak info --show-permissions com.discordapp.Discord would do it. Maybe you did something that breaks only in Wayland somehow. Setting fallback-x11 and wayland would probably do that.

@FilBot3 You are forcing it to run in Wayland although you're not using Ozone, this will result in a crash. I'd recommend resetting your permissions as I see you've given fallback-x11 (which removes x11 access if Wayland is available). As a side note, /proc/ does not work so you might as well remove that too.

Igetin commented 2 years ago

I didn't have the Flatpak version installed anymore, so I reinstalled it now. Seems to be working fine now under Wayland… something probably changed in my system, because back when I created this issue, I tried reinstalling the app and rebooting multiple times, but got always the same crash.

I'm still running the same GNOME & mutter versions too, so the root cause probably wasn't related to those. I didn't mess with my Flatpak configuration during that time either, the last flatpak command I ran before today was the uninstall command when I gave up trying to get it working a couple of weeks ago.

@I-g-e Can you paste your permission overrides? flatpak info --show-permissions com.discordapp.Discord would do it.

This probably won't help anymore, but just in case:

[Context]
shared=network;ipc;
sockets=x11;pulseaudio;
devices=all;
filesystems=xdg-download;xdg-pictures:ro;xdg-videos:ro;

[Session Bus Policy]
org.kde.StatusNotifierWatcher=talk
org.freedesktop.Notifications=talk
com.canonical.AppMenu.Registrar=talk
com.canonical.indicator.application=talk
com.canonical.Unity.LauncherEntry=talk

Anyway, as far as I'm concerned, the issue is “resolved” — although the root cause is a mystery, as I can't reproduce the crash anymore. @FilBot3⁠'s issue seems to be a different one.

Edit: Also, something I never mentioned: my other Flatpak apps (e.g. Telegram Desktop) were working fine at the time I reported the issue, only Discord was crashing.

lionirdeadman commented 2 years ago

Anyway, as far as I'm concerned, the issue is “resolved” — although the root cause is a mystery, as I can't reproduce the crash anymore.

That's good, I'll hope nobody else is facing that bug.

FilBot3⁠'s issue seems to be a different one.

I do think it is different as well (as no data point matches other than running in a wayland session)

gati-petriashvili-twino commented 2 years ago

I've started to get the same issues on Discord, Spotify and Signal flatpak applications right after I upgraded to Fedora 35. Not sure what changed there, running with --disable-gpu does the trick as a workaroud but can't figure out how to fix the issue for good.

likeadragonmaid commented 2 years ago

This happens for me when I run Discord flatpak from KDE (both xorg and wayland). But works fine on Gnome wayland. My host is Fedora 36.

guihkx commented 1 month ago

Does this still happen?

Igetin commented 1 month ago

Hasn't happened for me since November 2021. (Nowadays I'm on Fedora 40 / GNOME 46 / X.Org).

guihkx commented 1 month ago

Thank you for confirming.

We unfortunately still have quite a few (newer) reports related to crashes here... But I'll close this one for now.