Bug 295275

Summary: Collection browser crashes in QDragManager when very quickly starting and stopping drag [@ CollectionTreeView::dragEnterEvent]
Product: [Applications] amarok Reporter: Sam Lade <sam>
Component: Collection BrowserAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: crash CC: stilor
Priority: NOR    
Version: 2.5-git   
Target Milestone: 2.6   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 2.6
Sentry Crash Report:
Attachments: New crash information added by DrKonqi

Description Sam Lade 2012-03-03 22:02:59 UTC
I attempted to collapse an item in the collection browser tree view, but accidentally triggered a drag event, and Amarok crashed. Backtrace in comment.

This is reproducible every time. Steps:
Simply drag up and release any item in the collection browser tree as quickly as possible, e.g. by single-clicking while moving the mouse. Amarok crashes immediately.

Latest Amarok git, KDE 4.8, Qt 4.8 on Kubuntu 11.10.
Comment 1 Sam Lade 2012-03-03 22:03:48 UTC
Backtrace:

Thread 1 (Thread 0x7f75d84e27c0 (LWP 3934)):
[KCrash Handler]
#6  data (this=0x8) at ../../include/QtCore/../../src/corelib/tools/qscopedpointer.h:135
#7  qGetPtrHelper<QScopedPointer<QObjectData> > (p=...) at ../../include/QtCore/../../src/corelib/global/qglobal.h:2430
#8  d_func (this=0x0) at ../../include/QtCore/../../src/corelib/kernel/qeventloop.h:58
#9  QEventLoop::exit (this=0x0, returnCode=0) at kernel/qeventloop.cpp:284
#10 0x00007f75ecb12bca in QDragManager::eventFilter (this=0x46843b0, o=<optimized out>, e=<optimized out>) at kernel/qdnd_x11.cpp:1330
#11 0x00007f75ec0936cc in QCoreApplicationPrivate::sendThroughApplicationEventFilters (this=0x1bd8530, receiver=0x7f75a8291b20, event=0x7fffbe94cbe0) at kernel/qcoreapplication.cpp:967
#12 0x00007f75eca87076 in QApplicationPrivate::notify_helper (this=0x1bd8530, receiver=0x7f75a8291b20, e=0x7fffbe94cbe0) at kernel/qapplication.cpp:4530
#13 0x00007f75eca8c92f in QApplication::notify (this=<optimized out>, receiver=0x7f75a8291b20, e=0x7fffbe94cbe0) at kernel/qapplication.cpp:4098
#14 0x00007f75ee4cdae6 in KApplication::notify (this=0x7fffbe9509f0, receiver=0x7f75a8291b20, event=0x7fffbe94cbe0) at ../../kdeui/kernel/kapplication.cpp:311
#15 0x00007f75ec0935fc in QCoreApplication::notifyInternal (this=0x7fffbe9509f0, receiver=0x7f75a8291b20, event=0x7fffbe94cbe0) at kernel/qcoreapplication.cpp:876
#16 0x00007f75eca880d2 in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#17 QApplicationPrivate::sendMouseEvent (receiver=0x7f75a8291b20, event=0x7fffbe94cbe0, alienWidget=0x2d34820, nativeWidget=0x1bc0aa0, buttonDown=0x2d34820, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:3166
#18 0x00007f75ecb04765 in QETWidget::translateMouseEvent (this=0x1bc0aa0, event=<optimized out>) at kernel/qapplication_x11.cpp:4613
#19 0x00007f75ecb0362a in QApplication::x11ProcessEvent (this=0x7fffbe9509f0, event=0x7fffbe94d4a0) at kernel/qapplication_x11.cpp:3732
#20 0x00007f75ecb2c592 in x11EventSourceDispatch (s=0x1bc1d40, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#21 0x00007f75e5baba5d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#22 0x00007f75e5bac258 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x00007f75e5bac429 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#24 0x00007f75ec0c2b9f in QEventDispatcherGlib::processEvents (this=0x19a9ad0, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:424
#25 0x00007f75ecb2c21e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=<optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#26 0x00007f75ec09786f in QCoreApplication::processEvents (flags=...) at kernel/qcoreapplication.cpp:1063
#27 0x00007f75ede4f547 in AmarokMimeData::tracks (this=0x44b8280) at /home/sam/devel/amarok/src/AmarokMimeData.cpp:128
#28 0x00007f75edac4197 in CollectionTreeView::dragEnterEvent (this=0x2d339c0, event=0x7fffbe94e5a0) at /home/sam/devel/amarok/src/browsers/CollectionTreeView.cpp:483
#29 0x00007f75ecad7c13 in QWidget::event (this=0x2d339c0, event=0x7fffbe94e5a0) at kernel/qwidget.cpp:8555
#30 0x00007f75ece955c6 in QFrame::event (this=0x2d339c0, e=0x7fffbe94e5a0) at widgets/qframe.cpp:557
#31 0x00007f75ecfa9c3b in QAbstractItemView::viewportEvent (this=0x2d339c0, event=0x7fffbe94e5a0) at itemviews/qabstractitemview.cpp:1644
#32 0x00007f75edaf9df0 in CollectionBrowserTreeView::viewportEvent (this=0x2d339c0, event=0x7fffbe94e5a0) at /home/sam/devel/amarok/src/browsers/collectionbrowser/CollectionBrowserTreeView.cpp:112
#33 0x00007f75ec093788 in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=<optimized out>, receiver=0x2d34820, event=0x7fffbe94e5a0) at kernel/qcoreapplication.cpp:986
#34 0x00007f75eca870cf in notify_helper (e=0x7fffbe94e5a0, receiver=0x2d34820, this=0x1bd8530) at kernel/qapplication.cpp:4551
#35 QApplicationPrivate::notify_helper (this=0x1bd8530, receiver=0x2d34820, e=0x7fffbe94e5a0) at kernel/qapplication.cpp:4527
#36 0x00007f75eca8c704 in QApplication::notify (this=<optimized out>, receiver=<optimized out>, e=0x7fffbe94e5a0) at kernel/qapplication.cpp:4290
#37 0x00007f75ee4cdae6 in KApplication::notify (this=0x7fffbe9509f0, receiver=0x2d34820, event=0x7fffbe94e5a0) at ../../kdeui/kernel/kapplication.cpp:311
#38 0x00007f75ec0935fc in QCoreApplication::notifyInternal (this=0x7fffbe9509f0, receiver=0x2d34820, event=0x7fffbe94e5a0) at kernel/qcoreapplication.cpp:876
#39 0x00007f75ecb11664 in sendEvent (event=0x7fffbe94e5a0, receiver=0x2d34820) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#40 handle_xdnd_position (w=0x21a98b0, xe=0x7fffbe94e8f0, passive=false) at kernel/qdnd_x11.cpp:916
#41 0x00007f75ecb12440 in QDragManager::move (this=0x46843b0, globalPos=...) at kernel/qdnd_x11.cpp:1689
#42 0x00007f75ecb1293b in QDragManager::drag (this=0x46843b0, o=<optimized out>) at kernel/qdnd_x11.cpp:2001
#43 0x00007f75eca98c68 in QDrag::exec (this=0x376e640, supportedActions=..., defaultDropAction=Qt::CopyAction) at kernel/qdrag.cpp:284
#44 0x00007f75ecfb5943 in QAbstractItemView::startDrag (this=0x2d339c0, supportedActions=...) at itemviews/qabstractitemview.cpp:3540
#45 0x00007f75edac4ce1 in CollectionTreeView::startDrag (this=0x2d339c0, supportedActions=...) at /home/sam/devel/amarok/src/browsers/CollectionTreeView.cpp:589
#46 0x00007f75ecfb346e in QAbstractItemView::mouseMoveEvent (this=0x2d339c0, event=<optimized out>) at itemviews/qabstractitemview.cpp:1725
#47 0x00007f75edac3a5c in CollectionTreeView::mouseMoveEvent (this=0x2d339c0, event=0x7fffbe94fce0) at /home/sam/devel/amarok/src/browsers/CollectionTreeView.cpp:396
#48 0x00007f75edaf9938 in CollectionBrowserTreeView::mouseMoveEvent (this=0x2d339c0, event=0x7fffbe94fce0) at /home/sam/devel/amarok/src/browsers/collectionbrowser/CollectionBrowserTreeView.cpp:44
#49 0x00007f75ecad7948 in QWidget::event (this=0x2d339c0, event=0x7fffbe94fce0) at kernel/qwidget.cpp:8346
#50 0x00007f75ece955c6 in QFrame::event (this=0x2d339c0, e=0x7fffbe94fce0) at widgets/qframe.cpp:557
#51 0x00007f75ecfa9c3b in QAbstractItemView::viewportEvent (this=0x2d339c0, event=0x7fffbe94fce0) at itemviews/qabstractitemview.cpp:1644
#52 0x00007f75edaf9df0 in CollectionBrowserTreeView::viewportEvent (this=0x2d339c0, event=0x7fffbe94fce0) at /home/sam/devel/amarok/src/browsers/collectionbrowser/CollectionBrowserTreeView.cpp:112
#53 0x00007f75ec093788 in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=<optimized out>, receiver=0x2d34820, event=0x7fffbe94fce0) at kernel/qcoreapplication.cpp:986
#54 0x00007f75eca870cf in notify_helper (e=0x7fffbe94fce0, receiver=0x2d34820, this=0x1bd8530) at kernel/qapplication.cpp:4551
#55 QApplicationPrivate::notify_helper (this=0x1bd8530, receiver=0x2d34820, e=0x7fffbe94fce0) at kernel/qapplication.cpp:4527
#56 0x00007f75eca8c92f in QApplication::notify (this=<optimized out>, receiver=0x2d34820, e=0x7fffbe94fce0) at kernel/qapplication.cpp:4098
#57 0x00007f75ee4cdae6 in KApplication::notify (this=0x7fffbe9509f0, receiver=0x2d34820, event=0x7fffbe94fce0) at ../../kdeui/kernel/kapplication.cpp:311
#58 0x00007f75ec0935fc in QCoreApplication::notifyInternal (this=0x7fffbe9509f0, receiver=0x2d34820, event=0x7fffbe94fce0) at kernel/qcoreapplication.cpp:876
#59 0x00007f75eca880d2 in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#60 QApplicationPrivate::sendMouseEvent (receiver=0x2d34820, event=0x7fffbe94fce0, alienWidget=0x2d34820, nativeWidget=0x1bc0aa0, buttonDown=0x2d34820, lastMouseReceiver=..., spontaneous=true) at kernel/qapplication.cpp:3166
#61 0x00007f75ecb04765 in QETWidget::translateMouseEvent (this=0x1bc0aa0, event=<optimized out>) at kernel/qapplication_x11.cpp:4613
#62 0x00007f75ecb0362a in QApplication::x11ProcessEvent (this=0x7fffbe9509f0, event=0x7fffbe9505a0) at kernel/qapplication_x11.cpp:3732
#63 0x00007f75ecb2c592 in x11EventSourceDispatch (s=0x1bc1d40, callback=0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#64 0x00007f75e5baba5d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#65 0x00007f75e5bac258 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#66 0x00007f75e5bac429 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#67 0x00007f75ec0c2b9f in QEventDispatcherGlib::processEvents (this=0x19a9ad0, flags=<optimized out>) at kernel/qeventdispatcher_glib.cpp:424
#68 0x00007f75ecb2c21e in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=<optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#69 0x00007f75ec0923e2 in QEventLoop::processEvents (this=<optimized out>, flags=...) at kernel/qeventloop.cpp:149
#70 0x00007f75ec092637 in QEventLoop::exec (this=0x7fffbe950970, flags=...) at kernel/qeventloop.cpp:204
#71 0x00007f75ec0976c7 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1148
#72 0x000000000040c76c in main (argc=1, argv=0x7fffbe952e68) at /home/sam/devel/amarok/src/main.cpp:303
Comment 2 Alexey Neyman 2012-03-15 15:38:54 UTC
Created attachment 69643 [details]
New crash information added by DrKonqi

