strawberrymusicplayer / strawberry

:strawberry: Strawberry Music Player
https://www.strawberrymusicplayer.org/
GNU General Public License v3.0
2.74k stars 191 forks source link

Crash while downloading album data from Subsonic (actually airsonic and navidrome) #869

Closed andybalaam closed 2 years ago

andybalaam commented 2 years ago

Describe the bug Strawberry crashes when Refreshing Subsonic catalogue.

To Reproduce

GDB trace:

$ gdb strawberry
GNU gdb (Ubuntu 11.1-0ubuntu2) 11.1
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from strawberry...
(No debugging symbols found in strawberry)
(gdb) r
Starting program: /usr/bin/strawberry 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
14:33:09.624 INFO  main:171                         Strawberry 1.0
14:33:09.624 INFO  main:172                         "Ubuntu 21.10 21.10 - (linux 5.13.0-22-generic) [x86_64]"
[New Thread 0x7fffeb9ed640 (LWP 60123)]
14:33:09.695 DEBUG logging:86(GLib-GIO)             _g_io_module_get_default: Found default implementation dconf (DConfSettingsBackend) for ‘gsettings-backend’
[New Thread 0x7fffeaa62640 (LWP 60124)]
[New Thread 0x7fffea261640 (LWP 60125)]
[New Thread 0x7fffe9a60640 (LWP 60126)]
[New Thread 0x7fffe922e640 (LWP 60127)]
[New Thread 0x7fffe89f2640 (LWP 60128)]
[Thread 0x7fffe89f2640 (LWP 60128) exited]
[New Thread 0x7fffe89f2640 (LWP 60129)]
[New Thread 0x7fffd3fff640 (LWP 60130)]
[Thread 0x7fffe89f2640 (LWP 60129) exited]
[Thread 0x7fffd3fff640 (LWP 60130) exited]
[New Thread 0x7fffd3fff640 (LWP 60131)]
[New Thread 0x7fffe89f2640 (LWP 60132)]
[Thread 0x7fffd3fff640 (LWP 60131) exited]
[Thread 0x7fffe89f2640 (LWP 60132) exited]
[New Thread 0x7fffe89f2640 (LWP 60133)]
[New Thread 0x7fffd3fff640 (LWP 60134)]
[Thread 0x7fffe89f2640 (LWP 60133) exited]
[Thread 0x7fffd3fff640 (LWP 60134) exited]
14:33:09.748 DEBUG main:213                         Style: "gtk2"
14:33:09.753 DEBUG Application:259                  Database(0x55555645aed0) moved to thread QThread(0x555556460010)
[New Thread 0x7fffd3fff640 (LWP 60135)]
14:33:09.753 DEBUG SCollection:63                   CollectionBackend(0x555556445640) moved to thread QThread(0x555556460010)
[New Thread 0x7fffe89f2640 (LWP 60136)]
[New Thread 0x7fffd3711640 (LWP 60137)]
14:33:09.787 DEBUG Application:259                  AlbumCoverLoader(0x55555648b870) moved to thread QThread(0x5555564cad50)
[New Thread 0x7fffd2ecc640 (LWP 60138)]
[New Thread 0x7fffd26cb640 (LWP 60139)]
14:33:09.789 DEBUG SCollection:95                   CollectionWatcher(0x5555564e1a70) moved to thread Thread(0x555556254430)
14:33:09.789 DEBUG Application:259                  TagReaderClient(0x5555564b2ce0) moved to thread QThread(0x5555564b2c40)
[New Thread 0x7fffd1eca640 (LWP 60140)]
14:33:09.789 DEBUG NetworkProxyFactory:54           Detected system proxy URLs: ("", "", "", "")
14:33:09.789 DEBUG WorkerPool<HandlerType>:245      Using worker "strawberry-tagreader" from "/usr/bin"
14:33:09.789 DEBUG WorkerPool<HandlerType>:294      Starting worker 0x7fffd1ec8f90 "/usr/bin/strawberry-tagreader" "/tmp/strawberry_68910238"
[Detaching after fork from child process 60141]
14:33:09.791 DEBUG WorkerPool<HandlerType>:294      Starting worker 0x7fffd1ec8f90 "/usr/bin/strawberry-tagreader" "/tmp/strawberry_686012002"
[Detaching after fork from child process 60142]
14:33:09.793 DEBUG WorkerPool<HandlerType>:294      Starting worker 0x7fffd1ec8f90 "/usr/bin/strawberry-tagreader" "/tmp/strawberry_1409209812"
[Detaching after fork from child process 60143]
14:33:09.795 DEBUG WorkerPool<HandlerType>:294      Starting worker 0x7fffd1ec8f90 "/usr/bin/strawberry-tagreader" "/tmp/strawberry_831176602"
[Detaching after fork from child process 60144]
14:33:09.797 INFO  main:57                          TagReader worker connecting to "/tmp/strawberry_68910238"
14:33:09.797 DEBUG WorkerPool<HandlerType>:317      Worker 0x7fffac006e60 connected to "/tmp/strawberry_68910238"
14:33:09.797 INFO  main:57                          TagReader worker connecting to "/tmp/strawberry_686012002"
14:33:09.797 DEBUG WorkerPool<HandlerType>:317      Worker 0x7fffac008450 connected to "/tmp/strawberry_686012002"
14:33:09.799 INFO  main:57                          TagReader worker connecting to "/tmp/strawberry_1409209812"
14:33:09.800 DEBUG WorkerPool<HandlerType>:317      Worker 0x7fffac006c40 connected to "/tmp/strawberry_1409209812"
14:33:09.800 INFO  main:57                          TagReader worker connecting to "/tmp/strawberry_831176602"
14:33:09.801 DEBUG WorkerPool<HandlerType>:317      Worker 0x7fffac00b3d0 connected to "/tmp/strawberry_831176602"
[New Thread 0x7fffd1685640 (LWP 60145)]
[New Thread 0x7fffd0e84640 (LWP 60146)]
[New Thread 0x7fff9ffff640 (LWP 60147)]
[New Thread 0x7fff977fe640 (LWP 60148)]
[New Thread 0x7fff9f7fe640 (LWP 60149)]
[New Thread 0x7fff9effd640 (LWP 60150)]
14:33:09.804 WARN  OSDDBus:127                      Error connecting to notifications service.
14:33:09.850 DEBUG GlobalShortcutsBackendMate:62    Registering
[New Thread 0x7fff9e7fc640 (LWP 60157)]
[New Thread 0x7fff9dffb640 (LWP 60158)]
[New Thread 0x7fff9d7fa640 (LWP 60159)]
[New Thread 0x7fff9cff9640 (LWP 60160)]
[New Thread 0x7fff97fff640 (LWP 60161)]
[New Thread 0x7fff96ffd640 (LWP 60162)]
14:33:09.877 DEBUG logging:86(GLib-GIO)             _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ‘gio-vfs’
14:33:09.948 INFO  Player:900                       Registered URL handler for "subsonic"
14:33:09.950 DEBUG InternetServices:49              Added internet service "Subsonic"
14:33:09.950 INFO  Player:900                       Registered URL handler for "tidal"
14:33:09.955 DEBUG InternetServices:49              Added internet service "Tidal"
14:33:09.955 INFO  Player:900                       Registered URL handler for "qobuz"
14:33:09.961 DEBUG InternetServices:49              Added internet service "Qobuz"
14:33:10.146 DEBUG MainWindow:329                   Starting
14:33:10.183 DEBUG CoverProviders:109               Registered cover provider "Last.fm"
14:33:10.184 DEBUG CoverProviders:109               Registered cover provider "MusicBrainz"
14:33:10.184 DEBUG CoverProviders:109               Registered cover provider "Discogs"
14:33:10.184 DEBUG CoverProviders:109               Registered cover provider "Deezer"
14:33:10.184 DEBUG CoverProviders:109               Registered cover provider "Musixmatch"
14:33:10.184 DEBUG CoverProviders:109               Registered cover provider "Spotify"
14:33:10.184 DEBUG CoverProviders:109               Registered cover provider "Tidal"
14:33:10.184 DEBUG CoverProviders:109               Registered cover provider "Qobuz"
14:33:10.188 DEBUG LyricsProviders:108              Registered lyrics provider "AudD"
14:33:10.189 DEBUG LyricsProviders:108              Registered lyrics provider "Genius"
14:33:10.189 DEBUG LyricsProviders:108              Registered lyrics provider "Lyrics.ovh"
14:33:10.189 DEBUG LyricsProviders:108              Registered lyrics provider "LoloLyrics"
14:33:10.189 DEBUG LyricsProviders:108              Registered lyrics provider "Musixmatch"
14:33:10.189 DEBUG LyricsProviders:108              Registered lyrics provider "ChartLyrics"
14:33:10.203 DEBUG MainWindow:378                   Initializing player
14:33:10.217 DEBUG MainWindow:388                   Creating models
14:33:10.217 DEBUG MainWindow:395                   Creating models finished
[New Thread 0x7fff967fc640 (LWP 60164)]
[New Thread 0x7fff95ffb640 (LWP 60165)]
14:33:10.219 DEBUG DeviceLister:67                  CddaLister(0x5555570d1e60) moved to thread QThread(0x555556ded850)
[New Thread 0x7fff957fa640 (LWP 60166)]
14:33:10.219 DEBUG DeviceLister:67                  Udisks2Lister(0x5555570c9bb0) moved to thread QThread(0x5555570ce1a0)
[New Thread 0x7fff94ff9640 (LWP 60167)]
14:33:10.219 DEBUG DeviceLister:67                  GioLister(0x5555570ce150) moved to thread QThread(0x555556dde130)
14:33:10.219 DEBUG CddaLister:116                   No CD devices found
14:33:10.222 DEBUG Application:259                  PlaylistBackend(0x555557115330) moved to thread QThread(0x555556460010)
14:33:10.224 DEBUG Application:259                  RadioBackend(0x555557150230) moved to thread QThread(0x555556460010)
14:33:10.225 DEBUG RadioServices:67                 Adding radio service: "SomaFM"
14:33:10.225 DEBUG RadioServices:67                 Adding radio service: "Radio Paradise"
14:33:10.225 DEBUG MainWindow:415                   Creating UI
14:33:10.241 DEBUG ScrobblerServices:49             Registered scrobbler service "Last.fm"
14:33:10.241 DEBUG ScrobblerServices:49             Registered scrobbler service "Libre.fm"
14:33:10.241 DEBUG ScrobblerServices:49             Registered scrobbler service "ListenBrainz"
14:33:10.242 DEBUG ScrobblerServices:49             Registered scrobbler service "Subsonic"
14:33:10.287 DEBUG MainWindow:840                   Creating playing widget
14:33:10.314 DEBUG MainWindow:892                   Loading settings
[New Thread 0x7fff58d39640 (LWP 60169)]
14:33:10.609 DEBUG MainWindow:1027                  Started QThread(0x5555562195e0)
14:33:10.611 DEBUG GlobalShortcutsBackendMate:100   Registered.
14:33:10.718 DEBUG logging:86                       Name com.canonical.AppMenu.Registrar does not exist on the session bus

