Bug 340836 - Crash when attempting to repopulate the playlist with an empty local collection
Summary: Crash when attempting to repopulate the playlist with an empty local collection
Status: RESOLVED NOT A BUG
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Local (show other bugs)
Version: 2.8.0
Platform: Ubuntu Linux
: NOR crash
Target Milestone: 2.9
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-10 23:52 UTC by Dima Ryazanov
Modified: 2015-10-01 11:45 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
New crash information added by DrKonqi (36.21 KB, text/plain)
2015-10-01 02:02 UTC, xeaprog
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dima Ryazanov 2014-11-10 23:52:38 UTC
Amarok crashes if I remove all folders from the local collection, then try to repopulate a dynamic playlist:

Here's the debug output:

amarok: BEGIN: void Playlist::Actions::repopulateDynamicPlaylist() 
amarok:   BEGIN: void Playlist::Controller::removeRows(int, int) 
amarok:     BEGIN: void Playlist::Controller::removeRows(QList<int>&) 
amarok:       BEGIN: virtual void Playlist::RemoveTracksCmd::redo() 
amarok:         BEGIN: void Playlist::Model::removeTracksCommand(const RemoveCmdList&) 
amarok:           MPRIS2: Queueing up a PropertiesChanged signal 
amarok:         END__: void Playlist::Model::removeTracksCommand(const RemoveCmdList&) [Took: 0.009s] 
amarok:       END__: virtual void Playlist::RemoveTracksCmd::redo() [Took: 0.009s] 
amarok:     END__: void Playlist::Controller::removeRows(QList<int>&) [Took: 0.011s] 
amarok:   END__: void Playlist::Controller::removeRows(int, int) [Took: 0.012s] 
amarok:   BEGIN: void Dynamic::BiasedPlaylist::startSolver(int) 
amarok:     [BiasedPlaylist] BiasedPlaylist in: 140737353701568 
amarok:     [BiasedPlaylist] assigning new m_solver 
amarok:     [BiasSolver] CREATING BiasSolver in thread: 140737353701568 to get 11 tracks with 6 context 
amarok:     BEGIN: virtual void Dynamic::BiasSolver::run() 
amarok:       [BiasSolver] BiasSolver::run in thread: 140736357693184 
amarok:       [BiasSolver] waiting for collection results 
amarok:       [BiasedPlaylist] called prepareToRun 
amarok:     END__: void Dynamic::BiasedPlaylist::startSolver(int) [Took: 0.007s] 
amarok:   END__: void Playlist::Actions::repopulateDynamicPlaylist() [Took: 0.023s] 
amarok:   BEGIN: void Dynamic::BiasedPlaylist::startSolver(int) 
amarok:     [BiasedPlaylist] BiasedPlaylist in: 140737353701568 
amarok:     [BiasedPlaylist] solver already running! 
amarok:   END__: void Dynamic::BiasedPlaylist::startSolver(int) [Took: 0s] 
amarok:   [BiasSolver] collection has 0 uids 
amarok:   [BiasSolver] generating playlist 
amarok:   QModelIndex(-1,-1,0x0,QObject(0x0) ) 

And a stack trace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffbc9b7700 (LWP 22332)]
QString (other=..., this=0x7fffbc9b6990) at ../../include/QtCore/../../src/corelib/tools/qstring.h:726
726     ../../include/QtCore/../../src/corelib/tools/qstring.h: No such file or directory.
(gdb) bt
#0  QString (other=..., this=0x7fffbc9b6990) at ../../include/QtCore/../../src/corelib/tools/qstring.h:726
#1  putString (number=false, s=..., this=0x7fffa0012080) at io/qtextstream.cpp:968
#2  QTextStream::operator<< (this=0x7fffa0004610, string=...) at io/qtextstream.cpp:2533
#3  0x00007ffff6efa6b5 in operator<< (t=..., this=<optimized out>) at /usr/include/qt4/QtCore/qdebug.h:112
#4  Dynamic::TrackSet::subtract (this=0x7fffa0004610, this@entry=0x7fffbc9b6b10, B=...) at ../../src/dynamic/TrackSet.cpp:220
#5  0x00007ffff6efe35d in Dynamic::BiasSolver::withoutDuplicate (position=6, playlist=..., oldSet=...) at ../../src/dynamic/BiasSolver.cpp:275
#6  0x00007ffff6effa91 in Dynamic::BiasSolver::addTracks (this=this@entry=0x2278570, list=list@entry=0x7fffbc9b6bb0) at ../../src/dynamic/BiasSolver.cpp:179
#7  0x00007ffff6f00083 in Dynamic::BiasSolver::run (this=0x2278570) at ../../src/dynamic/BiasSolver.cpp:157
#8  0x00007ffff24e1f42 in ThreadWeaver::JobRunHelper::runTheJob (this=this@entry=0x7fffbc9b6cd0, th=th@entry=0x7fffa401f150, job=job@entry=0x2278570)
    at ../../../threadweaver/Weaver/Job.cpp:106
