Bug 226290 - crash when rightclicking a saved playlist in merged view
Summary: crash when rightclicking a saved playlist in merged view
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Playlists/Saved Playlists (show other bugs)
Version: 2.3-GIT
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 226918 226970 228000 228713 229499 230696 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-02-11 12:11 UTC by Marius
Modified: 2011-01-04 16:14 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.3.0


Attachments
Picture of where to click to crash amarok (53.52 KB, image/jpeg)
2010-03-02 20:04 UTC, Carlos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marius 2010-02-11 12:11:05 UTC
Version:           2.2-GIT (using 4.4.00 (KDE 4.4.0), Gentoo)
Compiler:          i686-pc-linux-gnu-gcc
OS:                Linux (i686) release 2.6.32-gentoo-r1

When I rightclick on a saved playlist when the merged view is activated, the application crashes (see backtrace below).
Additionally, saved playlists in "normal" view behave strange: when I select "append to playlist" or "replace playlist" always the topmost playlist is appended to the current playlist, regardless on which playlist I actually clicked. When I rightclick on a track and select "add to playlist", an arbitrary saved playlist is added instead.
Dragging a playlist or a track to the current playlist works, though.

Here is the backtrace of the crash:

0	__kernel_vsyscall		0	0xb7fe1424	
1	raise	/lib/libc.so.6	0	0xb645d421	
2	abort	/lib/libc.so.6	0	0xb645eb62	
3	qt_message_output(QtMsgType, char const*)	/usr/lib/qt4/libQtCore.so.4	0	0xb6f1b1d9	
4	??	/usr/lib/qt4/libQtCore.so.4	0	0xb6f1b37a	
5	qFatal(char const*, ...)	/usr/lib/qt4/libQtCore.so.4	0	0xb6f1b48b	
6	qt_assert(char const*, char const*, int)	/usr/lib/qt4/libQtCore.so.4	0	0xb6f1b508	
7	KSharedPtr<Meta::Playlist>::operator->	ksharedptr.h	126	0xb7521973	
8	PlaylistBrowserNS::UserModel::trackFromIndex	UserPlaylistModel.cpp	738	0xb7768561	
9	PlaylistBrowserNS::UserModel::selectedTracks	UserPlaylistModel.cpp	728	0xb7768413	
10	PlaylistBrowserNS::UserModel::actionsFor	UserPlaylistModel.cpp	524	0xb776679d	
11	PlaylistBrowserNS::UserPlaylistTreeView::contextMenuEvent	UserPlaylistTreeView.cpp	155	0xb776d83e	
12	QWidget::event(QEvent*)	/usr/lib/qt4/libQtGui.so.4	0	0xb6806b11	
13	??		0	0xbfffd61c	
14	??	/usr/lib/libX11.so.6	0	0xb6363865	
15	??		0	0xbfffd5bc	
16	??	/usr/lib/libX11.so.6	0	0xb63218f0	
17	??		0	0x09ee71a8	
18	??		0	0x0969cb48	
19	??		0	0x08fd09c0	
20	_XimGetResourceListRec	/usr/lib/libX11.so.6	0	0xb6322ad4	
21	??		0	0x08140368	
22	??		0	0x0000022a	
23	??	/usr/lib/libX11.so.6	0	0xb63cbff4	
24	??		0	0x09ef319c	
25	??		0	0x0969cb48	
26	??		0	0x00000004	
27	_XimSetICValueData	/usr/lib/libX11.so.6	0	0xb63239b6	
28	??		0	0x0969d248	
29	??		0	0x00000014	
30	??		0	0x00000001	
31	??	/usr/lib/qt4/libQtGui.so.4	0	0xb680cb29	
32	??		0	0x00000227	
33	??		0	0x0000022a	
34	??		0	0x0000022b	
35	??	/usr/lib/libX11.so.6	0	0xb6363858	
36	??		0	0xbfffd5c8	
37	??	/usr/lib/libX11.so.6	0	0xb6363865	
38	??		0	0xbfffd568	
39	??	/usr/lib/libX11.so.6	0	0xb63218f0	
40	??	/usr/lib/libX11.so.6	0	0xb62c0e30	
41	??	/usr/lib/libX11.so.6	0	0xb63cbff4	
42	??		0	0x09ee71a8	
43	??		0	0xbfffd514	
44	??	/lib/ld-linux.so.2	0	0xb7ffefc4	
45	??	/usr/lib/libX11.so.6	0	0xb62baee4	
46	??		0	0x0000000c	
47	??	/usr/lib/libX11.so.6	0	0xb63cbff4	
48	??		0	0x09ee71a8	
49	??		0	0x09ee71a8	
50	??		0	0xbfffd514	
51	_XimLocalSetICValues	/usr/lib/libX11.so.6	0	0xb63153c6	
52	??		0	0xbfffdd84	
53	??		0	0x08ecb898	
54	??		0	0xbfffdd84	
55	??		0	0x00000043	
56	??		0	0x0891f6d0	
57	??		0	0x08fd0dd0	
58	??	/usr/lib/qt4/libQtGui.so.4	0	0xb6eb9ff4	
59	??	/usr/lib/qt4/libQtGui.so.4	0	0xb680f49d	
60	??		0	0xbfffd5c0	
61	??		0	0xbfffd5e8	
62	??		0	0x00000000
Comment 1 Myriam Schweingruber 2010-02-15 09:22:38 UTC
Confirmed by duplicate
Comment 2 Myriam Schweingruber 2010-02-15 09:22:52 UTC
*** Bug 226918 has been marked as a duplicate of this bug. ***
Comment 3 Bart Cerneels 2010-02-15 10:07:27 UTC
commit e733faa11f6d10a416ecff6c4f1c8f9d8bb51e37
Author: Bart Cerneels <bart.cerneels@kde.org>
Date:   Mon Feb 15 10:05:11 2010 +0100

    Fixed crash when right clicking on a header
    
    BUG:226290

