Bug 353838 - amarok crashes on startup [@ Dynamic::AlbumPlayBias::matchingTracks]
Summary: amarok crashes on startup [@ Dynamic::AlbumPlayBias::matchingTracks]
Status: RESOLVED WORKSFORME
Alias: None
Product: amarok
Classification: Applications
Component: Playlists/Dynamic Playlists (other bugs)
Version First Reported In: 2.8.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: 2.9
Assignee: Amarok Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-12 21:26 UTC by bjoernv
Modified: 2016-06-12 21:00 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Amarok crash (14.20 KB, text/plain)
2015-10-12 21:30 UTC, bjoernv
Details
Failed build for Amarok 2.8.90 (122.08 KB, text/plain)
2016-02-22 22:48 UTC, bjoernv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bjoernv 2015-10-12 21:26:57 UTC
Amarok 2.8.0 can crash on startup if dynamic playlists are used.

Reproducible: Always

Steps to Reproduce:
1. Use dynamic playlists
2. Restart Amarok

Actual Results:  
Crash
Comment 1 bjoernv 2015-10-12 21:30:32 UTC
Created attachment 94974 [details]
Amarok crash

GDB shows, that the crash occurs in Dynamic::AlbumPlayBias::matchingTracks(QList<KSharedPtr<Meta::Track> > const&, int, int, QExplicitlySharedDataPointer<Dynamic::TrackCollection>) in AlbumPlayBias.cpp:149: 

    if( playlist.isEmpty() )
        return Dynamic::TrackSet( universe, false );
Comment 2 bjoernv 2015-10-12 21:40:08 UTC
Because of the crash it's impossible to switch off dynamic playlist mode in Amarok itself.

The dynamic playlist mode can be disabled in amarakrc:

edit $(kde4-config --localprefix)/share/config/amarokrc

[General Options]
Dynamic Mode=false
Comment 3 Myriam Schweingruber 2015-10-12 22:32:22 UTC
Please always paste the backtrace in the comment, else it is not searchable:

Application: Amarok (amarok), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f903df29800 (LWP 5178))]

...
Thread 7 (Thread 0x7f8fef7fe700 (LWP 5196)):
[KCrash Handler]
#5  0x00007f903cf30a17 in Dynamic::AlbumPlayBias::matchingTracks(QList<KSharedPtr<Meta::Track> > const&, int, int, QExplicitlySharedDataPointer<Dynamic::TrackCollection>) const (o=..., this=0x7f8fef7fda50) at /usr/include/KDE/../ksharedptr.h:84
#6  0x00007f903cf30a17 in Dynamic::AlbumPlayBias::matchingTracks(QList<KSharedPtr<Meta::Track> > const&, int, int, QExplicitlySharedDataPointer<Dynamic::TrackCollection>) const (this=0x2d43920, playlist=..., contextCount=<optimized out>, finalCount=<optimized out>, universe=...) at /home/bv/rpmbuild/BUILD/amarok-2.8.0/src/dynamic/biases/AlbumPlayBias.cpp:161
#7  0x00007f903cf373d6 in Dynamic::IfElseBias::matchingTracks(QList<KSharedPtr<Meta::Track> > const&, int, int, QExplicitlySharedDataPointer<Dynamic::TrackCollection>) const (this=0x2d38780, playlist=..., contextCount=6, finalCount=17, universe=...) at /home/bv/rpmbuild/BUILD/amarok-2.8.0/src/dynamic/biases/IfElseBias.cpp:101
#8  0x00007f903cf22a76 in Dynamic::BiasSolver::matchingTracks(QList<KSharedPtr<Meta::Track> > const&) const (this=this@entry=0x37adf70, playlist=...) at /home/bv/rpmbuild/BUILD/amarok-2.8.0/src/dynamic/BiasSolver.cpp:257
#9  0x00007f903cf23dcd in Dynamic::BiasSolver::addTracks(Dynamic::SolverList*) (this=this@entry=0x37adf70, list=list@entry=0x7f8fef7fdc90) at /home/bv/rpmbuild/BUILD/amarok-2.8.0/src/dynamic/BiasSolver.cpp:177
#10 0x00007f903cf245e0 in Dynamic::BiasSolver::run() (this=0x37adf70) at /home/bv/rpmbuild/BUILD/amarok-2.8.0/src/dynamic/BiasSolver.cpp:157
#11 0x00007f9037ef8542 in  () at /usr/lib64/libthreadweaver.so.4
#12 0x00007f9037ef86fe in ThreadWeaver::Job::execute(ThreadWeaver::Thread*) () at /usr/lib64/libthreadweaver.so.4
#13 0x00007f9037ef7f4b in ThreadWeaver::Thread::run() () at /usr/lib64/libthreadweaver.so.4
#14 0x00007f903b30479f in  () at /usr/lib64/libQtCore.so.4
#15 0x00007f9038df80a4 in start_thread () at /lib64/libpthread.so.0
#16 0x00007f903acb908d in clone () at /lib64/libc.so.6

...
Comment 4 Myriam Schweingruber 2015-10-12 22:34:07 UTC
Do you have the possibility to test with current Amarok 2.9 beta? It is highly likely this is already fixed, as Amarok 2.8 is rather old now.

Also the debug output lines shortly before the crash happens would be nice to have, for that, please start Amarok on the command line with

amarok -d --nofork
Comment 5 Myriam Schweingruber 2016-02-10 18:59:33 UTC
Still waiting for feedback...
Comment 6 bjoernv 2016-02-22 22:41:19 UTC
Which version or GIT branch is best for testing? Latest Git-tagged version I found is 2.8.90.

