Bug 254631

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/LocalAssignee: 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
Application: amarok (2.4-GIT)
KDE Platform Version: 4.5.2 (KDE 4.5.2) (Compiled from sources)
Qt Version: 4.7.1
Operating System: Linux 2.6.34-zen1 x86_64
Distribution (Platform): Gentoo Packages

-- Information about the crash:
- What I was doing when the application crashed:

Amarok (2.4GIT) crashes when either skipping next/previous track or selecting a song manually in the playlist.
This happens randomly anywhere between 1 to 15 track skips/changes from a fresh boot & fresh recompile of amarok & deps. 

The audio/mp3 files are on a local HDD, in an external mysql database. They are not corrupted, nor specifically created on any single PC's hardware
 and there is no pattern to any specific audio files having more trouble playing than any others.

Possibly related to me using the phonon-vlc (0.2.0) backend?

The crash can be reproduced every time.

-- Backtrace:
Application: Amarok (amarok), signal: Aborted
[Current thread is 1 (Thread 0x7f77abbdb7a0 (LWP 5779))]

Thread 14 (Thread 0x7f7781882710 (LWP 5781)):
#0  0x000000327620b59c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f77a62bf960 in LoopRequest (data=<value optimized out>) at playlist/thread.c:539
#2  Thread (data=<value optimized out>) at playlist/thread.c:586
#3  0x0000003276206c1a in start_thread () from /lib/libpthread.so.0
#4  0x00000032756d1a9d in clone () from /lib/libc.so.6

Thread 13 (Thread 0x7f7774846710 (LWP 5784)):
#0  0x000000327620b59c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f77aed3db7b in wait (this=<value optimized out>, mutex=0x2d02ea0, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:88
#2  QWaitCondition::wait (this=<value optimized out>, mutex=0x2d02ea0, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:160
#3  0x00007f77ad905c24 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x2d02b90, th=0x2d03390) at /var/tmp/portage/kde-base/kdelibs-4.5.2/work/kdelibs-4.5.2/threadweaver/Weaver/WeaverImpl.cpp:365
#4  0x00007f77ad908e0b in ThreadWeaver::WorkingHardState::applyForWork (this=0x2d02fc0, th=0x2d03390) at /var/tmp/portage/kde-base/kdelibs-4.5.2/work/kdelibs-4.5.2/threadweaver/Weaver/WorkingHardState.cpp:71
#5  0x00007f77ad90739f in ThreadWeaver::ThreadRunHelper::run (this=0x7f7774845df0, parent=0x2d02b90, th=0x2d03390) at /var/tmp/portage/kde-base/kdelibs-4.5.2/work/kdelibs-4.5.2/threadweaver/Weaver/Thread.cpp:87
#6  0x00007f77ad9078e8 in ThreadWeaver::Thread::run (this=0x2d03390) at /var/tmp/portage/kde-base/kdelibs-4.5.2/work/kdelibs-4.5.2/threadweaver/Weaver/Thread.cpp:142
#7  0x00007f77aed3cfbe in QThreadPrivate::start (arg=0x2d03390) at thread/qthread_unix.cpp:285
#8  0x0000003276206c1a in start_thread () from /lib/libpthread.so.0
#9  0x00000032756d1a9d in clone () from /lib/libc.so.6

Thread 12 (Thread 0x7f7773a12710 (LWP 5785)):
#0  0x000000327620b59c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00000034e46a24bd in ?? () from /usr/lib64/qt4/libQtWebKit.so.4
#2  0x00000034e46a25c9 in ?? () from /usr/lib64/qt4/libQtWebKit.so.4
#3  0x0000003276206c1a in start_thread () from /lib/libpthread.so.0
#4  0x00000032756d1a9d in clone () from /lib/libc.so.6

