Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spotub doesn't exit properly, hangs in infinite loop #768

Closed
1 task done
hamkg opened this issue Oct 1, 2023 · 13 comments
Closed
1 task done

spotub doesn't exit properly, hangs in infinite loop #768

hamkg opened this issue Oct 1, 2023 · 13 comments
Labels
bug Something isn't working

Comments

@hamkg
Copy link

hamkg commented Oct 1, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When starting from terminal I get the message
flutter: media_kit: WARNING: package:media_kit_native_event_loop not found.
libmedia_kit_native_event_loop.so is part of the package and duly installed.

When trying to exit a loop goes on ad infinitum:

Attempt:11 waiting for isolate vm-isolate to check in
Attempt:11 waiting for isolate InitializerIsolate._mainloop to check in
Attempt:12 waiting for isolate vm-isolate to check in
Attempt:12 waiting for isolate InitializerIsolate._mainloop to check in

I have to end the program with killall (or via system monitor).

Expected Behavior

No warning at startup, normal shutdown when exiting

Steps to reproduce

As described above under "Current behaviour"

Operating System

Linux

Spotube version

3.1.2 rpm package

Installation source

Website (spotube.netlify.app) or (spotube.krtirtho.dev)

Additional information

No response

@hamkg hamkg added the bug Something isn't working label Oct 1, 2023
@dimitris-personal
Copy link

Same here with flatpak from flathub, Fedora 38/GNOME/Wayland.

@hamkg
Copy link
Author

hamkg commented Oct 2, 2023

OK, I've realised what lies behind this. ldd /usr/bin/spotube reveals the following:
libcatcher_plugin.so => not found libfile_selector_linux_plugin.so => not found libflutter_secure_storage_linux_plugin.so => not found liblocal_notifier_plugin.so => not found libmedia_kit_libs_linux_plugin.so => not found libscreen_retriever_plugin.so => not found libsystem_theme_plugin.so => not found libsystem_tray_plugin.so => not found liburl_launcher_linux_plugin.so => not found libwindow_manager_plugin.so => not found libwindow_size_plugin.so => not found libflutter_linux_gtk.so => not found
All these files are located in /usr/share/spotube/lib/ but system looks for them in /usr/lib64. After creating symlinks , everything works properly.

@hamkg
Copy link
Author

hamkg commented Oct 2, 2023

