lite-xl / lite-xl

A lightweight text editor written in Lua
https://lite-xl.com
MIT License
4.75k stars 225 forks source link

Hangs on system reboot #1390

Open inthreedee opened 1 year ago

inthreedee commented 1 year ago

lite-xl causes my system reboot to hang, eventually resulting in the following timeout in journalctl:

systemd[1245]: app-gnome-org.lite_xl.lite_xl-3423.scope: Stopping timed out. Killing.
systemd[1245]: app-gnome-org.lite_xl.lite_xl-3423.scope: Killing process 3423 (lite-xl) with signal SIGKILL.
systemd[1245]: app-gnome-org.lite_xl.lite_xl-3423.scope: Failed with result 'timeout'.

This happens on every reboot. Closing lite-xl prior to shutdown alleviates the problem. I have tried removing all plugins from ~/.config/lite-xl/plugins and /usr/share/lite-xl/plugins and closing all files in lite-xl before shutdown; no effect.

One very strange thing though: This is only a problem since I switched my system from using pulseaudio to pipewire. When I switch back to pulseaudio, the problem goes away. Switch again to pipewire, and lite-xl hangs on every reboot. I've done this five or six times now. It's consistent. I know, weird, right?

What information can I provide to help figure out what's actually happening?

System: Arch Linux lite-xl version: 2.1.1 from AUR https://aur.archlinux.org/packages/lite-xl

Guldoman commented 1 year ago

Does it happen if you use our official releases?

inthreedee commented 1 year ago

I installed the bin package from the AUR and, yes, it still happens with the added bonus of psychedelic graphical corruption when lite-xl starts up. Clicking in the window sometimes makes it go away. I am not forcing SDL_VIDEODRIVER=wayland, so I don't think it's running in wayland mode.

inthreedee commented 1 year ago

Clarification (sorry, it's late here): by "makes it go away" I meant clears the psychedelics. But that's another issue entirely that I don't have with the normal package, so let's not dive into that here.

Guldoman commented 1 year ago

I installed the bin package from the AUR and, yes, it still happens

Did you check if there were AUR-installed instances still open?

We don't use the audio subsystem of SDL, so it's a bit weird that's causing problems, but we don't completely disable it from our builds, so that might be it. There is also the issue that SDL might be picking up the more up-to-date version installed on the system, so that might falsify the results.

with the added bonus of psychedelic graphical corruption when lite-xl starts up. Clicking in the window sometimes makes it go away. I am not forcing SDL_VIDEODRIVER=wayland, so I don't think it's running in wayland mode.

What DE are you using? In X11 mode there really shouldn't be glitches. You could also try to force SDL_VIDEODRIVER=x11 to be sure.

inthreedee commented 1 year ago

Did you check if there were AUR-installed instances still open?

I did, no rogue lite-xl processes.

Is there a debug mode or logs I can look at to help get some info on why it's hanging?

Guldoman commented 1 year ago

Is there a debug mode or logs I can look at to help get some info on why it's hanging?

For this kind of issue, not really. Some SDL message could pop out in the terminal you open Lite XL in, but I doubt that.

Could you try downgrading your system SDL version?

inthreedee commented 1 year ago

I downgraded to v2.26.1, the oldest cached version available on my system. Still hangs at reboot. And you're right, no SDL messages (or messages of any kind) when launching from the terminal.

Guldoman commented 1 year ago

Could you try with SDL_AUDIODRIVER=dummy?

inthreedee commented 1 year ago

Could you try with SDL_AUDIODRIVER=dummy?

No change

inthreedee commented 1 year ago

Found some additional behavior that might help narrow this down:

So it appears to only happen under Wayland with lite-xl running under xwayland.

Guldoman commented 1 year ago

Could this be related to libsdl-org/SDL#8392?

inthreedee commented 1 year ago

Sounds like it could be. I've been using Xorg for a while due to this and other Wayland bugs. Switching back now, I'm no longer seeing hangs on reboots and, instead, I'm sometimes seeing this in my logs:

org.lite_xl.lite_xl.desktop[250242]: X connection to :0 broken (explicit kill or server shutdown).
inthreedee commented 10 months ago

Switching back now, I'm no longer seeing hangs on reboots and, instead, I'm sometimes seeing this in my logs:

Just a quick update that I've since started seeing this hang again, though it's not nearly as consistent as it used to be.