Thread 11 (Thread 0x7f7772670710 (LWP 5788)):
#0  0x000000327620b59c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f77aed3db7b in wait (this=<value optimized out>, mutex=0x2d02ea0, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:88
#2  QWaitCondition::wait (this=<value optimized out>, mutex=0x2d02ea0, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:160
#3  0x00007f77ad905c24 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x2d02b90, th=0x2dfd990) at /var/tmp/portage/kde-base/kdelibs-4.5.2/work/kdelibs-4.5.2/threadweaver/Weaver/WeaverImpl.cpp:365
#4  0x00007f77ad908e0b in ThreadWeaver::WorkingHardState::applyForWork (this=0x2d02fc0, th=0x2dfd990) at /var/tmp/portage/kde-base/kdelibs-4.5.2/work/kdelibs-4.5.2/threadweaver/Weaver/WorkingHardState.cpp:71
#5  0x00007f77ad90739f in ThreadWeaver::ThreadRunHelper::run (this=0x7f777266fdf0, parent=0x2d02b90, th=0x2dfd990) at /var/tmp/portage/kde-base/kdelibs-4.5.2/work/kdelibs-4.5.2/threadweaver/Weaver/Thread.cpp:87
#6  0x00007f77ad9078e8 in ThreadWeaver::Thread::run (this=0x2dfd990) at /var/tmp/portage/kde-base/kdelibs-4.5.2/work/kdelibs-4.5.2/threadweaver/Weaver/Thread.cpp:142
#7  0x00007f77aed3cfbe in QThreadPrivate::start (arg=0x2dfd990) at thread/qthread_unix.cpp:285
#8  0x0000003276206c1a in start_thread () from /lib/libpthread.so.0
#9  0x00000032756d1a9d in clone () from /lib/libc.so.6

Thread 10 (Thread 0x7f7771e6f710 (LWP 5789)):
#0  0x00000032756de6ae in ?? () from /lib/libc.so.6
#1  0x00000032756796d8 in ?? () from /lib/libc.so.6
#2  0x0000003275677ac1 in free () from /lib/libc.so.6
#3  0x00007f77aee5b609 in QEventDispatcherGlib::~QEventDispatcherGlib (this=0x2d15000, __in_chrg=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:392
#4  0x00007f77aed3c7d4 in QThreadPrivate::finish (arg=<value optimized out>) at thread/qthread_unix.cpp:321
#5  0x00007f77aed3cfc6 in ~__pthread_cleanup_class (arg=0x7f77af15ef60) at /usr/include/pthread.h:545
#6  QThreadPrivate::start (arg=0x7f77af15ef60) at thread/qthread_unix.cpp:290
#7  0x0000003276206c1a in start_thread () from /lib/libpthread.so.0
#8  0x00000032756d1a9d in clone () from /lib/libc.so.6

Thread 9 (Thread 0x7f777166e710 (LWP 5792)):
#0  0x000000327620b59c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f77aed3db7b in wait (this=<value optimized out>, mutex=0x2d02ea0, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:88
#2  QWaitCondition::wait (this=<value optimized out>, mutex=0x2d02ea0, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:160
#3  0x00007f77ad905c24 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x2d02b90, th=0x2beb110) at /var/tmp/portage/kde-base/kdelibs-4.5.2/work/kdelibs-4.5.2/threadweaver/Weaver/WeaverImpl.cpp:365
#4  0x00007f77ad908e0b in ThreadWeaver::WorkingHardState::applyForWork (this=0x2d02fc0, th=0x2beb110) at /var/tmp/portage/kde-base/kdelibs-4.5.2/work/kdelibs-4.5.2/threadweaver/Weaver/WorkingHardState.cpp:71
#5  0x00007f77ad90739f in ThreadWeaver::ThreadRunHelper::run (this=0x7f777166ddf0, parent=0x2d02b90, th=0x2beb110) at /var/tmp/portage/kde-base/kdelibs-4.5.2/work/kdelibs-4.5.2/threadweaver/Weaver/Thread.cpp:87
#6  0x00007f77ad9078e8 in ThreadWeaver::Thread::run (this=0x2beb110) at /var/tmp/portage/kde-base/kdelibs-4.5.2/work/kdelibs-4.5.2/threadweaver/Weaver/Thread.cpp:142
#7  0x00007f77aed3cfbe in QThreadPrivate::start (arg=0x2beb110) at thread/qthread_unix.cpp:285
#8  0x0000003276206c1a in start_thread () from /lib/libpthread.so.0
#9  0x00000032756d1a9d in clone () from /lib/libc.so.6

