Bug 148317 - dynamic mode floods playlist and locks amarok
Summary: dynamic mode floods playlist and locks amarok
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Playlist (show other bugs)
Version: 1.4.7
Platform: openSUSE Linux
: VHI crash
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 146978 148508 148731 149282 152310 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-07-29 12:07 UTC by Kristjan Ugrin
Modified: 2008-02-08 08:04 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kristjan Ugrin 2007-07-29 12:07:51 UTC
Version:           1.4.6 (using KDE KDE 3.5.7)
Installed from:    SuSE RPMs
OS:                Linux

I discovered this by accident. When using dynamic mode, there is a way to get dynamic mode to constantly add new songs and lock amarok.

Steps to reproduce
1. clear playlist, press stop
2. load dynamic playlist (I use as source whole collection)
3. press play and skip some tracks (at least 3, had trouble with reproducing with less)
4. press stop. Now you should have amarok stopped somewhere away from first entry (track) in playlist.
5. press previous track button. Flashing bar, indicating current track should disappear.
(NOTE) get ready to press TURN OFF button, otherwise amarok might freeze
6. press play. At this point nothing might happen, if so press play again so play button pops out. Press play again. Now amarok should start adding same track into playlist like crazy. If nothing happens, just keep pressing play until it does.
Comment 1 Harald Sitter 2007-07-29 13:29:51 UTC
Reproduced with Kubuntu Feisty Fawn. Even though I think we should fix this for 1.4.7, it's probably hard to do so, because the only possible solution I see... is code revuing :|
Also the bug isn't that easy to cause, usually one will click on a certain track after not working play trial in step 6.

So maybe the bug disappears after the 2.0 redesign of dynamic playlists anyway?
Comment 2 Ian Monroe 2007-07-30 17:56:31 UTC
Track adding is a threaded operation so sometimes one hand doesn't know what the other is doing. 

I don't have any plans (so far) to make track adding in Amarok 2.0 threaded so we can avoid such issues.
Comment 3 Kristjan Ugrin 2007-07-30 18:24:48 UTC
But this it won't be fixed in 1.4.x branch? On my opinion is better to concentrate on 2.x. I just reported to avoid such cases in future (2.0).
Comment 4 Harald Sitter 2007-08-04 15:46:06 UTC
assigned to the wrong person
Comment 5 Harald Sitter 2007-08-04 15:46:44 UTC
*** Bug 148508 has been marked as a duplicate of this bug. ***
Comment 6 Harald Sitter 2007-08-11 00:54:57 UTC
*** Bug 148731 has been marked as a duplicate of this bug. ***
Comment 7 Harald Sitter 2007-08-11 00:56:02 UTC
Changed summary to reflect one more (major) effect.
Comment 8 Harald Sitter 2007-08-27 23:34:01 UTC
*** Bug 146978 has been marked as a duplicate of this bug. ***
Comment 9 Harald Sitter 2007-08-27 23:34:08 UTC
*** Bug 149282 has been marked as a duplicate of this bug. ***
Comment 10 Harald Sitter 2007-08-27 23:40:47 UTC
Increased priority to very high, this seems to be a kinda annoying issue, with a lot of reports, I think there are still various out there in bugzilla reporting the very same problem just with strange wording.

Also it seems to cause crashes under very certain circumstance (I guess to small RAM to stop the flooding in time).

Should be fixed in stable, IMHO.
Comment 11 Jeff Mitchell 2007-08-28 05:04:54 UTC
Sometimes I have to sit back and wonder how people find these things.

Anyways, I'm working on it.  Hopefully I won't break something else while fixing this.  Dynamic mode is fragile.
Comment 12 Jeff Mitchell 2007-08-28 05:25:40 UTC
SVN commit 705494 by mitchell:

Fix this bug by forcing "Prev Track" on a dynamic playlist always cause the current track to be replayed.  If the player is stopped it does absolutely 
nothing; if the player is playing, it restarts the track.  You can still select previous tracks via Enter or double-clicking to cause them to play again.

BUG: 148317


 M  +3 -0      ChangeLog  
 M  +4 -1      src/playlist.cpp  


--- branches/stable/extragear/multimedia/amarok/ChangeLog #705493:705494
@@ -4,6 +4,9 @@
 
 VERSION 1.4.8
   BUGFIXES:
+    * Pressing Preveious Track in a Dynamic Playlist could cause undefined
+      behavior in certain edge conditions.  Now it always plays the current
+      track. (BR 148317)
     * Immediately after loading a dynamic playlist, you couldn't drag a
       track to the top of the playlist. (BR 149263)
     * Fix transferring files with UTF8 names to MTP devices. Thanks to Kevin
