Summary: | Amarok crashes when selecting 'next track' or manually changing song in playlist [@ Meta::SqlTrack::updateStatisticsInDb] | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | Clint <gibbo_07> |
Component: | Collections/Local | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | mitchell, ralf-engels |
Priority: | NOR | ||
Version: | 2.4-GIT | ||
Target Milestone: | 2.4.0 | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 2.4 |
Description
Clint
2010-10-19 10:30:28 UTC
Just noticed bt is incomplete despite the crash handler being happy with it. I will remove the debug stripping on the other packages and reproduce the bug if requested. Well, the backtrace is OK from the Amarok POV, and there is no evidence that the crash is related to phonon-vlc. It is a collection problem. Hi, this could be a threading problem. SqlTrack is only insufficiently protected against multiple access from different threads. In this specific case the statistics are very likely to be written from phonon thread and at the same time from the UI thread. This would be consistent with the fact that it does not happen every time and that phonon could influence it. My collectionscanner patch will fix this too. Hi Ralf, If you need I can test such a patch whenever it's ready, as currently my beloved amarok is broken and I miss it dearly :) Ok. I will make a separate patch for the threading safety, which you can try out. Let's see if that really helps. Ralf, You're barking up the wrong tree. If this is truly a thread-safety issue, the right question to be asking is: why are the statistics being written from two different places? Also a good question. From the backtrace I see that PrettyListView seems to initiate one finishedPlaying. And I know that the EngineController is initiating one when the old track is finished playing. Although I thought that EngineController (because it is using signals and slots) is pretty safe from any threading issues. But I will have a look at PrettyListView and figure out why it thinks that it needs to call finishedPlaying itself. I have now posted a patch on the git review board: http://git.reviewboard.kde.org/r/100097/ Clint, since you are the only person being capable of reproducing the bug, could you please try the patch. This first patch is more in the line of Jeff as it changes the PlaylistActions and not SqlTrack. And here is the patch to make SqlMeta thread safe. http://git.reviewboard.kde.org/r/100098/ I am wondering which of the patches solves the problem. Hopefully both do, and we can take our pick as to which is the proper fix. :-) Hi guys, just back from a quick holiday and I thank you for the patches to test. I seem to have successfully applied the diff-r2 of Improve SqlMeta thread safety, tested for a while now and while there appears to be improvement, it either still happens only less frequently; or there is a different crash happening aswell. The Enginecontroller patch does not seem to apply for me, however this may be user error??. I've switched to git rather than the 9999 ebuilds to keep track of things, and tried applying as so: # /usr/src/amarok ] git apply /home/user/0002-Engine-controller-trackFinished-patch.patch error: patch failed: src/EngineController.cpp:364 error: src/EngineController.cpp: patch does not apply error: patch failed: src/playlist/PlaylistActions.cpp:216 error: src/playlist/PlaylistActions.cpp: patch does not apply This may be useful, a gdb bt trace. Done after switching to git and with the sql patch applied. Program received signal SIGSEGV, Segmentation fault. QSortFilterProxyModel::parent (this=0xd8bd50, child=...) at itemviews/qsortfilterproxymodel.cpp:1656 1656 itemviews/qsortfilterproxymodel.cpp: No such file or directory. in itemviews/qsortfilterproxymodel.cpp (gdb) bt #0 QSortFilterProxyModel::parent (this=0xd8bd50, child=...) at itemviews/qsortfilterproxymodel.cpp:1656 #1 0x00007ffff75e8e1b in QModelIndex::sibling (this=0x35a7b60, arow=222, acolumn=0) at /usr/include/qt4/QtCore/qabstractitemmodel.h:392 #2 0x00007ffff75e4b84 in Playlist::GroupingProxy::groupModeForIndex (this=0xd8bd50, thisIndex=...) at /usr/src/amarok/src/playlist/proxymodels/GroupingProxy.cpp:255 #3 0x00007ffff75e488f in Playlist::GroupingProxy::data (this=0xd8bd50, index=..., role=256) at /usr/src/amarok/src/playlist/proxymodels/GroupingProxy.cpp:174 #4 0x00007ffff7494809 in QModelIndex::data (this=0x35a7b60, arole=256) at /usr/include/qt4/QtCore/qabstractitemmodel.h:398 #5 0x00007ffff7580cf0 in Playlist::PlaylistLayout::partForItem (this=0x7fffffff82f0, index=...) at /usr/src/amarok/src/playlist/layouts/LayoutItemConfig.cpp:167 #6 0x00007ffff75cd06e in Playlist::PlaylistLayout::layoutForItem (this=0x7fffffff82f0, index=...) at /usr/src/amarok/src/playlist/layouts/LayoutItemConfig.h:261 #7 0x00007ffff75d07eb in Playlist::PrettyItemDelegate::paint (this=0x108e1b0, painter=0x7fffffff88b0, option=..., index=...) at /usr/src/amarok/src/playlist/view/listview/PrettyItemDelegate.cpp:193 #8 0x0000003c087301b1 in QListView::paintEvent (this=<value optimized out>, e=<value optimized out>) at itemviews/qlistview.cpp:1044 #9 0x00007ffff75dbf0e in Playlist::PrettyListView::paintEvent (this=0x1088700, event=0x7fffffff9590) at /usr/src/amarok/src/playlist/view/listview/PrettyListView.cpp:631 #10 0x0000003c0821e8dd in QWidget::event (this=0x1088700, event=0x7fffffff9590) at kernel/qwidget.cpp:8383 #11 0x0000003c085df7b6 in QFrame::event (this=0x1088700, e=0x7fffffff9590) at widgets/qframe.cpp:557 #12 0x0000003c0871168b in QAbstractItemView::viewportEvent (this=0x1088700, event=0x7fffffff9590) at itemviews/qabstractitemview.cpp:1619 #13 0x0000003ebed6c136 in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=<value optimized out>, receiver= 0x10877a0, event=0x7fffffff9590) at kernel/qcoreapplication.cpp:847 #14 0x0000003c081c903c in QApplicationPrivate::notify_helper (this=0x762ce0, receiver=0x10877a0, e=0x7fffffff9590) at kernel/qapplication.cpp:4450 #15 0x0000003c081ce4ad in QApplication::notify (this=0x7fffffffbd90, receiver=0x10877a0, e=0x7fffffff9590) at kernel/qapplication.cpp:4333 #16 0x0000003c09848a76 in KApplication::notify (this=0x7fffffffbd90, receiver=0x10877a0, event=0x7fffffff9590) at /var/tmp/portage/kde-base/kdelibs-4.5.2/work/kdelibs-4.5.2/kdeui/kernel/kapplication.cpp:310 #17 0x0000003ebed6c8eb in QCoreApplication::notifyInternal (this=0x7fffffffbd90, receiver=0x10877a0, event=0x7fffffff9590) at kernel/qcoreapplication.cpp:732 #18 0x0000003c082252dd in sendSpontaneousEvent (this=0x1088c70, pdev=<value optimized out>, rgn=..., offset=<value optimized out>, flags=<value optimized out>, sharedPainter=0x0, backingStore=0x101d8d0) ---Type <return> to continue, or q <return> to quit--- at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:218 #19 QWidgetPrivate::drawWidget (this=0x1088c70, pdev=<value optimized out>, rgn=..., offset=<value optimized out>, flags=<value optimized out>, sharedPainter=0x0, backingStore=0x101d8d0) at kernel/qwidget.cpp:5470 #20 0x0000003c08225f63 in QWidgetPrivate::paintSiblingsRecursive (this=<value optimized out>, pdev=<value optimized out>, siblings=..., index=0, rgn=<value optimized out>, offset=<value optimized out>, flags=4, sharedPainter=0x0, backingStore=0x101d8d0) at kernel/qwidget.cpp:5677 #21 0x0000003c08225d94 in QWidgetPrivate::paintSiblingsRecursive (this=<value optimized out>, pdev=<value optimized out>, siblings=..., index=7, rgn=<value optimized out>, offset=<value optimized out>, flags=4, sharedPainter=0x0, backingStore=0x101d8d0) at kernel/qwidget.cpp:5664 #22 0x0000003c0822503b in QWidgetPrivate::drawWidget (this=0x10887a0, pdev=<value optimized out>, rgn=..., offset=<value optimized out>, flags=<value optimized out>, sharedPainter=0x0, backingStore=0x101d8d0) at kernel/qwidget.cpp:5523 #23 0x0000003c08225f63 in QWidgetPrivate::paintSiblingsRecursive (this=<value optimized out>, pdev=<value optimized out>, siblings=..., index=1, rgn=<value optimized out>, offset=<value optimized out>, flags=4, sharedPainter=0x0, backingStore=0x101d8d0) at kernel/qwidget.cpp:5677 #24 0x0000003c0822503b in QWidgetPrivate::drawWidget (this=0x1088240, pdev=<value optimized out>, rgn=..., offset=<value optimized out>, flags=<value optimized out>, sharedPainter=0x0, backingStore=0x101d8d0) at kernel/qwidget.cpp:5523 #25 0x0000003c08225f63 in QWidgetPrivate::paintSiblingsRecursive (this=<value optimized out>, pdev=<value optimized out>, siblings=..., index=5, rgn=<value optimized out>, offset=<value optimized out>, flags=4, sharedPainter=0x0, backingStore=0x101d8d0) at kernel/qwidget.cpp:5677 #26 0x0000003c0822503b in QWidgetPrivate::drawWidget (this=0x1053730, pdev=<value optimized out>, rgn=..., offset=<value optimized out>, flags=<value optimized out>, sharedPainter=0x0, backingStore=0x101d8d0) at kernel/qwidget.cpp:5523 #27 0x0000003c08225f63 in QWidgetPrivate::paintSiblingsRecursive (this=<value optimized out>, pdev=<value optimized out>, siblings=..., index=7, rgn=<value optimized out>, offset=<value optimized out>, flags=4, sharedPainter=0x0, backingStore=0x101d8d0) at kernel/qwidget.cpp:5677 #28 0x0000003c0822503b in QWidgetPrivate::drawWidget (this=0xe1c780, pdev=<value optimized out>, rgn=..., offset=<value optimized out>, flags=<value optimized out>, sharedPainter=0x0, backingStore=0x101d8d0) at kernel/qwidget.cpp:5523 #29 0x0000003c08225f63 in QWidgetPrivate::paintSiblingsRecursive (this=<value optimized out>, pdev=<value optimized out>, siblings=..., index=64, rgn=<value optimized out>, offset=<value optimized out>, flags=4, sharedPainter=0x0, backingStore=0x101d8d0) at kernel/qwidget.cpp:5677 #30 0x0000003c0822503b in QWidgetPrivate::drawWidget (this=0xb33d40, pdev=<value optimized out>, rgn=..., ---Type <return> to continue, or q <return> to quit--- offset=<value optimized out>, flags=<value optimized out>, sharedPainter=0x0, backingStore=0x101d8d0) at kernel/qwidget.cpp:5523 #31 0x0000003c083f4a9f in QWidgetBackingStore::sync (this=0x101d8d0) at painting/qbackingstore.cpp:1333 #32 0x0000003c082189c0 in QWidgetPrivate::syncBackingStore (this=0xb33d40) at kernel/qwidget.cpp:1820 #33 0x0000003c0821efaa in QWidget::event (this=0xb33bc0, event=0x33d0fc0) at kernel/qwidget.cpp:8530 #34 0x0000003c085fb50b in QMainWindow::event (this=0xb33bc0, event=0x33d0fc0) at widgets/qmainwindow.cpp:1480 #35 0x0000003c081c906c in QApplicationPrivate::notify_helper (this=0x762ce0, receiver=0xb33bc0, e=0x33d0fc0) at kernel/qapplication.cpp:4454 #36 0x0000003c081ce4ad in QApplication::notify (this=0x7fffffffbd90, receiver=0xb33bc0, e=0x33d0fc0) at kernel/qapplication.cpp:4333 #37 0x0000003c09848a76 in KApplication::notify (this=0x7fffffffbd90, receiver=0xb33bc0, event=0x33d0fc0) at /var/tmp/portage/kde-base/kdelibs-4.5.2/work/kdelibs-4.5.2/kdeui/kernel/kapplication.cpp:310 #38 0x0000003ebed6c8eb in QCoreApplication::notifyInternal (this=0x7fffffffbd90, receiver=0xb33bc0, event=0x33d0fc0) at kernel/qcoreapplication.cpp:732 #39 0x0000003ebed6f871 in sendEvent (receiver=0x0, event_type=<value optimized out>, data=0x61b880) at kernel/qcoreapplication.h:215 #40 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=<value optimized out>, data=0x61b880) at kernel/qcoreapplication.cpp:1373 #41 0x0000003ebed98e23 in sendPostedEvents (s=0x765120) at kernel/qcoreapplication.h:220 #42 postEventSourceDispatch (s=0x765120) at kernel/qeventdispatcher_glib.cpp:277 #43 0x000000327963e211 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 #44 0x0000003279642068 in ?? () from /usr/lib/libglib-2.0.so.0 #45 0x000000327964221c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0 #46 0x0000003ebed98963 in QEventDispatcherGlib::processEvents (this=0x75f280, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:415 #47 0x0000003c0827abde in QGuiEventDispatcherGlib::processEvents (this=0x7fffffff7de0, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:204 #48 0x0000003ebed6b642 in QEventLoop::processEvents (this=<value optimized out>, flags=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece or DW_OP_bit_piece. ) at kernel/qeventloop.cpp:149 #49 0x0000003ebed6ba24 in QEventLoop::exec (this=0x7fffffffbd30, flags=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece or DW_OP_bit_piece. ) at kernel/qeventloop.cpp:201 #50 0x0000003ebed6fa9b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1009 #51 0x000000000040b034 in main (argc=3, argv=0x7fffffffdd08) at /usr/src/amarok/src/main.cpp:237 Clint, thanks for the feedback, but the latest backtrace is another crash, bug 248640, so not related to the collection. Well it seems that with the sqlmeta thread safe patch I am unable to reproduce the original bug (so far, will continue testing). I am however encountering crashes while changing through my playlist, albeit instead of always crashing every <10 changes it's now more like _up to_ 30. Myriam if the crash above is related to bug 24860, well the circumstances reported by O.P can also include just skipping through an existing playlist for the local collection, I was not even adding anything new at the time just skipping tracks. I have another bt below, sorry I am not yet adept at finding the key info to tell if this is related, so please let me know if this requires it's own bug report. Same deal, just skipping slowly through my playlist. Program received signal SIGABRT, Aborted. [Switching to Thread 0x7fffb5d12710 (LWP 27551)] 0x0000003275632445 in raise () from /lib/libc.so.6 (gdb) bt #0 0x0000003275632445 in raise () from /lib/libc.so.6 #1 0x0000003275633860 in abort () from /lib/libc.so.6 #2 0x000000327566d76b in ?? () from /lib/libc.so.6 #3 0x0000003275672d36 in ?? () from /lib/libc.so.6 #4 0x0000003275677acc in free () from /lib/libc.so.6 #5 0x00007ffff2bc406b in input_SendEventMeta (p_input=0x3d3c7c0) at input/event.c:210 #6 0x00007ffff2bbf271 in EsOutMeta (out=<value optimized out>, i_query=<value optimized out>, args=<value optimized out>) at input/es_out.c:1423 #7 EsOutControlLocked (out=<value optimized out>, i_query=<value optimized out>, args=<value optimized out>) at input/es_out.c:2478 #8 EsOutControl (out=<value optimized out>, i_query=<value optimized out>, args=<value optimized out>) at input/es_out.c:2702 #9 0x00007ffff2bc211a in es_out_vaControl (out=0x5d00, i_query=27551) at ../include/vlc_es_out.h:126 #10 es_out_Control (out=0x5d00, i_query=27551) at ../include/vlc_es_out.h:135 #11 0x00007ffff2bc2c76 in ControlLocked (p_out=<value optimized out>, i_query=41860512, args=0x7fffb5d11b80) at input/es_out_timeshift.c:620 #12 Control (p_out=<value optimized out>, i_query=41860512, args=0x7fffb5d11b80) at input/es_out_timeshift.c:718 #13 0x00007ffff2bc4a0a in es_out_vaControl (out=0x5d00, i_query=27551) at ../include/vlc_es_out.h:126 #14 es_out_Control (out=0x5d00, i_query=27551) at ../include/vlc_es_out.h:135 #15 0x00007ffff2bc4ccb in es_out_ControlSetMeta (p_input=<value optimized out>, p_meta=0x27ebda0) at ../include/vlc_es_out.h:147 #16 InputUpdateMeta (p_input=<value optimized out>, p_meta=0x27ebda0) at input/input.c:2899 #17 0x00007ffff2bc79c3 in Init (p_input=0x3d3c7c0) at input/input.c:1294 #18 0x00007ffff2bcac25 in Run (p_this=<value optimized out>) at input/input.c:537 #19 0x00007ffff2bfb5a4 in thread_entry (data=<value optimized out>) at misc/threads.c:58 #20 0x0000003276206c1a in start_thread () from /lib/libpthread.so.0 #21 0x00000032756d1a9d in clone () from /lib/libc.so.6 (gdb) It seems like both fixes had their problems. 1. the EngineController fix is now updated and working. 2. the SqlMeta patch produced another crash and uncovered a systematic problem which I would like to address beforehand. The crash report is interesting, however I can't see Amarok involvement. However I can see vlc there. Maybe it would be worth to update vls if possible. |