axcore / tartube

A GUI front-end for youtube-dl, partly based on youtube-dl-gui and written in Python 3 / Gtk 3
GNU Lesser General Public License v2.1
2.04k stars 110 forks source link

Segmentation fault when launching on Wayland #349

Open lfom opened 2 years ago

lfom commented 2 years ago

What operating system are you using?

Pop!_OS 21.04 (like Ubuntu 21.04)

What version of Tartube are you using?

v2.3.332 (deb package)

What happens when you run Tartube from a terminal window?

No visible errors, it just takes a while, then it shows:

[1]    853602 segmentation fault (core dumped)  tartube

From the systemd-journal:

nov 06 19:22:52 systemd[841302]: app-gnome-tartube-853478.scope: Succeeded.
nov 06 19:25:17 kernel: tartube[853602]: segfault at 7fff1deacff8 ip 00007fccde1e0853 sp 00007fff1dead000 error 6 in libgtk-3.so.0.2404.21[7fccde0d2000+385000]

$ apt policy libgtk-3-0
libgtk-3-0:
  Installed: 3.24.25-1ubuntu4.1
  Candidate: 3.24.25-1ubuntu4.1
  Version table:
 *** 3.24.25-1ubuntu4.1 500
        500 http://us.archive.ubuntu.com/ubuntu hirsute-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     3.24.25-1ubuntu4 500
        500 http://us.archive.ubuntu.com/ubuntu hirsute/main amd64 Packages

App does not launch on Gnome when using Wayland, this can be fixed by forcing Xwayland backend: GDK_BACKEND=x11 tartube

Some apps that only run on XOrg for some reason usually check for XDG_SESSION_TYPE=wayland and adapt accordingly.

axcore commented 2 years ago

Just so you know, I have no internet until about January, so I can't do any testing. I think I have never tested Tartube under Wayland.

axcore commented 2 years ago

Today I was able to test this properly.

I tested the .DEB installer for Tartube v2.3.484 on Fedora 35 Workstation, Ubuntu 21.10 and PopOS 21.10. I also tested Tartube v2.3.332 on PopOS (which was the current version when you first posted).

All of these systems are using Wayland. I didn't see any problems, certainly not any segfaults.

Some apps that only run on XOrg for some reason usually check for XDG_SESSION_TYPE=wayland and adapt accordingly.

I can't think of anything in the Tartube code that require special handling for Wayland. Maybe the graphs drawn by matplotlib (for example in Edit > System preferences > Files > History), but they aren't used until you click the Draw button, so they should not cause a segfault on startup. You could test that by removing matplotlib from your system and restarting Tartube.

If you are still having the same problem, you could try running Tartube's source code directly (as described here). Tartube v2.3.332 produces debug messages in the terminal, if a file called debug.txt exists in the main directory (the one containining setup.py). You could use that to get some idea of what is causing the problem (and then tell me about it).

axcore commented 1 year ago

Closed for inactivity. If you see the same error on current versions of Tartube/Wayland, feel free to re-open.

AnOpenSauceDev commented 9 months ago

Currently having this exact problem on Gnome Wayland too, on the latest version of Pop!_OS and tartube itself. setting GDK_BACKEND=x11 also "fixes" it by forcing xwayland.

lfom commented 9 months ago

@AnOpenSauceDev Can you please provide the OS, libgtk-3-0 and tartube version? Are you running Wayland with NVidia by any chance?

This issue was opened a long time ago, and I do not use Pop anymore. I tried to do the test on a VM booting the ISO, but it uses XOrg.

Tests using running on Gnome 45 with Wayland:

  1. Arch (Chaotic-AUR - 2.4.370-2.3) - works fine
  2. Arch (Python virtualenv - 2.4.433) - works fine
  3. Ubuntu 23.10 (python3-tartube_2.4.429-STRICT) - works fine
  4. Ubuntu 23.10 (Python virtualenv - 2.4.433) - works fine
  5. Ubuntu 22.04 (Distrobox - python3-tartube_2.4.429-STRICT) - works fine
  6. Ubutnu 23.10 (Distrobox - python3-tartube_2.4.429-STRICT) - works fine

So I guess it is something specific to Pop...

@axcore I would recommend adding gir1.2-gtk-3.0 as dependency, otherwise the program will not run when installed on containers like Distrobox.

AnOpenSauceDev commented 9 months ago

I'm on 22.04, with gtk 3.24.33 and tartube v2.4.429 And yes, I am running Nvidia on Wayland, tried on both 535 and the new 545. On my other arch-based devices, everything also worked fine.

lfom commented 9 months ago

@AnOpenSauceDev Now I think that when I reported the issue a long time ago, I was not using NVidia, so maybe it is not related. Unfortunately I cannot help much further, since there is no way I can install Pop now. I can only recommend that you install using the source and create debug.txt file in the directory as mentioned earlier to try to get some logs...

axcore commented 9 months ago

@AnOpenSauceDev I have uploaded a new debian installer which includes GDK_BACKEND=x11. I can't reproduce your crashes, so perhaps you can test it for me: python3-tartube_2.4.429-WAYLAND.deb

@lfom Where do you recommend that gir1.2-gtk-3.0 is specified; in the stdeb.cfg file used by the debian installer? (I wouldn't want to add a new dependency that makes the installer useless for everyone but you! )

AnOpenSauceDev commented 9 months ago

When running this, I oddly get the exact same behaviour. It seems that GDK_BACKEND is not set to x11 (the old method works, however.). Also, forcing X11 is a bad idea, because that makes it run under Xwayland, which is pretty stuttery vs native.

lfom commented 9 months ago

@lfom Where do you recommend that gir1.2-gtk-3.0 is specified; in the stdeb.cfg file used by the debian installer? (I wouldn't want to add a new dependency that makes the installer useless for everyone but you! )

Hmm, I think you did not understand my suggestion: gir1.2-gtk-3.0 is requirement to run the application, regardless of where it was installed, it was not a personal requirement. gir1.2-gtk-3.0 is installed by default on most GTK based DEs, and probably this why the problem was not noticed in the past, but when trying to install on a container like distrobox, that does not have a DE, the app will not run because it was missing.

Anyway, good luck. Signing off.