#9  0x00007ffff24e2158 in ThreadWeaver::Job::execute (this=0x2278570, th=0x7fffa401f150) at ../../../threadweaver/Weaver/Job.cpp:135
#10 0x00007ffff24e18fb in ThreadWeaver::Thread::run (this=0x7fffa401f150) at ../../../threadweaver/Weaver/Thread.cpp:108
#11 0x00007ffff52e939f in QThreadPrivate::start (arg=0x7fffa401f150) at thread/qthread_unix.cpp:349
#12 0x00007ffff0f180a5 in start_thread (arg=0x7fffbc9b7700) at pthread_create.c:309
#13 0x00007ffff4c9484d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111


Reproducible: Always

Steps to Reproduce:
1. Create a dynamic playlist
2. Uncheck all folders in the collection config
3. Try to repopulate the playlist

Actual Results:  
Crash

Expected Results:  
Nothing should happen. Maybe "Repopulate" shouldn't even be an option.
Comment 1 Myriam Schweingruber 2014-11-11 07:06:00 UTC
(In reply to Dima Ryazanov from comment #0)
...
> Reproducible: Always
> 
> Steps to Reproduce:
> 1. Create a dynamic playlist
> 2. Uncheck all folders in the collection config
> 3. Try to repopulate the playlist
> 
Could you please specify why you would disable the collection and then try to run a dynamic playlist on a non-existing collection in the first place? Sounds like a far stretched corner case...
Comment 2 Dima Ryazanov 2014-11-11 22:44:20 UTC
Why is it "far stretched" if there's a UI for that?

In any case, here's the reason:

My collection had a single folder selected, "/home/dima/Music". (It was actually a symlink to another folder.) I moved some folders around, and Amarok froze for a few hours while using up 100% of CPU. Turns out, it scanned my whole home directory, /home/dima/, and added everything to the collection. My playlist now contained files like /home/dima/src/chromium/src/third_party/WebKit/LayoutTests/http/tests/resources/test.mp4, that were clearly outside of the "Music" directory. (Just to be clear: I never had any symlinks inside of "Music", so there's no excuse for that.)

I decided to debug this a bit and unselected "Music" in the collection config. The collection became empty, but the playlist still contained the same files. I wanted to see if Amarok was picking up files that weren't actually in the collection, so I clicked "repopulate".

(So there are two bugs here. I figured I'd file the crash first because it was easy to repro.)
Comment 3 Myriam Schweingruber 2015-01-23 13:54:22 UTC
There have been quite some changes in the behavior of the database in current git, could you maybe test this again?
Comment 4 Myriam Schweingruber 2015-04-18 12:27:50 UTC
Closing for lack of feedback. Please feel free to reopen if you can reproduce tis with a current git master build.
Comment 5 xeaprog 2015-10-01 02:02:13 UTC
Created attachment 94787 [details]
New crash information added by DrKonqi

amarok (2.8.0) on KDE Platform 4.14.6 using Qt 4.8.6

- What I was doing when the application crashed:

I click on a music inside a playlist inside my amarok database while the dynamic mode is enable

note: I don't know if it's useful for the backtrace but the music name is "02 - mp3" and my playlist name is "music", I also use the gstream phonon backend

-- Backtrace (Reduced):
#7  QString (other=..., this=0x7f4180823a50) at ../../include/QtCore/../../src/corelib/tools/qstring.h:726
#8  putString (number=false, s=..., this=0x7f41782e1960) at io/qtextstream.cpp:968
#9  QTextStream::operator<< (this=0x7f41782ab6f0, string=...) at io/qtextstream.cpp:2533
#10 0x00007f41ca7906b5 in operator<< (t=..., this=<optimized out>) at /usr/include/qt4/QtCore/qdebug.h:112
#11 Dynamic::TrackSet::subtract (this=0x7f41782ab6f0, this@entry=0x7f4180823bd0, B=...) at ../../src/dynamic/TrackSet.cpp:220
Comment 6 Myriam Schweingruber 2015-10-01 11:45:48 UTC
(In reply to xeaprog from comment #5)
> Created attachment 94787 [details]
> New crash information added by DrKonqi
> 
> amarok (2.8.0) on KDE Platform 4.14.6 using Qt 4.8.6
> 
> - What I was doing when the application crashed:
> 
> I click on a music inside a playlist inside my amarok database while the
> dynamic mode is enable
> 
> note: I don't know if it's useful for the backtrace but the music name is
> "02 - mp3" and my playlist name is "music", I also use the gstream phonon
> backend
> 
> -- Backtrace (Reduced):
> #7  QString (other=..., this=0x7f4180823a50) at
> ../../include/QtCore/../../src/corelib/tools/qstring.h:726
> #8  putString (number=false, s=..., this=0x7f41782e1960) at
> io/qtextstream.cpp:968
> #9  QTextStream::operator<< (this=0x7f41782ab6f0, string=...) at
> io/qtextstream.cpp:2533
> #10 0x00007f41ca7906b5 in operator<< (t=..., this=<optimized out>) at
> /usr/include/qt4/QtCore/qdebug.h:112
> #11 Dynamic::TrackSet::subtract (this=0x7f41782ab6f0,
> this@entry=0x7f4180823bd0, B=...) at ../../src/dynamic/TrackSet.cpp:220

Please open a new bug, you submitted this to a bug closed as invalid, because important feedback was missing from the original reporter.