--- branches/stable/extragear/multimedia/amarok/src/playlist.cpp #705493:705494
@@ -1227,8 +1227,11 @@
     }
     else
     {
-        if ( !AmarokConfig::randomMode() || m_prevTracks.count() <= 1 )
+        if( dynamicMode() )
         {
+        }
+        else if( !AmarokConfig::randomMode() || m_prevTracks.count() <= 1 )
+        {
             if( item )
             {
                 item = MyIt::prevVisible( item );
Comment 13 Kristjan Ugrin 2007-08-28 08:15:45 UTC
@Jeff Mitchell: I discovered by accident. But today I upgraded to amarok 1.4.7 and this issue shows up, without doing anything special, I just restarted amarok (it was in dynamic mode), upon restart hell broke out. I'm still investigating and trying to reproduce it.
Comment 14 Jeff Mitchell 2007-08-28 13:09:25 UTC
Umm...if you had looked at the bug report before commenting, you'd notice that it's been patched and fixed...
Comment 15 Kristjan Ugrin 2007-08-28 13:20:10 UTC
Sorry, I missed out in which version is fix included.
Comment 16 Jeff Mitchell 2007-08-28 13:31:38 UTC
Whatever the next version is after the date of the commit.  Since I made it yesterday and the currently released version is 1.4.7, that would mean the fix will be in 1.4.8.  You could also have gotten this by looking at the ChangeLog part of the commit and seen that it was in the 1.4.8 section...
Comment 17 Harald Sitter 2007-11-14 18:33:50 UTC
*** Bug 152310 has been marked as a duplicate of this bug. ***
Comment 18 Kristjan Ugrin 2007-11-14 20:39:06 UTC
We need a fixed release soon. I managed accidentaly to run into this bug many times, because I use "resume playback on restart" and it is possible to run into this by restarting amarok under some circumstances (dynamic playlist must be active).
Comment 19 Harald Sitter 2007-11-14 21:07:45 UTC
I can ask packagers to release a patched version until 1.4.8 is out, but they might as well not do that.
Comment 20 Matt Gagne 2008-01-17 20:34:25 UTC
I am using 1.4.8 (the version within which the fix has been implemented), but this bug is still present:
Although no longer triggered by using 'Previous Track,' it still occurs when a song which has been played in a Dynamic Playlist (ie name appears greyed out above currently playing song) is added to the upcoming queue (or dragged below the current playing song). Essentially, when Amarok tries to play a song which is 'Grey,' the infinite loop behaviour starts.
Comment 21 Kristjan Ugrin 2008-01-17 20:56:03 UTC
I cannot reproduce this. Can you please include more detailed steps (be really specific)?
I was trying to drag "grey" tracks and adding them below current playing, however I couldn't trigger such problem.
Comment 22 Matt Gagne 2008-01-18 06:36:31 UTC
Dragging the grey tracks does not appear to trigger the bug, as they appear below the song as 'black' or 'blue' tracks.

After much fidgeting, I managed to make it happen reliably using the following procedure:
1) Load a dynamic playlist.
2) Play a song.
3) Play a second song. (First song is now 'grey')
4) Once second song plays through (Second song now appears 'grey'), press 'Stop' during third song.  The big blue 'now playing' bubble should be surrounding track #3.
5) Right click on track #3 (the one surrounded by the bubble) and select "remove from playlist".  The play list should now contain two grey tracks at the top, however many black or blue tracks below them, and NO 'now playing' bubble.
6) Double click on track #1 (the first track you played, which should still be 'grey')
7) Allow craziness to ensue.  The eventual crash can be averted by simply double clicking on a different song in the list to force Amarok past the repeatedly-added song.

This has worked the past 3 or 4 times I tried to reproduce the bug.
Comment 23 Kristjan Ugrin 2008-01-18 11:18:08 UTC
Confirmed. I was forced to terminate amarok, because it didn't respond any more to my input actions.
Comment 24 Daniel Benamy 2008-02-08 08:04:19 UTC
I just hit this in 1.4.8. I can't reproduce it though. The steps in comment 22 don't trigger it. I think I got into a state where when I'd load it and hit play it would happen. I'd have to kill amarok so of course when I ran it again it was in the same state again and the bug happened. I think there weren't any songs selected with either the plain blue or the bubble. I got out of the cycle by running amarok and double clicking a song instead of clicking play. If I hit the bug again I'll try to figure out how it happened.