[New Thread 0x7fff53fff640 (LWP 60182)]
[New Thread 0x7fff537fe640 (LWP 60183)]
14:33:16.415 WARN  unknown                          stream 201 finished with error: "Server stopped accepting new streams before this stream was established" 
14:33:16.415 ERROR SubsonicRequest:892              Subsonic: "Server stopped accepting new streams before this stream was established (205)"
14:33:18.143 ERROR SubsonicRequest:892              Subsonic: "Invalid Json reply, song is missing one or more values."
14:33:18.143 DEBUG SubsonicRequest:895              QVariant(QJsonObject, QJsonObject({"album":"See you on the other side","albumId":"459","artist":"Korn","artistId":"127","contentType":"audio/flac","created":"2020-04-23T13:20:10.000Z","genre":"Rock","id":"6038","isDir":false,"isVideo":false,"parent":"6026","path":"Korn/See you on the other side/16-Untitled.flac","playCount":0,"size":425,"suffix":"flac","title":"Untitled","track":16,"transcodedContentType":"audio/mpeg","transcodedSuffix":"mp3","type":"music","year":2005}))
[Thread 0x7fffe922e640 (LWP 60127) exited]

Thread 37 "QNetworkAccessM" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff53fff640 (LWP 60182)]
0x00007ffff6ce0c08 in ?? () from /lib/x86_64-linux-gnu/libQt5Network.so.5
(gdb) where
#0  0x00007ffff6ce0c08 in  () at /lib/x86_64-linux-gnu/libQt5Network.so.5
#1  0x00007ffff6cdfccc in  () at /lib/x86_64-linux-gnu/libQt5Network.so.5
#2  0x00007ffff6ce00fa in  () at /lib/x86_64-linux-gnu/libQt5Network.so.5
#3  0x00007ffff6cf0c07 in  () at /lib/x86_64-linux-gnu/libQt5Network.so.5
#4  0x00007ffff656373e in QObject::event(QEvent*) ()
    at /lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff763b6b3 in QApplicationPrivate::notify_helper(QObject*, QEvent*)
    () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#6  0x00007ffff653616a in QCoreApplication::notifyInternal2(QObject*, QEvent*)
    () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007ffff6539257 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007ffff658fef7 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007ffff58c28bb in g_main_context_dispatch ()
    at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007ffff5915f08 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007ffff58c0003 in g_main_context_iteration ()
    at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007ffff658f548 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007ffff6534a9b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007ffff63488c2 in QThread::exec() ()