Thread 8 (Thread 0x7f7770e11710 (LWP 5793)):
#0  0x000000327620b59c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x0000003d11f96df4 in ?? () from /usr/lib64/qt4/libQtScript.so.4
#2  0x0000003d11f96e29 in ?? () from /usr/lib64/qt4/libQtScript.so.4
#3  0x0000003276206c1a in start_thread () from /lib/libpthread.so.0
#4  0x00000032756d1a9d in clone () from /lib/libc.so.6

Thread 7 (Thread 0x7f776ce7f710 (LWP 5797)):
#0  0x000000327620b59c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f77aed3db7b in wait (this=<value optimized out>, mutex=0x2d02ea0, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:88
#2  QWaitCondition::wait (this=<value optimized out>, mutex=0x2d02ea0, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:160
#3  0x00007f77ad905c24 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x2d02b90, th=0x2df6bd0) at /var/tmp/portage/kde-base/kdelibs-4.5.2/work/kdelibs-4.5.2/threadweaver/Weaver/WeaverImpl.cpp:365
#4  0x00007f77ad908e0b in ThreadWeaver::WorkingHardState::applyForWork (this=0x2d02fc0, th=0x2df6bd0) at /var/tmp/portage/kde-base/kdelibs-4.5.2/work/kdelibs-4.5.2/threadweaver/Weaver/WorkingHardState.cpp:71
#5  0x00007f77ad90739f in ThreadWeaver::ThreadRunHelper::run (this=0x7f776ce7edf0, parent=0x2d02b90, th=0x2df6bd0) at /var/tmp/portage/kde-base/kdelibs-4.5.2/work/kdelibs-4.5.2/threadweaver/Weaver/Thread.cpp:87
#6  0x00007f77ad9078e8 in ThreadWeaver::Thread::run (this=0x2df6bd0) at /var/tmp/portage/kde-base/kdelibs-4.5.2/work/kdelibs-4.5.2/threadweaver/Weaver/Thread.cpp:142
#7  0x00007f77aed3cfbe in QThreadPrivate::start (arg=0x2df6bd0) at thread/qthread_unix.cpp:285
#8  0x0000003276206c1a in start_thread () from /lib/libpthread.so.0
#9  0x00000032756d1a9d in clone () from /lib/libc.so.6

Thread 6 (Thread 0x7f776ba64710 (LWP 5805)):
#0  0x00000032756de6ae in ?? () from /lib/libc.so.6
#1  0x00000032756796d8 in ?? () from /lib/libc.so.6
#2  0x0000003275677ac1 in free () from /lib/libc.so.6
#3  0x000000327963db09 in ?? () from /usr/lib/libglib-2.0.so.0
#4  0x00007f77aee5b503 in QEventDispatcherGlib::~QEventDispatcherGlib (this=0x2eba360, __in_chrg=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:369
#5  0x00007f77aed3c7d4 in QThreadPrivate::finish (arg=<value optimized out>) at thread/qthread_unix.cpp:321
#6  0x00007f77aed3cfc6 in ~__pthread_cleanup_class (arg=0x2df8f80) at /usr/include/pthread.h:545
#7  QThreadPrivate::start (arg=0x2df8f80) at thread/qthread_unix.cpp:290
#8  0x0000003276206c1a in start_thread () from /lib/libpthread.so.0
#9  0x00000032756d1a9d in clone () from /lib/libc.so.6

Thread 5 (Thread 0x7f776a5bf710 (LWP 5870)):
#0  0x00000032756de6ae in ?? () from /lib/libc.so.6
#1  0x00000032756796d8 in ?? () from /lib/libc.so.6
#2  0x0000003275677ac1 in free () from /lib/libc.so.6
#3  0x00007f77aee5b609 in QEventDispatcherGlib::~QEventDispatcherGlib (this=0x3cc2660, __in_chrg=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:392
#4  0x00007f77aed3c7d4 in QThreadPrivate::finish (arg=<value optimized out>) at thread/qthread_unix.cpp:321
#5  0x00007f77aed3cfc6 in ~__pthread_cleanup_class (arg=0x3d26310) at /usr/include/pthread.h:545
#6  QThreadPrivate::start (arg=0x3d26310) at thread/qthread_unix.cpp:290
#7  0x0000003276206c1a in start_thread () from /lib/libpthread.so.0
#8  0x00000032756d1a9d in clone () from /lib/libc.so.6