I have some compilation problems with Amarok 2.8.90 (see attachment).
Comment 7 bjoernv 2016-02-22 22:48:35 UTC
Created attachment 97367 [details]
Failed build for Amarok 2.8.90

I tried to build Amarok 2.8.90 on a up-to-date openSUSE Tumbleweet system. Build fails in Amazon services directory.
Comment 8 Myriam Schweingruber 2016-02-23 10:08:30 UTC
(In reply to bjoernv from comment #7)
> Created attachment 97367 [details]
> Failed build for Amarok 2.8.90
> 
> I tried to build Amarok 2.8.90 on a up-to-date openSUSE Tumbleweet system.
> Build fails in Amazon services directory.

Please do not use a bug tracker for support requests there is a mailinglist, a forum and an IRC channel for that, let's keep the bug tracker for the subject bug exclusively.
FWIW: the Amazon service stuff is not in Amarok 2.8.90 anymore, so this is certainly not where the build hangs.
FWIW2: if you want to build amarok 2.8.90, please use the official tarball available here: http://download.kde.org/stable/amarok/2.8.90/src/amarok-2.8.90.tar.xz.mirrorlist
Comment 9 bjoernv 2016-02-23 14:29:48 UTC
Myriam Schweingruber wrote:
> FWIW: the Amazon service stuff is not in Amarok 2.8.90 anymore, so this is certainly not where 
> the build hangs.
> FWIW2: if you want to build amarok 2.8.90, please use the official tarball 
> available here: http://download.kde.org/stable/amarok/2.8.90/src/amarok-2.8.90.tar.xz.mirrorlist

Amazon service is still part of the 2.8.90 official tarball:

# wget -q http://download.kde.org/stable/amarok/2.8.90/src/amarok-2.8.90.tar.xz
# sha256sum amarok-2.8.90.tar.xz
b057369ab70d192b669ee6c2c11e9e7d4140663f6a60d6175ef0bb56b4bef9a7  amarok-2.8.90.tar.xz
# tar tJf amarok-2.8.90.tar.xz amarok-2.8.90/src/services/amazon      
amarok-2.8.90/src/services/amazon/
amarok-2.8.90/src/services/amazon/AmazonShoppingCart.h
amarok-2.8.90/src/services/amazon/AmazonInfoParser.cpp
amarok-2.8.90/src/services/amazon/AmazonShoppingCartModel.cpp
[...]
amarok-2.8.90/src/services/amazon/AmazonWantCountryWidget.cpp
amarok-2.8.90/src/services/amazon/AmazonConfigWidget.ui
Comment 10 Myriam Schweingruber 2016-02-23 19:49:07 UTC
Hm, my bad, I expected it to be removed already. 
Anyway, your build doesn't hang in Amazon service AFAICT from the output, but rather with the gmoc tests. Did you try to build it with tests disabled?

That is the location of the build failure: /usr/include/gmock/gmock-spec-builders.h:1173: undefined reference to `testing::internal::Log(testing::internal::LogSeverity, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
/usr/lib64/gcc/x86_64-suse-linux/5/../../../../lib64/libgmock.so: undefined reference to `testing::internal::FormatFileLocation(char const*, int)'
/usr/lib64/gcc/x86_64-suse-linux/5/../../../../lib64/libgmock.so: undefined reference to `testing::internal::GetCurrentOsStackTraceExceptTop(testing::UnitTest*, int)'
/usr/lib64/gcc/x86_64-suse-linux/5/../../../../lib64/libgmock.so: undefined reference to `testing::Message::GetString() const'
/usr/lib64/gcc/x86_64-suse-linux/5/../../../../lib64/libgmock.so: undefined reference to `testing::internal::PrintStringTo(std::string const&, std::ostream*)'
collect2: error: ld returned 1 exit status
tests/core-impl/logger/CMakeFiles/testproxylogger.dir/build.make:181: recipe for target 'tests/testproxylogger' failed
make[2]: *** [tests/testproxylogger] Error 1

You can find the explanation for the problem in the Amarok developer ML: since about 2 years now gmoc has to be built specifically for the project you want to build tests for.
Comment 11 bjoernv 2016-02-25 23:15:38 UTC
I finally managed to build Amarok 2.8.90:

# amarok --version
Qt: 4.8.7
KDE: 4.14.17
Amarok: 2.8.90

In my first tests, Amarok did not crash after enabling dynamic mode and restarting. I will test Amarok for some days and report the results.
Comment 12 Myriam Schweingruber 2016-06-12 12:51:15 UTC
(In reply to bjoernv from comment #11)
> I finally managed to build Amarok 2.8.90:
> 
> # amarok --version
> Qt: 4.8.7
> KDE: 4.14.17
> Amarok: 2.8.90
> 
> In my first tests, Amarok did not crash after enabling dynamic mode and
> restarting. I will test Amarok for some days and report the results.

I presume the problem is solved, closing
Comment 13 bjoernv 2016-06-12 21:00:39 UTC
(In reply to Myriam Schweingruber from comment #12)
> I presume the problem is solved, closing

Yes. Unfortunately it's still unclear, which change in the post 2.8 development of Amarok fixed the problem.

I see two possible strategies to come to a stable version:
1) Do a "git bisect" between Amarok 2.8 and 2.8.90 and find a patch, which fixes the problem
2) Wait for a release