--Type <RET> for more, q to quit, c to continue without paging--
   .so.5
#15 0x00007ffff6349a71 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#16 0x00007ffff5361927 in start_thread (arg=<optimised out>) at pthread_create.c:435
#17 0x00007ffff53f19e4 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100

Expected behavior I expected it not to crash

System Information:

$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=21.10
DISTRIB_CODENAME=impish
DISTRIB_DESCRIPTION="Ubuntu 21.10"
$ uname -a
Linux andy-XPS-15-9500 5.13.0-22-generic #22-Ubuntu SMP Fri Nov 5 13:21:36 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ strawberry --version
Strawberry 1.0

Installed from the PPA at ppa:jonaski/strawberry

$ apt-cache policy strawberry
strawberry:
  Installed: 1.0-impish
  Candidate: 1.0-impish
  Version table:
 *** 1.0-impish 500
        500 http://ppa.launchpad.net/jonaski/strawberry/ubuntu impish/main amd64 Packages
        100 /var/lib/dpkg/status
jonaski commented 2 years ago

Looks like the crash is happening in the Qt Network module but you are missing debug symbols. Ubuntu Impish is using Qt 5.15.2 with a few patches, Qt 6 is not available on Ubuntu for some reason, no point in filing bug reports to Qt for 5.15.2. The Json output from the debug logging shows that one of the song is missing "duration" from the server so it's rejected, but I don't think that's related to the crash.