Thread 4 (Thread 0x7f7781781710 (LWP 6045)):
#0  0x00000032756de6ae in ?? () from /lib/libc.so.6
#1  0x00000032756796d8 in ?? () from /lib/libc.so.6
#2  0x0000003275677ac1 in free () from /lib/libc.so.6
#3  0x00007f77a67889ed in ?? () from /usr/lib64/kde4/plugins/phonon_backend/phonon_vlc.so
#4  0x00007f77a678cb48 in ?? () from /usr/lib64/kde4/plugins/phonon_backend/phonon_vlc.so
#5  0x00007f77a655dde7 in libvlc_event_send (p_em=0x26d33e0, p_event=0x7f7781780b80) at control/event.c:216
#6  0x00007f77a6560e45 in input_event_changed (p_this=0x4343b00, psz_cmd=<value optimized out>, oldval=<value optimized out>, newval=<value optimized out>, p_userdata=<value optimized out>) at control/media_player.c:280
#7  0x00007f77a631f02c in TriggerCallback (p_this=0x4343b00, p_var=0x2d3d880, psz_name=0x7f77a632fc1b "intf-event", oldval=...) at misc/variables.c:1366
#8  0x00007f77a631f92d in var_SetChecked (p_this=0x4343b00, psz_name=0x7f77a632fc1b "intf-event", expected_type=<value optimized out>, val=...) at misc/variables.c:787
#9  0x00007f77a62dacec in input_SendEventState (p_input=0x4343b00, i_state=<value optimized out>) at input/event.c:185
#10 0x00007f77a62e16b4 in MainLoop (p_input=0x4343b00, b_interactive=<value optimized out>) at input/input.c:842
#11 0x00007f77a62e1c95 in Run (p_this=<value optimized out>) at input/input.c:540
#12 0x00007f77a63125a4 in thread_entry (data=<value optimized out>) at misc/threads.c:58
#13 0x0000003276206c1a in start_thread () from /lib/libpthread.so.0
#14 0x00000032756d1a9d in clone () from /lib/libc.so.6

Thread 3 (Thread 0x7f776b263710 (LWP 6046)):
#0  0x000000327620b59c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f77a630aaf6 in block_FifoGet (p_fifo=<value optimized out>) at misc/block.c:625
#2  0x00007f77a62d0b75 in DecoderThread (p_this=<value optimized out>) at input/decoder.c:879
#3  0x00007f77a63125a4 in thread_entry (data=<value optimized out>) at misc/threads.c:58
#4  0x0000003276206c1a in start_thread () from /lib/libpthread.so.0
#5  0x00000032756d1a9d in clone () from /lib/libc.so.6

Thread 2 (Thread 0x7f776ac3c710 (LWP 6047)):
#0  0x00000032756c8d03 in poll () from /lib/libc.so.6
#1  0x00007f778716c005 in ALSAFill (p_aout=<value optimized out>) at alsa.c:881
#2  0x00007f778716c2f9 in ALSAThread (data=<value optimized out>) at alsa.c:781
#3  0x0000003276206c1a in start_thread () from /lib/libpthread.so.0
#4  0x00000032756d1a9d in clone () from /lib/libc.so.6