Didn't test long enough - turned out that the symlinks didn't help. There was a difference, though: the program seemed to shutdown (window closed), but the process was still running in the background. Back to square one :(

@dimitris-personal
Copy link

Hmm, in the flatpak the issue still reproduces reliably but the libraries seem to resolve fine.

From inside a flatpak enter shell in the running container:

sh-5.1$ ldd /app/spotube/spotube
	linux-vdso.so.1 (0x00007ffc139bb000)
	libcatcher_plugin.so => /app/spotube/lib/libcatcher_plugin.so (0x00007fac1d56b000)
	libfile_selector_linux_plugin.so => /app/spotube/lib/libfile_selector_linux_plugin.so (0x00007fac1d564000)
	libflutter_secure_storage_linux_plugin.so => /app/spotube/lib/libflutter_secure_storage_linux_plugin.so (0x00007fac1d546000)
	liblocal_notifier_plugin.so => /app/spotube/lib/liblocal_notifier_plugin.so (0x00007fac1d53e000)
	libmedia_kit_libs_linux_plugin.so => /app/spotube/lib/libmedia_kit_libs_linux_plugin.so (0x00007fac1d539000)
	libscreen_retriever_plugin.so => /app/spotube/lib/libscreen_retriever_plugin.so (0x00007fac1d531000)
	libsystem_theme_plugin.so => /app/spotube/lib/libsystem_theme_plugin.so (0x00007fac1d52b000)
	libsystem_tray_plugin.so => /app/spotube/lib/libsystem_tray_plugin.so (0x00007fac1d51e000)
	liburl_launcher_linux_plugin.so => /app/spotube/lib/liburl_launcher_linux_plugin.so (0x00007fac1d518000)
	libwindow_manager_plugin.so => /app/spotube/lib/libwindow_manager_plugin.so (0x00007fac1d50b000)
	libwindow_size_plugin.so => /app/spotube/lib/libwindow_size_plugin.so (0x00007fac1d504000)
	libflutter_linux_gtk.so => /app/spotube/lib/libflutter_linux_gtk.so (0x00007fac1c600000)
	libgtk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-3.so.0 (0x00007fac1be00000)
	libgdk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgdk-3.so.0 (0x00007fac1bcf1000)
	libpangocairo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007fac1d4e7000)
	libpango-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007fac1d47b000)
	libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007fac1bbe8000)
	libatk-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007fac1d44f000)
	libcairo-gobject.so.2 => /usr/lib/x86_64-linux-gnu/libcairo-gobject.so.2 (0x00007fac1d443000)
	libcairo.so.2 => /usr/lib/x86_64-linux-gnu/libcairo.so.2 (0x00007fac1bac2000)
	libgdk_pixbuf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007fac1d414000)
	libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007fac1b8d0000)
	libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007fac1b86d000)
	libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fac1b71f000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fac1b400000)
	libm.so.6 => /usr/lib/x86_64-linux-gnu/libm.so.6 (0x00007fac1b31d000)
	libgcc_s.so.1 => /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fac1b6fe000)
	libc.so.6 => /usr/lib/x86_64-linux-gnu/libc.so.6 (0x00007fac1b000000)
	libsecret-1.so.0 => /app/lib/libsecret-1.so.0 (0x00007fac1b69e000)
	libnotify.so.4 => /app/lib/libnotify.so.4 (0x00007fac1d406000)
	libappindicator3.so.1 => /app/lib/libappindicator3.so.1 (0x00007fac1d3f6000)
	libdbusmenu-glib.so.4 => /app/lib/libdbusmenu-glib.so.4 (0x00007fac1b67f000)
	libdl.so.2 => /usr/lib/x86_64-linux-gnu/libdl.so.2 (0x00007fac1c5fb000)
	libepoxy.so.0 => /usr/lib/x86_64-linux-gnu/libepoxy.so.0 (0x00007fac1aed8000)
	libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007fac1b2cf000)
	libpthread.so.0 => /usr/lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fac1c5f6000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fac1d579000)
	libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007fac1c5ef000)
	libpangoft2-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007fac1b663000)
	libfribidi.so.0 => /app/lib/libfribidi.so.0 (0x00007fac1b643000)
	libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007fac1b2bb000)
	libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007fac1ad90000)
	libatk-bridge-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0 (0x00007fac1b27d000)
	libtracker-sparql-3.0.so.0 => /usr/lib/x86_64-linux-gnu/libtracker-sparql-3.0.so.0 (0x00007fac1acbb000)
	libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007fac1b275000)
	libxkbcommon.so.0 => /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007fac1b22d000)
	libwayland-client.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-client.so.0 (0x00007fac1b219000)
	libwayland-cursor.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-cursor.so.0 (0x00007fac1b20e000)
	libwayland-egl.so.1 => /usr/lib/x86_64-linux-gnu/libwayland-egl.so.1 (0x00007fac1acb6000)
	libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007fac1aca2000)
	libXcursor.so.1 => /usr/lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007fac1ac93000)
	libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007fac1ac8e000)
	libXcomposite.so.1 => /usr/lib/x86_64-linux-gnu/libXcomposite.so.1 (0x00007fac1ac89000)
	libXrandr.so.2 => /usr/lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007fac1ac7c000)
	libXinerama.so.1 => /usr/lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007fac1ac77000)
	libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007fac1abb4000)
	libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007fac1ab90000)
	libpixman-1.so.0 => /usr/lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007fac1aae4000)
	libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007fac1aaaa000)
	libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007fac1aaa5000)
	libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fac1aa79000)
	libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007fac1aa67000)
	libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007fac1aa5a000)
	libz.so.1 => /usr/lib/x86_64-linux-gnu/libz.so.1 (0x00007fac1aa3f000)
	libjpeg.so.62 => /usr/lib/x86_64-linux-gnu/libjpeg.so.62 (0x00007fac1a997000)
	libmount.so.1 => /usr/lib/x86_64-linux-gnu/libmount.so.1 (0x00007fac1a932000)
	libffi.so.8 => /usr/lib/x86_64-linux-gnu/libffi.so.8 (0x00007fac1a920000)
	libpcre2-8.so.0 => /usr/lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x00007fac1a885000)
	libgcrypt.so.20 => /usr/lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007fac1a73c000)
	libindicator3.so.7 => /app/lib/libindicator3.so.7 (0x00007fac1a72b000)
	libdbusmenu-gtk3.so.4 => /app/lib/libdbusmenu-gtk3.so.4 (0x00007fac1a714000)
	libexpat.so.1 => /usr/lib/x86_64-linux-gnu/libexpat.so.1 (0x00007fac1a6e5000)
	libatspi.so.0 => /usr/lib/x86_64-linux-gnu/libatspi.so.0 (0x00007fac1a6a8000)
	libdbus-1.so.3 => /usr/lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007fac1a64f000)
	libjson-glib-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libjson-glib-1.0.so.0 (0x00007fac1a622000)
	libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007fac1a4b6000)
	libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007fac1a370000)
	libbz2.so.1 => /usr/lib/x86_64-linux-gnu/libbz2.so.1 (0x00007fac1a35c000)
	libbrotlidec.so.1 => /usr/lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007fac1a34f000)
	libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007fac1a349000)
	libblkid.so.1 => /usr/lib/x86_64-linux-gnu/libblkid.so.1 (0x00007fac1a2ef000)
	libgpg-error.so.0 => /usr/lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007fac1a2c4000)
	libsystemd.so.0 => /usr/lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007fac1a1e3000)
	liblzma.so.5 => /usr/lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fac1a1b9000)
	libicui18n.so.71 => /usr/lib/x86_64-linux-gnu/libicui18n.so.71 (0x00007fac19e00000)
	libicuuc.so.71 => /usr/lib/x86_64-linux-gnu/libicuuc.so.71 (0x00007fac19a00000)
	libicudata.so.71 => /usr/lib/x86_64-linux-gnu/libicudata.so.71 (0x00007fac17c00000)
	libbrotlicommon.so.1 => /usr/lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007fac1a194000)
	libcap.so.2 => /usr/lib/x86_64-linux-gnu/libcap.so.2 (0x00007fac1a187000)
	libzstd.so.1 => /usr/lib/x86_64-linux-gnu/libzstd.so.1 (0x00007fac19d3d000)
	liblz4.so.1 => /usr/lib/x86_64-linux-gnu/liblz4.so.1 (0x00007fac1a161000)