amarok (2.5-GIT) on KDE Platform 4.8.1 (4.8.1) using Qt 4.8.0

- What I was doing when the application crashed:
Exactly what this bug described: browsing a collection (and perhaps, moved mouse while left button was pressed).

-- Backtrace (Reduced):
#7  0xb59add57 in data (this=0x4) at ../../include/QtCore/../../src/corelib/tools/qscopedpointer.h:135
[...]
#10 QEventLoop::exit (this=0x0, returnCode=0) at kernel/qeventloop.cpp:284
#11 0xb5fb44cc in QDragManager::eventFilter (this=0xa7d99a0, o=0xa7d9fb0, e=0xbf877e04) at kernel/qdnd_x11.cpp:1330
#12 0xb59af17b in QCoreApplicationPrivate::sendThroughApplicationEventFilters (this=0x8c79bf0, receiver=0xa7d9fb0, event=0xbf877e04) at kernel/qcoreapplication.cpp:967
#13 0xb5f17c9a in QApplicationPrivate::notify_helper (this=0x8c79bf0, receiver=0xa7d9fb0, e=0xbf877e04) at kernel/qapplication.cpp:4530
Comment 3 Myriam Schweingruber 2012-03-15 16:42:06 UTC
Apparently the crash happens even earlier in AmarokMimeData::tracks.

Alexey: this report is already confirmed and has a valid backtrace, no need to add more.
Comment 4 Sam Lade 2012-03-18 13:33:16 UTC
Git commit 0855efca1ddd558709d38e2ebb322c8346303abd by Sam Lade.
Committed on 18/03/2012 at 14:30.
Pushed by lade into branch 'master'.

Prevent crash on very quick drag and release of tracks
FIXED-IN:2.6
REVIEW:295275

M  +1    -0    ChangeLog
M  +1    -1    src/AmarokMimeData.cpp

http://commits.kde.org/amarok/0855efca1ddd558709d38e2ebb322c8346303abd