Thread 1 (Thread 0x7f77abbdb7a0 (LWP 5779)):
[KCrash Handler]
#6  0x0000003275632445 in raise () from /lib/libc.so.6
#7  0x0000003275633860 in abort () from /lib/libc.so.6
#8  0x000000327566d76b in ?? () from /lib/libc.so.6
#9  0x0000003275672d36 in ?? () from /lib/libc.so.6
#10 0x0000003275676655 in ?? () from /lib/libc.so.6
#11 0x0000003275677bb0 in malloc () from /lib/libc.so.6
#12 0x00007f77aed5d270 in _qdtoa (d=<value optimized out>, mode=<value optimized out>, ndigits=6, decpt=<value optimized out>, sign=<value optimized out>, rve=0x7fff3a788d98, resultp=0x7fff3a788d90) at tools/qlocale.cpp:6877
#13 qdtoa (d=<value optimized out>, mode=<value optimized out>, ndigits=6, decpt=<value optimized out>, sign=<value optimized out>, rve=0x7fff3a788d98, resultp=0x7fff3a788d90) at tools/qlocale.cpp:6645
#14 0x00007f77aed66626 in QLocalePrivate::doubleToString (this=0x7f77aeeb9680, d=<value optimized out>, precision=<value optimized out>, form=<value optimized out>, width=<value optimized out>, flags=<value optimized out>) at tools/qlocale.cpp:4014
#15 0x00007f77aed878ba in QString::setNum (this=0x7fff3a788fc0, n=<value optimized out>, f=<value optimized out>, prec=6) at tools/qstring.cpp:5930
#16 0x00007f77aed87951 in QString::number (n=0, f=-109 '\223', prec=6) at tools/qstring.cpp:6034
#17 0x00007f7780bcd5b5 in Meta::SqlTrack::updateStatisticsInDb (this=0x2a6bff0, fields=...) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/core-impl/collections/sqlcollection/SqlMeta.cpp:775
#18 0x00007f7780bd43d4 in Meta::SqlTrack::commitMetaDataChanges (this=0x2a6bff0) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/core-impl/collections/sqlcollection/SqlMeta.cpp:658
#19 0x00007f7780bd6019 in Meta::SqlTrack::endMetaDataUpdate (this=0x1693) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/core-impl/collections/sqlcollection/SqlMeta.cpp:509
#20 0x00007f7780bd1a83 in Meta::SqlTrack::finishedPlaying (this=0x2a6bff0, playedFraction=<value optimized out>) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/core-impl/collections/sqlcollection/SqlMeta.cpp:816
#21 0x00007f77b0539b27 in Playlist::Actions::play (this=<value optimized out>, trackid=<value optimized out>, now=<value optimized out>) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/playlist/PlaylistActions.cpp:229
#22 0x00007f77b0539ecf in Playlist::Actions::play (this=0x2951af0, index=...) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/playlist/PlaylistActions.cpp:197
#23 0x00007f77b05e636c in Playlist::PrettyListView::trackActivated (this=0x2c1f3d0, idx=...) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/playlist/view/listview/PrettyListView.cpp:293
#24 0x00007f77b05e7b0a in Playlist::PrettyListView::qt_metacall (this=0x2c1f3d0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff3a789900) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999_build/src/PrettyListView.moc:148
#25 0x00007f77aee4655f in QMetaObject::activate (sender=0x2c1f3d0, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0xffffffffffffffff) at kernel/qobject.cpp:3278
#26 0x00007f77afd463f5 in QAbstractItemView::doubleClicked (this=0x1693, _t1=<value optimized out>) at .moc/release-shared/moc_qabstractitemview.cpp:338
#27 0x00007f77afd48fa2 in QAbstractItemView::mouseDoubleClickEvent (this=0x2c1f3d0, event=0x7fff3a78a7f0) at itemviews/qabstractitemview.cpp:1821
#28 0x00007f77af863941 in QWidget::event (this=0x2c1f3d0, event=0x7fff3a78a7f0) at kernel/qwidget.cpp:8241
#29 0x00007f77afc247b6 in QFrame::event (this=0x2c1f3d0, e=0x7fff3a78a7f0) at widgets/qframe.cpp:557
#30 0x00007f77afd5668b in QAbstractItemView::viewportEvent (this=0x2c1f3d0, event=0x7fff3a78a7f0) at itemviews/qabstractitemview.cpp:1619
#31 0x00007f77aee2e136 in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=<value optimized out>, receiver=0x2c1e470, event=0x7fff3a78a7f0) at kernel/qcoreapplication.cpp:847
#32 0x00007f77af80e03c in QApplicationPrivate::notify_helper (this=0x22fe860, receiver=0x2c1e470, e=0x7fff3a78a7f0) at kernel/qapplication.cpp:4450
#33 0x00007f77af813ceb in QApplication::notify (this=0x7fff3a78b310, receiver=0x2c1e470, e=0x7fff3a78a7f0) at kernel/qapplication.cpp:4015
#34 0x00007f77b1192a76 in KApplication::notify (this=0x7fff3a78b310, receiver=0x2c1e470, event=0x7fff3a78a7f0) at /var/tmp/portage/kde-base/kdelibs-4.5.2/work/kdelibs-4.5.2/kdeui/kernel/kapplication.cpp:310
#35 0x00007f77aee2e8eb in QCoreApplication::notifyInternal (this=0x7fff3a78b310, receiver=0x2c1e470, event=0x7fff3a78a7f0) at kernel/qcoreapplication.cpp:732
#36 0x00007f77af812552 in sendEvent (receiver=0x2c1e470, event=0x7fff3a78a7f0, alienWidget=0x2c1e470, nativeWidget=0x2a0bbe0, buttonDown=<value optimized out>, lastMouseReceiver=<value optimized out>, spontaneous=true) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#37 QApplicationPrivate::sendMouseEvent (receiver=0x2c1e470, event=0x7fff3a78a7f0, alienWidget=0x2c1e470, nativeWidget=0x2a0bbe0, buttonDown=<value optimized out>, lastMouseReceiver=<value optimized out>, spontaneous=true) at kernel/qapplication.cpp:3114
#38 0x00007f77af896d34 in QETWidget::translateMouseEvent (this=0x2a0bbe0, event=<value optimized out>) at kernel/qapplication_x11.cpp:4437
#39 0x00007f77af895d2a in QApplication::x11ProcessEvent (this=<value optimized out>, event=0x7fff3a78af70) at kernel/qapplication_x11.cpp:3563
#40 0x00007f77af8c0262 in x11EventSourceDispatch (s=0x22fa3c0, callback=<value optimized out>, user_data=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:146
#41 0x000000327963e211 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#42 0x0000003279642068 in ?? () from /usr/lib/libglib-2.0.so.0
#43 0x000000327964221c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#44 0x00007f77aee5a963 in QEventDispatcherGlib::processEvents (this=0x2303210, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:415
#45 0x00007f77af8bfbde in QGuiEventDispatcherGlib::processEvents (this=0x1693, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#46 0x00007f77aee2d642 in QEventLoop::processEvents (this=<value optimized out>, flags=) at kernel/qeventloop.cpp:149
#47 0x00007f77aee2da24 in QEventLoop::exec (this=0x7fff3a78b290, flags=) at kernel/qeventloop.cpp:201
#48 0x00007f77aee31a9b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1009
#49 0x00000000004086c1 in main (argc=<value optimized out>, argv=<value optimized out>) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/main.cpp:237