diff --git a/ChangeLog b/ChangeLog
index 5e6142d..f169533 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,7 @@ VERSION 2.3
     * Port Copy/Move to Collection actions to the new File Browser.
 
   BUGFIXES:
+    * Fixed crash when right clicking on a header in "saved playlists". (BR 226290)
     * Fixed bug that prevented files from being deleted from the file browser
       when performing a Move operation.
     * Fixed bug in organize collection dialog that used the old %theartist
diff --git a/src/browsers/playlistbrowser/UserPlaylistModel.cpp b/src/browsers/playlistbrowser/UserPlaylistModel.cpp
index abfccb5..a586972 100644
--- a/src/browsers/playlistbrowser/UserPlaylistModel.cpp
+++ b/src/browsers/playlistbrowser/UserPlaylistModel.cpp
@@ -733,8 +733,13 @@ PlaylistBrowserNS::UserModel::selectedTracks( const QModelIndexList &list )
 Meta::TrackPtr
 PlaylistBrowserNS::UserModel::trackFromIndex( const QModelIndex &index ) const
 {
-    Meta::PlaylistPtr playlist = m_playlists.value(
-            REMOVE_TRACK_MASK(index.internalId()) );
+    if( !index.isValid() )
+        return Meta::TrackPtr();
+
+    Meta::PlaylistPtr playlist = m_playlists.value( REMOVE_TRACK_MASK(index.internalId()) );
+    if( playlist.isNull() || playlist->tracks().count() <= index.row() )
+        return Meta::TrackPtr();
+
     return playlist->tracks()[index.row()];
 }
Comment 4 Marius 2010-02-15 10:52:25 UTC
This fixes the crash part of my report, thank you! For the strange behaviour of "Add To Playlist" I created a new report, because it seems to be unrelated to the crash: bug #226954
Comment 5 Myriam Schweingruber 2010-02-15 13:49:09 UTC
*** Bug 226970 has been marked as a duplicate of this bug. ***
Comment 6 Myriam Schweingruber 2010-02-22 09:39:26 UTC
*** Bug 228000 has been marked as a duplicate of this bug. ***
Comment 7 Myriam Schweingruber 2010-02-27 10:28:55 UTC
*** Bug 228713 has been marked as a duplicate of this bug. ***
Comment 8 Carlos 2010-03-02 20:03:20 UTC
I am not sure if this is the same bug or not. I can rightclick on the playlist itself, but not on the .. thing over it. I will upload an picture so you know what i mean.

I use 2.3 beta from debian experimental
Comment 9 Carlos 2010-03-02 20:04:45 UTC
Created attachment 41265 [details]
Picture of where to click to crash amarok
Comment 10 Myriam Schweingruber 2010-03-02 20:15:18 UTC
Carlos, are you using a git build of Amarok? You seem to use 2.2.90, which is anterior to this change...
Comment 11 Carlos 2010-03-02 20:24:08 UTC
Yes, i use 2.2.90.
Sorry, my English is not that good, do you mean that those are the same bugs and it is fixed it git?
Comment 12 Myriam Schweingruber 2010-03-02 20:38:16 UTC
(In reply to comment #11)
> Yes, i use 2.2.90.
> Sorry, my English is not that good, do you mean that those are the same bugs
> and it is fixed it git?
Your version did come out before this fix was committed, yes.
As to know if you are facing the same bug: it is unlikely, since you do not use the merged view (zusammengefasste Ansicht).

FWIW, if a bug states it is about 2.3-git, then it is more recent than your current 2.3 beta version.
Comment 13 Myriam Schweingruber 2010-03-05 10:39:24 UTC
*** Bug 229499 has been marked as a duplicate of this bug. ***
Comment 14 Myriam Schweingruber 2010-03-14 13:12:55 UTC
*** Bug 230696 has been marked as a duplicate of this bug. ***