@hamkg
Copy link
Author

hamkg commented Oct 3, 2023

As mentioned above, ldd /usr/bin/spotube reveales 12 missing .so libraries. However, 3 of the libraries in /usr/share/spotube/lib/ are not reported missing:
libapp.so
libmedia_kit_native_event_loop.so
libmetadata.god.so

I have no knowledge of flutter/dart but googling suggests that the libmedia_kit_native_event_loop.so might be related to this issue - plus that I get a warning that it can't be found. A symlink from /usr/share/spotube/lib/ to /usr/lib64 does not help. To me it seems as if spotube's call to this library goes wrong somehow.

A comment from the devs would be most appreciated.

@KRTirtho
Copy link
Owner

KRTirtho commented Oct 3, 2023

No libmedia_kit_native_event_loop isn't really related to this.

OK, I've realised what lies behind this. ldd /usr/bin/spotube reveals the following: libcatcher_plugin.so => not found libfile_selector_linux_plugin.so => not found libflutter_secure_storage_linux_plugin.so => not found liblocal_notifier_plugin.so => not found libmedia_kit_libs_linux_plugin.so => not found libscreen_retriever_plugin.so => not found libsystem_theme_plugin.so => not found libsystem_tray_plugin.so => not found liburl_launcher_linux_plugin.so => not found libwindow_manager_plugin.so => not found libwindow_size_plugin.so => not found libflutter_linux_gtk.so => not found All these files are located in /usr/share/spotube/lib/ but system looks for them in /usr/lib64. After creating symlinks , everything works properly.

This is also not a reason ig because flutter executable (./spotube) dynamically loads those libs as far as I know

It's probably related to window_manager. The window close button calls the windowManager.close() method which closes the window

@KRTirtho KRTirtho moved this to Discussion in Spotube Board Oct 3, 2023
@hamkg
Copy link
Author

hamkg commented Oct 3, 2023

Thanks for the reply, KRTirtho!
You write:
It's probably related to window_manager. The window close button calls the windowManager.close() method which closes the window

OK, so is there a way to solve this and to get a proper exit behaviour?

I've tried both the MATE desktop (Marco WM) and XFCE (Xfwm), no difference.

@KRTirtho KRTirtho mentioned this issue Oct 26, 2023
1 task
@KRTirtho KRTirtho moved this from Discussion to Done in Spotube Board Oct 29, 2023
@aleister888
Copy link

aleister888 commented Nov 22, 2023

Well a temporary fix is to run Spotube from a script that logs the app output and closes it when this happens:

#!/bin/sh

LOG_FILE=/tmp/spotube.log

echo "" > $LOG_FILE

while true; do
	grep "Attempt" $LOG_FILE && killall spotube
	sleep 0.25;
done &

(
/usr/bin/spotube
) 2>&1 | tee -a /tmp/spotube.log

@hamkg
Copy link
Author

hamkg commented Nov 23, 2023

Good idea, but no difference on my system. I still get the "Spotube is not responding" message, allowing me to "Force quit".
I can live with that, though.

@KRTirtho
Copy link
Owner

Use the nightly version. It's been fixed there.

@hamkg
Copy link
Author

hamkg commented Nov 23, 2023

Thanks, KRTirtho! Upgraded to the nightly rpm version and yes, spotube now shuts down properly when I right-click the systray button and choose "Quit".

However, if I activate the system title bar, click the spotube icon in top left corner, and choose "Quit", it hangs just like before, taking me to the "Spotube is not responding" message and allowing me to "Force quit".

@KRTirtho
Copy link
Owner

Yeah that was expected as I can't override the callback for the native titlebars

@KRTirtho
Copy link
Owner

KRTirtho commented Dec 2, 2023

@hamkg this is similar to #866 which has been fixed

@KRTirtho KRTirtho closed this as completed Dec 2, 2023
@KRTirtho KRTirtho moved this from Done to Deployed in Spotube Board Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Deployed
Development

No branches or pull requests

4 participants