Reported using DrKonqi
Comment 1 Clint 2010-10-19 10:34:57 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.
Comment 2 Myriam Schweingruber 2010-10-19 11:50:38 UTC
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.
Comment 3 Ralf Engels 2010-10-19 14:29:32 UTC
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.
Comment 4 Clint 2010-10-20 14:06:25 UTC
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 :)
Comment 5 Ralf Engels 2010-10-20 17:59:14 UTC
Ok.
I will make a separate patch for the threading safety, which you can try out.

Let's see if that really helps.
Comment 6 Jeff Mitchell 2010-10-20 22:17:33 UTC
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?
Comment 7 Ralf Engels 2010-10-21 11:29:27 UTC
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.
Comment 8 Ralf Engels 2010-10-22 02:30:47 UTC
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.
Comment 9 Ralf Engels 2010-10-22 15:46:00 UTC
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.
Comment 10 Jeff Mitchell 2010-10-22 21:13:02 UTC
Hopefully both do, and we can take our pick as to which is the proper fix.  :-)
Comment 11 Clint 2010-10-24 10:12:06 UTC
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
Comment 12 Myriam Schweingruber 2010-10-24 13:33:11 UTC
Clint, thanks for the feedback, but the latest backtrace is another crash, bug 248640, so not related to the collection.
Comment 13 Clint 2010-10-25 01:18:41 UTC
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)
Comment 14 Ralf Engels 2010-10-25 13:27:56 UTC
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.