jonaski commented 2 years ago

Is the "use HTTP/2 when possible" in the Subsonic settings checked or unchecked? Can you try changing it and see if it makes any difference? Anyway, I think this needs to be reported to Ubuntu. Ubuntu is using the Qt 5.15 version which is no longer receiving patches from Qt for open source users, so it's a headache to deal with. they should be using Qt 5.12 LTS, Qt 6.2 LTS or the latest Qt 6 version which receives patches from Qt.

jonaski commented 2 years ago

I tested on Ubuntu 21.10 now and I can't reproduce any problems. What Subsonic settings do you use? Does it crash every time?

andybalaam commented 2 years ago

image

I just tried it on my other machine (also Ubuntu MATE) and it worked fine. Trying again on the machine where it crashed...

andybalaam commented 2 years ago

image

Still crashes on this machine. I've tried unchecking and checking the various options above, and it crashes every time.

$ uname -a
Linux andy-XPS-15-9500 5.13.0-27-generic #29-Ubuntu SMP Wed Jan 12 17:36:47 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
$ lscpu  | grep "Model name"
Model name:                      Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz

Let me know if I can provide more info. I will try to build and run with debug symbols.

andybalaam commented 2 years ago

In case it's useful to anyone else, here is the (probably overkill) list of packages I had to install on Ubuntu 20.10 to build Strawberry:

sudo apt install \
    libboost-dev \
    libprotobuf-dev \
    protobuf-compiler \
    libalsaplayer-dev \
    alsa-utils \
    alsa \
    libasound2-dev \
    libsqlite3-dev libvlc-dev libcdio-dev libxcb1-dev libgstreamer1.0-dev \
    libpulse-dev libchromaprint-dev libgpod-dev libmtp-dev libgdk-pixbuf2.0-dev \
    kde-dev \
    libkf5config-dev \
    librust-gstreamer-audio-sys-dev \
    libqt5x11extras5-dev \
    libtaglib-cil-dev libfftw3-dev libgtest-dev \
    taglib \
    libtaglib*
andybalaam commented 2 years ago

I built with:

git clone https://github.com/strawberrymusicplayer/strawberry
cd strawberry
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make -j$(nproc)

and ran with:

gdb ./strawberry
...
(gdb) r

Then clicked "Refresh catalogue"

andybalaam commented 2 years ago

I had to try twice, but the second time I clicked it, I got the crash:

[Thread 0x7fff977fe640 (LWP 39761) exited]
[Thread 0x7fff9e7fc640 (LWP 39758) exited]
[Thread 0x7fff9f7fe640 (LWP 39757) exited]
[Thread 0x7fff96ffd640 (LWP 39762) exited]
[Thread 0x7fff967fc640 (LWP 39763) exited]
[Thread 0x7fff97fff640 (LWP 39760) exited]
[Thread 0x7fffd0d19640 (LWP 39755) exited]
10:16:04.362 ERROR SubsonicRequest:892              Subsonic: "Operation canceled (5)"
10:16:04.363 ERROR SubsonicRequest:892              Subsonic: "Operation canceled (5)"
10:16:04.762 WARN  unknown                          stream 201 finished with error: "Server stopped accepting new streams before this stream was established" 
10:16:04.762 WARN  unknown                          stream 203 finished with error: "Server stopped accepting new streams before this stream was established" 
10:16:04.762 ERROR SubsonicRequest:892              Subsonic: "Server stopped accepting new streams before this stream was established (205)"
10:16:04.768 ERROR SubsonicRequest:892              Subsonic: "Server stopped accepting new streams before this stream was established (205)"

Thread 65 "QNetworkAccessM" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff53fff640 (LWP 39809)]
0x00007ffff6cdfc08 in ?? () from /lib/x86_64-linux-gnu/libQt5Network.so.5
(gdb) where
#0  0x00007ffff6cdfc08 in  () at /lib/x86_64-linux-gnu/libQt5Network.so.5
#1  0x00007ffff6cdeccc in  () at /lib/x86_64-linux-gnu/libQt5Network.so.5
#2  0x00007ffff6cdf0fa in  () at /lib/x86_64-linux-gnu/libQt5Network.so.5
#3  0x00007ffff6cefc07 in  () at /lib/x86_64-linux-gnu/libQt5Network.so.5
#4  0x00007ffff656273e in QObject::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff763a6b3 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#6  0x00007ffff653516a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007ffff6538257 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#8  0x00007ffff658eef7 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x00007ffff58988bb in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007ffff58ebf08 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007ffff5896003 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007ffff658e548 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007ffff6533a9b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007ffff63478c2 in QThread::exec() () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#15 0x00007ffff6348a71 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#16 0x00007ffff5337927 in start_thread (arg=<optimised out>) at pthread_create.c:435
#17 0x00007ffff53c79e4 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100
andybalaam commented 2 years ago

(I removed some of the logs from before the crash - let me know if you need them.)

jonaski commented 2 years ago

Still missing debug symbols for libQt5Network

jonaski commented 2 years ago

This looks like a Qt bug. I suggest to install the debug symbols for qt5network and report this to ubuntu