Bug 220532 - Amarok crashes when doing full collection scan with local mysql server (amarok git)
Summary: Amarok crashes when doing full collection scan with local mysql server (amaro...
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Local (show other bugs)
Version: 2.3-GIT
Platform: Compiled Sources Linux
: VHI crash
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 220422 221106 221225 221674 222440 222528 222857 222874 225207 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-12-29 15:13 UTC by Jussi Kekkonen
Modified: 2010-09-17 11:34 UTC (History)
17 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.3.0


Attachments
New crash information added by DrKonqi (22.54 KB, text/plain)
2010-01-01 20:32 UTC, Dmitry Suzdalev
Details
DrKonqi output and --debug output (628.42 KB, text/plain)
2010-01-05 19:42 UTC, hyper_ch
Details
Full logs for all three cases (85.17 KB, application/octet-stream)
2010-01-05 22:14 UTC, Marian Kyral
Details
Patch against 2.2.2 tag (8.42 KB, patch)
2010-01-08 04:11 UTC, Jeff Mitchell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jussi Kekkonen 2009-12-29 15:13:41 UTC
Application: amarok (2.2-GIT)
KDE Platform Version: 4.3.85 (KDE 4.3.85 (KDE 4.4 Beta2)) (Compiled from sources)
Qt Version: 4.6.0
Operating System: Linux 2.6.27-16-generic i686
Distribution: Ubuntu 8.10

-- Information about the crash:
master git branch, commit 8a76495636f3b64fa63bf8d2015c86e36fae33c3   Date:   Tue Dec 29 03:20:10 2009 -0800

tested couple times, with mysql 5.0.67, amarok crashes when scan is near complete

trace in konsole is:

TagLib: MPEG::Header::parse() -- Invalid sample rate.
TagLib: MPEG::Header::parse() -- Invalid sample rate.
amarok:    Success. Committing result to database. 
amarok:   BEGIN: void DatabaseUpdater::cleanPermanentTables() 
amarok:   END__: void DatabaseUpdater::cleanPermanentTables() - Took 0.0026s 
amarok:   BEGIN: void ScanResultProcessor::copyHashesToTempTables() 
amarok:      obtained max_allowed_packet is  "16777216" 
amarok:      urls key size is  2997 
amarok:     BEGIN: void ScanManager::slotFinished() 
amarok:     END__: void ScanManager::slotFinished() - Took 0.00017s 
amarok:      tracks key size is  2997 
amarok:   END__: void ScanResultProcessor::copyHashesToTempTables() - Took 1s 
amarok:    temp_tracks:  ("2997") 
amarok:    tracks before commit:  ("0") 
amarok:   BEGIN: void DatabaseUpdater::copyToPermanentTables() 
amarok:      [ERROR!] GREPME MySQL query failed! Column count doesn't match value count at row 1  on  "INSERT INTO images SELECT * FROM images_temp;" 
amarok:      [ERROR!] GREPME MySQL query failed! Column count doesn't match value count at row 1  on  "INSERT INTO directories SELECT * FROM directories_temp;" 
amarok:     BEGIN: virtual void Dynamic::BiasedPlaylist::invalidate() 
amarok:     END__: virtual void Dynamic::BiasedPlaylist::invalidate() - Took 0.00027s 
amarok:   END__: void DatabaseUpdater::copyToPermanentTables() - Took 0.6s 
amarok:    tracks after commit:  ("2997") 
amarok:   BEGIN: void DatabaseUpdater::removeTemporaryTables() 
amarok:   END__: void DatabaseUpdater::removeTemporaryTables() - Took 0.075s 
amarok:    Sending changed signal 
amarok:   BEGIN: virtual void Dynamic::BiasedPlaylist::invalidate() 
amarok:   END__: virtual void Dynamic::BiasedPlaylist::invalidate() - Took 8.2e-05s 
QSocketNotifier: Invalid socket 27 and type 'Read', disabling...
QSocketNotifier: Invalid socket 26 and type 'Read', disabling...
QSocketNotifier: Invalid socket 51 and type 'Read', disabling...
KCrash: Application 'amarok' crashing...


The crash can be reproduced every time.

 -- Backtrace:
Application: Amarok (amarok), signal: Aborted
[Current thread is 0 (LWP 13402)]

Thread 20 (Thread 0xb08ddb90 (LWP 13403)):
#0  0xb7fed430 in __kernel_vsyscall ()
#1  0xb60a23a2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb64cac14 in pthread_cond_timedwait () from /lib/tls/i686/cmov/libc.so.6
#3  0xb116067f in ?? () from /usr/lib/libxine.so.1

Thread 19 (Thread 0xb0021b90 (LWP 13404)):
#0  0xb44f954a in clock_gettime () from /lib/tls/i686/cmov/librt.so.1
#1  0xb708ab4b in qt_gettime () at kernel/qcore_unix.cpp:109
#2  0xb708f78b in QTimerInfoList::updateCurrentTime (this=0xa218774) at kernel/qeventdispatcher_unix.cpp:340
#3  0xb708f7da in QTimerInfoList::timerWait (this=0xa218774, tm=@0xb00210d8) at kernel/qeventdispatcher_unix.cpp:443
#4  0xb708d700 in timerSourcePrepareHelper (src=0xb0021048, timeout=0xb0021128) at kernel/qeventdispatcher_glib.cpp:136
#5  0xb447a622 in g_main_context_prepare () from /usr/lib/libglib-2.0.so.0
#6  0xb447aaaa in ?? () from /usr/lib/libglib-2.0.so.0
#7  0xb447af81 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#8  0xb708d4df in QEventDispatcherGlib::processEvents (this=0xa1c66b0, flags={i = -1342041576}) at kernel/qeventdispatcher_glib.cpp:409
#9  0xb7063baa in QEventLoop::processEvents (this=0xb002127c, flags={i = -1342041512}) at kernel/qeventloop.cpp:149
#10 0xb7063d72 in QEventLoop::exec (this=0xb002127c, flags={i = -1342041468}) at kernel/qeventloop.cpp:197
#11 0xb6f720e4 in QThread::exec (this=0xa08ef10) at thread/qthread.cpp:487
#12 0xb11b0dca in Phonon::Xine::XineThread::run (this=0xa08ef10) at /home/kde4/src/KDE/kdesupport/phonon/xine/xinethread.cpp:143
#13 0xb6f742b3 in QThreadPrivate::start (arg=0xa08ef10) at thread/qthread_unix.cpp:244
#14 0xb609e50f in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#15 0xb64bca0e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 18 (Thread 0xaf820b90 (LWP 13407)):
#0  0xb609fa3c in pthread_mutex_lock () from /lib/tls/i686/cmov/libpthread.so.0
#1  0xb64cad86 in pthread_mutex_lock () from /lib/tls/i686/cmov/libc.so.6
#2  0xb00d6fc9 in ?? () from /usr/lib/xine/plugins/1.24/xineplug_ao_out_alsa.so
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Thread 17 (Thread 0xaeffeb90 (LWP 13408)):
#0  0xb7fed430 in __kernel_vsyscall ()
#1  0xb60a2075 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb64cabbd in pthread_cond_wait () from /lib/tls/i686/cmov/libc.so.6
#3  0xb1172853 in ?? () from /usr/lib/libxine.so.1
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Thread 16 (Thread 0xae7b3b90 (LWP 13409)):
#0  0xb7fed430 in __kernel_vsyscall ()
#1  0xb60a2075 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb64cabbd in pthread_cond_wait () from /lib/tls/i686/cmov/libc.so.6
#3  0xb1172853 in ?? () from /usr/lib/libxine.so.1
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Thread 15 (Thread 0xadf70b90 (LWP 13410)):
#0  0xb7fed430 in __kernel_vsyscall ()
#1  0xb60a2075 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb64cabbd in pthread_cond_wait () from /lib/tls/i686/cmov/libc.so.6
#3  0xb1172853 in ?? () from /usr/lib/libxine.so.1
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Thread 14 (Thread 0xad72db90 (LWP 13411)):
#0  0xb7fed430 in __kernel_vsyscall ()
#1  0xb60a2075 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb64cabbd in pthread_cond_wait () from /lib/tls/i686/cmov/libc.so.6
#3  0xb1172853 in ?? () from /usr/lib/libxine.so.1
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

Thread 13 (Thread 0xac5c4b90 (LWP 13412)):
#0  0xb7fed430 in __kernel_vsyscall ()
#1  0xb60a2075 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb64cabbd in pthread_cond_wait () from /lib/tls/i686/cmov/libc.so.6
#3  0xb4da1b61 in WTF::TCMalloc_PageHeap::scavengerThread () from /home/media/qt/kde-qt/lib/libQtWebKit.so.4
#4  0xb4da1b91 in WTF::TCMalloc_PageHeap::runScavengerThread () from /home/media/qt/kde-qt/lib/libQtWebKit.so.4
#5  0xb609e50f in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#6  0xb64bca0e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 12 (Thread 0xabc01b90 (LWP 13413)):
#0  0xb7fed430 in __kernel_vsyscall ()
#1  0xb60a2075 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb64cabbd in pthread_cond_wait () from /lib/tls/i686/cmov/libc.so.6
#3  0xb6f75272 in QWaitCondition::wait (this=0xa8960c0, mutex=0xa93eb28, time=4294967295) at thread/qwaitcondition_unix.cpp:87
#4  0xb5f83878 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0xa8960a8, th=0xa8ec9b8) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/WeaverImpl.cpp:365
#5  0xb5f8668c in ThreadWeaver::WorkingHardState::waitForAvailableJob (this=0xaa40a20, th=0xa8ec9b8) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/WorkingHardState.cpp:80
#6  0xb5f822eb in ThreadWeaver::WeaverImpl::waitForAvailableJob (this=0xa8960a8, th=0xa8ec9b8) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/WeaverImpl.cpp:356
#7  0xb5f8678a in ThreadWeaver::WorkingHardState::applyForWork (this=0xaa40a20, th=0xa8ec9b8) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/WorkingHardState.cpp:71
#8  0xb5f83503 in ThreadWeaver::WeaverImpl::applyForWork (this=0xa8960a8, th=0xa8ec9b8, previous=0xbf75858) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/WeaverImpl.cpp:351
#9  0xb5f8464e in ThreadWeaver::ThreadRunHelper::run (this=0xabc012d0, parent=0xa8960a8, th=0xa8ec9b8) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/Thread.cpp:87
#10 0xb5f84c8b in ThreadWeaver::Thread::run (this=0xa8ec9b8) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/Thread.cpp:142
#11 0xb6f742b3 in QThreadPrivate::start (arg=0xa8ec9b8) at thread/qthread_unix.cpp:244
#12 0xb609e50f in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#13 0xb64bca0e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 11 (Thread 0xab400b90 (LWP 13414)):
#0  0xb7fed430 in __kernel_vsyscall ()
#1  0xb60a2075 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb64cabbd in pthread_cond_wait () from /lib/tls/i686/cmov/libc.so.6
#3  0xb6f75272 in QWaitCondition::wait (this=0xa8960c0, mutex=0xa93eb28, time=4294967295) at thread/qwaitcondition_unix.cpp:87
#4  0xb5f83878 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0xa8960a8, th=0xaaad238) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/WeaverImpl.cpp:365
#5  0xb5f8668c in ThreadWeaver::WorkingHardState::waitForAvailableJob (this=0xaa40a20, th=0xaaad238) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/WorkingHardState.cpp:80
#6  0xb5f822eb in ThreadWeaver::WeaverImpl::waitForAvailableJob (this=0xa8960a8, th=0xaaad238) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/WeaverImpl.cpp:356
#7  0xb5f8678a in ThreadWeaver::WorkingHardState::applyForWork (this=0xaa40a20, th=0xaaad238) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/WorkingHardState.cpp:71
#8  0xb5f83503 in ThreadWeaver::WeaverImpl::applyForWork (this=0xa8960a8, th=0xaaad238, previous=0xbf75db0) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/WeaverImpl.cpp:351
#9  0xb5f8464e in ThreadWeaver::ThreadRunHelper::run (this=0xab4002d0, parent=0xa8960a8, th=0xaaad238) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/Thread.cpp:87
#10 0xb5f84c8b in ThreadWeaver::Thread::run (this=0xaaad238) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/Thread.cpp:142
#11 0xb6f742b3 in QThreadPrivate::start (arg=0xaaad238) at thread/qthread_unix.cpp:244
#12 0xb609e50f in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#13 0xb64bca0e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 10 (Thread 0xaabffb90 (LWP 13416)):
[KCrash Handler]
#6  0xb7fed430 in __kernel_vsyscall ()
#7  0xb64068a0 in raise () from /lib/tls/i686/cmov/libc.so.6
#8  0xb6408268 in abort () from /lib/tls/i686/cmov/libc.so.6
#9  0xb644a483 in ?? () from /lib/tls/i686/cmov/libc.so.6
#10 0xb644c455 in free () from /lib/tls/i686/cmov/libc.so.6
#11 0xb66010b1 in operator delete () from /usr/lib/libstdc++.so.6
#12 0xacdffb36 in ~ScanResultProcessor (this=0xaabfec14) at /home/kde4/src/KDE/multimedia/amarok/src/collection/sqlcollection/ScanResultProcessor.cpp:46
#13 0xacdfaa1c in XmlParseJob::run (this=0xb922fc0) at /home/kde4/src/KDE/multimedia/amarok/src/collection/sqlcollection/ScanManager.cpp:855
#14 0xb5f856c4 in ThreadWeaver::JobRunHelper::runTheJob (this=0xaabff268, th=0xabd5530, job=0xb922fc0) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/Job.cpp:106
#15 0xb5f85a69 in ThreadWeaver::Job::execute (this=0xb922fc0, th=0xabd5530) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/Job.cpp:135
#16 0xb5f8461a in ThreadWeaver::ThreadRunHelper::run (this=0xaabff2d0, parent=0xa8960a8, th=0xabd5530) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/Thread.cpp:95
#17 0xb5f84c8b in ThreadWeaver::Thread::run (this=0xabd5530) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/Thread.cpp:142
#18 0xb6f742b3 in QThreadPrivate::start (arg=0xabd5530) at thread/qthread_unix.cpp:244
#19 0xb609e50f in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#20 0xb64bca0e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 9 (Thread 0xa9bbdb90 (LWP 13418)):
#0  0xb7fed430 in __kernel_vsyscall ()
#1  0xb60a2075 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb64cabbd in pthread_cond_wait () from /lib/tls/i686/cmov/libc.so.6
#3  0xb6f75272 in QWaitCondition::wait (this=0xa8960c0, mutex=0xa93eb28, time=4294967295) at thread/qwaitcondition_unix.cpp:87
#4  0xb5f83878 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0xa8960a8, th=0xac273b0) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/WeaverImpl.cpp:365
#5  0xb5f8668c in ThreadWeaver::WorkingHardState::waitForAvailableJob (this=0xaa40a20, th=0xac273b0) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/WorkingHardState.cpp:80
#6  0xb5f822eb in ThreadWeaver::WeaverImpl::waitForAvailableJob (this=0xa8960a8, th=0xac273b0) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/WeaverImpl.cpp:356
#7  0xb5f8678a in ThreadWeaver::WorkingHardState::applyForWork (this=0xaa40a20, th=0xac273b0) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/WorkingHardState.cpp:71
#8  0xb5f83503 in ThreadWeaver::WeaverImpl::applyForWork (this=0xa8960a8, th=0xac273b0, previous=0x0) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/WeaverImpl.cpp:351
#9  0xb5f867a9 in ThreadWeaver::WorkingHardState::applyForWork (this=0xaa40a20, th=0xac273b0) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/WorkingHardState.cpp:74
#10 0xb5f83503 in ThreadWeaver::WeaverImpl::applyForWork (this=0xa8960a8, th=0xac273b0, previous=0xb9306a8) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/WeaverImpl.cpp:351
#11 0xb5f8464e in ThreadWeaver::ThreadRunHelper::run (this=0xa9bbd2d0, parent=0xa8960a8, th=0xac273b0) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/Thread.cpp:87
#12 0xb5f84c8b in ThreadWeaver::Thread::run (this=0xac273b0) at /home/kde4/src/KDE/kdelibs/threadweaver/Weaver/Thread.cpp:142
#13 0xb6f742b3 in QThreadPrivate::start (arg=0xac273b0) at thread/qthread_unix.cpp:244
#14 0xb609e50f in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#15 0xb64bca0e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 8 (Thread 0x9ec2cb90 (LWP 13431)):
#0  0xb7fed430 in __kernel_vsyscall ()
#1  0xb60a2075 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb64cabbd in pthread_cond_wait () from /lib/tls/i686/cmov/libc.so.6
#3  0xb5aa4e51 in WTF::TCMalloc_PageHeap::scavengerThread (this=0xb5b36160) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:2304
#4  0xb5aa4e81 in WTF::TCMalloc_PageHeap::runScavengerThread (context=0xb5b36160) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1438
#5  0xb609e50f in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#6  0xb64bca0e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 7 (Thread 0x9f460b90 (LWP 13433)):
#0  0xb7fed430 in __kernel_vsyscall ()
#1  0xb60a2075 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb64cabbd in pthread_cond_wait () from /lib/tls/i686/cmov/libc.so.6
#3  0xb6f75272 in QWaitCondition::wait (this=0xb3103c0, mutex=0xb3103bc, time=4294967295) at thread/qwaitcondition_unix.cpp:87
#4  0xb6ca1a9a in QFileInfoGatherer::run (this=0xb3103b4) at dialogs/qfileinfogatherer.cpp:203
#5  0xb6f742b3 in QThreadPrivate::start (arg=0xb3103b4) at thread/qthread_unix.cpp:244
#6  0xb609e50f in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#7  0xb64bca0e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 6 (Thread 0x9bf3fb90 (LWP 13434)):
#0  0xb447a649 in g_main_context_prepare () from /usr/lib/libglib-2.0.so.0
#1  0xb447aaaa in ?? () from /usr/lib/libglib-2.0.so.0
#2  0xb447af81 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0xb708d4df in QEventDispatcherGlib::processEvents (this=0xac3d058, flags={i = -1678511592}) at kernel/qeventdispatcher_glib.cpp:409
#4  0xb7063baa in QEventLoop::processEvents (this=0x9bf3f27c, flags={i = -1678511528}) at kernel/qeventloop.cpp:149
#5  0xb7063d72 in QEventLoop::exec (this=0x9bf3f27c, flags={i = -1678511484}) at kernel/qeventloop.cpp:197
#6  0xb6f720e4 in QThread::exec (this=0xb310ee8) at thread/qthread.cpp:487
#7  0xb704831b in QInotifyFileSystemWatcherEngine::run (this=0xb310ee8) at io/qfilesystemwatcher_inotify.cpp:248
#8  0xb6f742b3 in QThreadPrivate::start (arg=0xb310ee8) at thread/qthread_unix.cpp:244
#9  0xb609e50f in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#10 0xb64bca0e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 5 (Thread 0x9866fb90 (LWP 13444)):
#0  0xb7fed430 in __kernel_vsyscall ()
#1  0xb60a2075 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb64cabbd in pthread_cond_wait () from /lib/tls/i686/cmov/libc.so.6
#3  0xb6f75272 in QWaitCondition::wait (this=0xa166e00, mutex=0xa166dfc, time=4294967295) at thread/qwaitcondition_unix.cpp:87
#4  0xb6ca1a9a in QFileInfoGatherer::run (this=0xa166df4) at dialogs/qfileinfogatherer.cpp:203
#5  0xb6f742b3 in QThreadPrivate::start (arg=0xa166df4) at thread/qthread_unix.cpp:244
#6  0xb609e50f in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#7  0xb64bca0e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 4 (Thread 0x97e6eb90 (LWP 13445)):
#0  postEventSourceCheck (source=0xa190108) at kernel/qeventdispatcher_glib.cpp:267
#1  0xb447a328 in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#2  0xb447acad in ?? () from /usr/lib/libglib-2.0.so.0
#3  0xb447af81 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#4  0xb708d4df in QEventDispatcherGlib::processEvents (this=0xb81b648, flags={i = -1746476520}) at kernel/qeventdispatcher_glib.cpp:409
#5  0xb7063baa in QEventLoop::processEvents (this=0x97e6e27c, flags={i = -1746476456}) at kernel/qeventloop.cpp:149
#6  0xb7063d72 in QEventLoop::exec (this=0x97e6e27c, flags={i = -1746476412}) at kernel/qeventloop.cpp:197
#7  0xb6f720e4 in QThread::exec (this=0xa190318) at thread/qthread.cpp:487
#8  0xb704831b in QInotifyFileSystemWatcherEngine::run (this=0xa190318) at io/qfilesystemwatcher_inotify.cpp:248
#9  0xb6f742b3 in QThreadPrivate::start (arg=0xa190318) at thread/qthread_unix.cpp:244
#10 0xb609e50f in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#11 0xb64bca0e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 3 (Thread 0x9766db90 (LWP 13446)):
#0  0xb7fed430 in __kernel_vsyscall ()
#1  0xb60a2075 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb64cabbd in pthread_cond_wait () from /lib/tls/i686/cmov/libc.so.6
#3  0xb6f75272 in QWaitCondition::wait (this=0xac00450, mutex=0xac0044c, time=4294967295) at thread/qwaitcondition_unix.cpp:87
#4  0xb6ca1a9a in QFileInfoGatherer::run (this=0xac00444) at dialogs/qfileinfogatherer.cpp:203
#5  0xb6f742b3 in QThreadPrivate::start (arg=0xac00444) at thread/qthread_unix.cpp:244
#6  0xb609e50f in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#7  0xb64bca0e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 2 (Thread 0x96e6cb90 (LWP 13447)):
#0  0xb447a323 in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#1  0xb447acad in ?? () from /usr/lib/libglib-2.0.so.0
#2  0xb447af81 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0xb708d4df in QEventDispatcherGlib::processEvents (this=0xabdab90, flags={i = -1763261928}) at kernel/qeventdispatcher_glib.cpp:409
#4  0xb7063baa in QEventLoop::processEvents (this=0x96e6c27c, flags={i = -1763261864}) at kernel/qeventloop.cpp:149
#5  0xb7063d72 in QEventLoop::exec (this=0x96e6c27c, flags={i = -1763261820}) at kernel/qeventloop.cpp:197
#6  0xb6f720e4 in QThread::exec (this=0xa183628) at thread/qthread.cpp:487
#7  0xb704831b in QInotifyFileSystemWatcherEngine::run (this=0xa183628) at io/qfilesystemwatcher_inotify.cpp:248
#8  0xb6f742b3 in QThreadPrivate::start (arg=0xa183628) at thread/qthread_unix.cpp:244
#9  0xb609e50f in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#10 0xb64bca0e in clone () from /lib/tls/i686/cmov/libc.so.6

Thread 1 (Thread 0xb2ec4b40 (LWP 13402)):
#0  0xb7fed430 in __kernel_vsyscall ()
#1  0xb60a23a2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb64cac14 in pthread_cond_timedwait () from /lib/tls/i686/cmov/libc.so.6
#3  0xb6f73d69 in thread_sleep (ti=0xbfc50160) at thread/qthread_unix.cpp:394
#4  0xb6f73e9b in QThread::msleep (msecs=<value optimized out>) at thread/qthread_unix.cpp:420
#5  0xb11dafb4 in ~Backend (this=0xa21c2a0) at /home/kde4/src/KDE/kdesupport/phonon/xine/backend.cpp:110
#6  0xb5efed22 in ~FactoryPrivate (this=0xa132e48) at /home/kde4/src/KDE/kdesupport/phonon/phonon/factory.cpp:199
#7  0xb5efc145 in destroy () at /home/kde4/src/KDE/kdesupport/phonon/phonon/factory.cpp:84
#8  0xb5ef856b in ~CleanUpGlobalStatic (this=0xb5f1a81c) at /home/kde4/src/KDE/kdesupport/phonon/phonon/globalstatic_p.h:55
#9  0xb6409d89 in exit () from /lib/tls/i686/cmov/libc.so.6
#10 0xb680dd0b in qt_xio_errhandler () at kernel/qapplication_x11.cpp:734
#11 0xb7dfc1fa in KApplication::xioErrhandler (this=0xbfc53734, dpy=0xa0aecd8) at /home/kde4/src/KDE/kdelibs/kdeui/kernel/kapplication.cpp:408
#12 0xb7dfc236 in kde_xio_errhandler (dpy=0xa0aecd8) at /home/kde4/src/KDE/kdelibs/kdeui/kernel/kapplication.cpp:125
#13 0xb62c0062 in _XIOError () from /usr/lib/libX11.so.6
#14 0xb62c73f8 in _XGetXCBBuffer () from /usr/lib/libX11.so.6
#15 0xb62c75fd in ?? () from /usr/lib/libX11.so.6
#16 0xb62c837e in _XReply () from /usr/lib/libX11.so.6
#17 0xb62b53dd in XQueryPointer () from /usr/lib/libX11.so.6
#18 0xb6826430 in QCursor::pos () at kernel/qcursor_x11.cpp:155
#19 0xb74f12e7 in CollectionTreeItemDelegate::paint (this=0xab7b6d8, painter=0xbfc50b88, option=@0xbfc50724, index=@0xbfc50880)
    at /home/kde4/src/KDE/multimedia/amarok/src/browsers/collectionbrowser/CollectionTreeItemDelegate.cpp:125
#20 0xb6cff131 in QTreeView::drawRow (this=0xa140fd8, painter=0xbfc50b88, option=@0xbfc50a24, index=@0xb8938d0) at itemviews/qtreeview.cpp:1672
#21 0xb79e24c4 in Amarok::PrettyTreeView::drawRow (this=0xa140fd8, painter=0xbfc50b88, option=@0xbfc50a24, index=@0xb8938d0) at /home/kde4/src/KDE/multimedia/amarok/src/widgets/PrettyTreeView.cpp:42
#22 0xb6d05324 in QTreeView::drawTree (this=0xa140fd8, painter=0xbfc50b88, region=@0xbfc514d0) at itemviews/qtreeview.cpp:1435
#23 0xb6d05ad7 in QTreeView::paintEvent (this=0xa140fd8, event=0xbfc514b4) at itemviews/qtreeview.cpp:1268
#24 0xb67f61ff in QWidget::event (this=0xa140fd8, event=0xbfc514b4) at kernel/qwidget.cpp:8120
#25 0xb6b97083 in QFrame::event (this=0xa140fd8, e=0xbfc514b4) at widgets/qframe.cpp:557
#26 0xb6c26812 in QAbstractScrollArea::viewportEvent (this=0xa140fd8, e=0x1) at widgets/qabstractscrollarea.cpp:1032
#27 0xb6cc8e4f in QAbstractItemView::viewportEvent (this=0xa140fd8, event=0xbfc514b4) at itemviews/qabstractitemview.cpp:1589
#28 0xb6d04431 in QTreeView::viewportEvent (this=0xa140fd8, event=0xbfc514b4) at itemviews/qtreeview.cpp:1250
#29 0xb6c29025 in QAbstractScrollAreaFilter::eventFilter (this=0xa140c70, o=0xa141458, e=0xbfc514b4) at widgets/qabstractscrollarea_p.h:100
#30 0xb70646ba in QCoreApplicationPrivate::sendThroughObjectEventFilters (this=0xa08aec0, receiver=0xa141458, event=0xbfc514b4) at kernel/qcoreapplication.cpp:819
#31 0xb6798f27 in QApplicationPrivate::notify_helper (this=0xa08aec0, receiver=0xa141458, e=0xbfc514b4) at kernel/qapplication.cpp:4238
#32 0xb67a1ad4 in QApplication::notify (this=0xbfc53734, receiver=0xa141458, e=0xbfc514b4) at kernel/qapplication.cpp:4125
#33 0xb78b2e33 in App::notify (this=0xbfc53734, receiver=0xa141458, event=0xbfc514b4) at /home/kde4/src/KDE/multimedia/amarok/src/App.cpp:845
#34 0xb706533b in QCoreApplication::notifyInternal (this=0xbfc53734, receiver=0xa141458, event=0xbfc514b4) at kernel/qcoreapplication.cpp:704
#35 0xb67f75b3 in QWidgetPrivate::drawWidget (this=0xa095848, pdev=0xa8d9ca4, rgn=@0xbfc516e0, offset=@0xbfc516d8, flags=4, sharedPainter=0x0, backingStore=0xa8ce3d0)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:218
#36 0xb67f806f in QWidgetPrivate::paintSiblingsRecursive (this=0xa141080, pdev=0xa8d9ca4, siblings=@0xa14108c, index=0, rgn=@0xbfc519c0, offset=@0xbfc519b8, flags=4, sharedPainter=0x0, 
    backingStore=0xa8ce3d0) at kernel/qwidget.cpp:5435
#37 0xb67f7170 in QWidgetPrivate::drawWidget (this=0xa141080, pdev=0xa8d9ca4, rgn=@0xbfc519c0, offset=@0xbfc519b8, flags=4, sharedPainter=0x0, backingStore=0xa8ce3d0) at kernel/qwidget.cpp:5371
#38 0xb67f806f in QWidgetPrivate::paintSiblingsRecursive (this=0xa96c628, pdev=0xa8d9ca4, siblings=@0xa96c634, index=2, rgn=@0xbfc51ca0, offset=@0xbfc51c98, flags=4, sharedPainter=0x0, 
    backingStore=0xa8ce3d0) at kernel/qwidget.cpp:5435
#39 0xb67f7170 in QWidgetPrivate::drawWidget (this=0xa96c628, pdev=0xa8d9ca4, rgn=@0xbfc51ca0, offset=@0xbfc51c98, flags=4, sharedPainter=0x0, backingStore=0xa8ce3d0) at kernel/qwidget.cpp:5371
#40 0xb67f806f in QWidgetPrivate::paintSiblingsRecursive (this=0xa9dee58, pdev=0xa8d9ca4, siblings=@0xa9dee64, index=3, rgn=@0xbfc51f80, offset=@0xbfc51f78, flags=4, sharedPainter=0x0, 
    backingStore=0xa8ce3d0) at kernel/qwidget.cpp:5435
#41 0xb67f7170 in QWidgetPrivate::drawWidget (this=0xa9dee58, pdev=0xa8d9ca4, rgn=@0xbfc51f80, offset=@0xbfc51f78, flags=4, sharedPainter=0x0, backingStore=0xa8ce3d0) at kernel/qwidget.cpp:5371
#42 0xb67f806f in QWidgetPrivate::paintSiblingsRecursive (this=0xa944550, pdev=0xa8d9ca4, siblings=@0xa94455c, index=3, rgn=@0xbfc52260, offset=@0xbfc52258, flags=4, sharedPainter=0x0, 
    backingStore=0xa8ce3d0) at kernel/qwidget.cpp:5435
#43 0xb67f7170 in QWidgetPrivate::drawWidget (this=0xa944550, pdev=0xa8d9ca4, rgn=@0xbfc52260, offset=@0xbfc52258, flags=4, sharedPainter=0x0, backingStore=0xa8ce3d0) at kernel/qwidget.cpp:5371
#44 0xb67f806f in QWidgetPrivate::paintSiblingsRecursive (this=0xa9393b8, pdev=0xa8d9ca4, siblings=@0xa9393c4, index=3, rgn=@0xbfc52540, offset=@0xbfc52538, flags=4, sharedPainter=0x0, 
    backingStore=0xa8ce3d0) at kernel/qwidget.cpp:5435
#45 0xb67f7170 in QWidgetPrivate::drawWidget (this=0xa9393b8, pdev=0xa8d9ca4, rgn=@0xbfc52540, offset=@0xbfc52538, flags=4, sharedPainter=0x0, backingStore=0xa8ce3d0) at kernel/qwidget.cpp:5371
#46 0xb67f806f in QWidgetPrivate::paintSiblingsRecursive (this=0xa950d18, pdev=0xa8d9ca4, siblings=@0xa950d24, index=5, rgn=@0xbfc52820, offset=@0xbfc52818, flags=4, sharedPainter=0x0, 
    backingStore=0xa8ce3d0) at kernel/qwidget.cpp:5435
#47 0xb67f7170 in QWidgetPrivate::drawWidget (this=0xa950d18, pdev=0xa8d9ca4, rgn=@0xbfc52820, offset=@0xbfc52818, flags=4, sharedPainter=0x0, backingStore=0xa8ce3d0) at kernel/qwidget.cpp:5371
#48 0xb67f806f in QWidgetPrivate::paintSiblingsRecursive (this=0xa08c8f8, pdev=0xa8d9ca4, siblings=@0xa08c904, index=78, rgn=@0xbfc52b28, offset=@0xa8ce3f4, flags=4, sharedPainter=0x0, 
    backingStore=0xa8ce3d0) at kernel/qwidget.cpp:5435
#49 0xb67f7170 in QWidgetPrivate::drawWidget (this=0xa08c8f8, pdev=0xa8d9ca4, rgn=@0xbfc52b28, offset=@0xa8ce3f4, flags=4, sharedPainter=0x0, backingStore=0xa8ce3d0) at kernel/qwidget.cpp:5371
#50 0xb69aad62 in QWidgetBackingStore::sync (this=0xa8ce3d0) at painting/qbackingstore.cpp:1289
#51 0xb67e8734 in QWidgetPrivate::syncBackingStore (this=0xa08c8f8) at kernel/qwidget.cpp:1662
#52 0xb67f658c in QWidget::event (this=0xa08b748, event=0xbf6c158) at kernel/qwidget.cpp:8266
#53 0xb6bb2a57 in QMainWindow::event (this=0xa08b748, event=0xbf6c158) at widgets/qmainwindow.cpp:1434
#54 0xb7eedca7 in KMainWindow::event (this=0xa08b748, ev=0xbf6c158) at /home/kde4/src/KDE/kdelibs/kdeui/widgets/kmainwindow.cpp:1103
#55 0xb6798f4c in QApplicationPrivate::notify_helper (this=0xa08aec0, receiver=0xa08b748, e=0xbf6c158) at kernel/qapplication.cpp:4242
#56 0xb67a1ad4 in QApplication::notify (this=0xbfc53734, receiver=0xa08b748, e=0xbf6c158) at kernel/qapplication.cpp:4125
#57 0xb78b2e33 in App::notify (this=0xbfc53734, receiver=0xa08b748, event=0xbf6c158) at /home/kde4/src/KDE/multimedia/amarok/src/App.cpp:845
#58 0xb706533b in QCoreApplication::notifyInternal (this=0xbfc53734, receiver=0xa08b748, event=0xbf6c158) at kernel/qcoreapplication.cpp:704
#59 0xb70660c3 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x9fbc600) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#60 0xb70661ed in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1238
#61 0xb708d99f in postEventSourceDispatch (s=0xa097ce8) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220
#62 0xb4477718 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#63 0xb447adc3 in ?? () from /usr/lib/libglib-2.0.so.0
#64 0xb447af81 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#65 0xb708d4c1 in QEventDispatcherGlib::processEvents (this=0xa08a028, flags={i = -1077595112}) at kernel/qeventdispatcher_glib.cpp:407
#66 0xb68442a5 in QGuiEventDispatcherGlib::processEvents (this=0xa08a028, flags={i = -1077595064}) at kernel/qguieventdispatcher_glib.cpp:202
#67 0xb7063baa in QEventLoop::processEvents (this=0xbfc534b0, flags={i = -1077595000}) at kernel/qeventloop.cpp:149
#68 0xb7063d72 in QEventLoop::exec (this=0xbfc534b0, flags={i = -1077594952}) at kernel/qeventloop.cpp:197
#69 0xb70662b1 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:981
#70 0xb6798ff7 in QApplication::exec () at kernel/qapplication.cpp:3570
#71 0x080521fd in main (argc=2, argv=0xbfc53f74) at /home/kde4/src/KDE/multimedia/amarok/src/main.cpp:235

This bug may be a duplicate of or related to bug 220422.

Possible duplicates by query: bug 220422, bug 207242, bug 190959.

Reported using DrKonqi
Comment 1 Dario Andres 2009-12-29 18:41:55 UTC
This could be related to the glibc bug : bug 196207.
Check this:
- Quit Amarok
- Start Konsole
- Type "export QT_NO_GLIB=1" + Enter
- Type "export MALLOC_CHECK_=" + Enter
- Type "amarok" + Enter
- Use Amarok and check if it crashes or not
If it doesn't crash, then it is likely to be bug 196207.
Comment 2 Jussi Kekkonen 2009-12-30 11:30:56 UTC
Nope, that doesn't help it, still crashes pretty similarly.
Comment 3 Jeff Mitchell 2009-12-30 14:26:15 UTC
Unfortunately it's a pretty unhelpful backtrace in that I don't see the signal handler being called anywhere.

A couple things I *do* notice:

- It doesn't seem to be crashing during the scan -- it seems to be crashing just after, when some other part of Amarok is being updated. So it might be a crash in e.g. the collection browser.

- Those errors in your debug output are odd, because they're simply when copying over information from a temp table to a non-temp table. There should be absolutely no discrepancy between the columns.

Has the scanning *ever* worked for you with the local server?

My guess is that there is some sort of permissions problem or some such thing such that the DB is not actually usable, and somewhere down the line it's causing a crash.
Comment 4 Dmitry Suzdalev 2010-01-01 20:32:43 UTC
Created attachment 39494 [details]
New crash information added by DrKonqi

Looks like I just got the same backtrace.

Though I can't say what was in the console output.

And also this happened during incremental scan. What happenned:

1. Amarok was running (playing random playlist)
2. At the same time I was splitting one of my flac files into a smaller flacs using cue file and cuebreakpoints+shnsplit tools (in konsole)
3. As a result new flac files were constantly appearing inside my ~/Music directory
4. I think that amarok noticed that and started updating its database
5. It crashed (this crash I am reporting now)
6. I restarted amarok and it crashed again with the similar backtrace

Amarok is compiled from sources on 31 Dec 2009, git commit 25a1924e3f896c6fd8fa55d54ad9c2448240e43f
Comment 5 Dmitry Suzdalev 2010-01-01 20:38:24 UTC
(In reply to comment #3)
> Unfortunately it's a pretty unhelpful backtrace in that I don't see the signal
> handler being called anywhere.
By the way, speaking of previous reported backtrace seems like Jeff is mistaken: the signal handler is present there indeed:

Thread 10 (Thread 0xaabffb90 (LWP 13416)):
[KCrash Handler]
#6  0xb7fed430 in __kernel_vsyscall ()
#7  0xb64068a0 in raise () from /lib/tls/i686/cmov/libc.so.6
#8  0xb6408268 in abort () from /lib/tls/i686/cmov/libc.so.6
#9  0xb644a483 in ?? () from /lib/tls/i686/cmov/libc.so.6
#10 0xb644c455 in free () from /lib/tls/i686/cmov/libc.so.6
#11 0xb66010b1 in operator delete () from /usr/lib/libstdc++.so.6
#12 0xacdffb36 in ~ScanResultProcessor (this=0xaabfec14) at
<snipped>

I have the same stack in my report.
Comment 6 Jeff Mitchell 2010-01-02 00:55:20 UTC
(In reply to comment #5)
> (In reply to comment #3)
> > Unfortunately it's a pretty unhelpful backtrace in that I don't see the signal
> > handler being called anywhere.
> By the way, speaking of previous reported backtrace seems like Jeff is
> mistaken: the signal handler is present there indeed:
> 
> Thread 10 (Thread 0xaabffb90 (LWP 13416)):
> [KCrash Handler]

Yes, someone pointed this out to me. I was looking for a line like [Signal handler called] -- I didn't realize KCrash was replacing it.
Comment 7 Marian Kyral 2010-01-03 12:34:27 UTC
Hi,
I got the same crash (the same backtrace).

Gentoo
Qt: 4.6.0
KDE Development Platform: 4.3.85 (KDE 4.3.85 (KDE 4.4 Beta2))
kde4-config: 1.0

I'm not sure whether this is possible as m_urlsHashByUid is defined as QHash

	 foreach( QStringList *list, m_urlsHashByUid )
		delete list;

But even I commented it out, I got crash later:

Thread 4 (Thread 0x7fad57e19710 (LWP 19016)):
[KCrash Handler]
#5  QBasicAtomicInt::ref (this=0xa00000001) at /usr/include/qt4/QtCore/qatomic_x86_64.h:121
#6  0x00007fad63ea6f91 in QList<QString>::operator= (this=0x7fad57e17940, l=...) at /usr/include/qt4/QtCore/qlist.h:411
#7  0x00007fad63ea6fd9 in QStringList::operator= (this=0xa00000001) at /usr/include/qt4/QtCore/qstringlist.h:67
#8  0x00007fad63eb6a04 in ScanResultProcessor::urlId (this=0x7fad57e18280, url=..., uid=...) at /var/portage/distfiles/git-src/amarok/src/collection/sqlcollection/ScanResultProcessor.cpp:671
#9  0x00007fad63eb7691 in ScanResultProcessor::addTrack (this=0x7fad57e18280, trackData=..., albumArtistId=661)
    at /var/portage/distfiles/git-src/amarok/src/collection/sqlcollection/ScanResultProcessor.cpp:413
#10 0x00007fad63eb8a19 in ScanResultProcessor::processDirectory (this=0x7fad57e18280, data=...) at /var/portage/distfiles/git-src/amarok/src/collection/sqlcollection/ScanResultProcessor.cpp:274
#11 0x00007fad63eaa44f in XmlParseJob::run (this=0x2f18cf0) at /var/portage/distfiles/git-src/amarok/src/collection/sqlcollection/ScanManager.cpp:776
#12 0x00007fad78ecf0fc in ?? () from /usr/lib64/libthreadweaver.so.4
#13 0x00007fad78ecf421 in ThreadWeaver::Job::execute(ThreadWeaver::Thread*) () from /usr/lib64/libthreadweaver.so.4
#14 0x00007fad78ece39f in ?? () from /usr/lib64/libthreadweaver.so.4
#15 0x00007fad78ece829 in ThreadWeaver::Thread::run() () from /usr/lib64/libthreadweaver.so.4
#16 0x00007fad7d2e9295 in ?? () from /usr/lib64/qt4/libQtCore.so.4
#17 0x00007fad79869547 in start_thread () from /lib/libpthread.so.0
#18 0x00007fad7bf44abd in clone () from /lib/libc.so.6
#19 0x0000000000000000 in ?? ()
Comment 8 Marian Kyral 2010-01-03 13:09:50 UTC
I got the crash also when I cancel collection scanning or I exit Amarok during the scanning.
Comment 9 Jeff Mitchell 2010-01-03 15:23:57 UTC
Does anyone know of a specific way to reproduce this?

It's very hard for me to make sense of what could be going on here because I have no idea how to trigger the crash.
Comment 10 Marian Kyral 2010-01-03 15:52:24 UTC
I just do a full scan. It is probably related to some files in collection. When I selected a directory with only several files, all were scanned and shown in collection. But after a while, Amarok crashed on different error in CoverFetcher.
Comment 11 Mikko C. 2010-01-03 18:47:58 UTC
*** Bug 221106 has been marked as a duplicate of this bug. ***
Comment 12 Mikko C. 2010-01-03 18:50:22 UTC
bt from bug 221106

[KCrash Handler]
#5  0x00007fe49be0705d in ?? () from /lib/libc.so.6
#6  0x00007fe49be086a8 in ?? () from /lib/libc.so.6
#7  0x00007fe49be0b9bc in free () from /lib/libc.so.6
#8  0x00007fe49d399985 in QHashData::free_helper(void (*)(QHashData::Node*)) ()
from /usr/lib/libQtCore.so.4
#9  0x00007fe481e7113b in QHash<int, QStringList*>::freeData
(this=0x7fe473666588, x=0x295cca0) at /usr/include/qt4/QtCore/qhash.h:567
#10 0x00007fe481e6dc52 in ~QHash (this=0x7fe473666588) at
/usr/include/qt4/QtCore/qhash.h:284
#11 0x00007fe481e6086e in ~ScanResultProcessor (this=0x7fe4736664d0) at
/opt/amarok/src/collection/sqlcollection/ScanResultProcessor.cpp:51
#12 0x00007fe481e5cf57 in XmlParseJob::run (this=0x2940b00) at
/opt/amarok/src/collection/sqlcollection/ScanManager.cpp:855
#13 0x00007fe49a06e67d in ?? () from /usr/lib/libthreadweaver.so.4
#14 0x00007fe49a06e97e in ThreadWeaver::Job::execute(ThreadWeaver::Thread*) ()
from /usr/lib/libthreadweaver.so.4
#15 0x00007fe49a06d9ef in ?? () from /usr/lib/libthreadweaver.so.4
#16 0x00007fe49a06df88 in ThreadWeaver::Thread::run() () from
/usr/lib/libthreadweaver.so.4
#17 0x00007fe49d37def5 in ?? () from /usr/lib/libQtCore.so.4
#18 0x00007fe4970b373a in start_thread () from /lib/libpthread.so.0
#19 0x00007fe49be6169d in clone () from /lib/libc.so.6
#20 0x0000000000000000 in ?? ()
Comment 13 Mikko C. 2010-01-03 18:56:55 UTC
The backtraces do indicate a dupe of https://bugs.kde.org/show_bug.cgi?id=196207 since they point to free().
Comment 14 Jeff Mitchell 2010-01-03 22:15:35 UTC
Everyone CCed with this bug, please report:

1) Your Qt version
2) Your KDE version

I have a feeling that this is related to one or the other, most likely Qt 4.6.
Comment 15 Jeff Mitchell 2010-01-03 22:16:35 UTC
*** Bug 220422 has been marked as a duplicate of this bug. ***
Comment 16 hyper_ch 2010-01-03 22:22:37 UTC
Application: amarok (2.2-GIT)
KDE Platform Version: 4.3.85 (KDE 4.3.85 (KDE 4.4 Beta2))
Qt Version: 4.6.0
Operating System: Linux 2.6.31-17-generic i686
Distribution: Ubuntu 9.10
Comment 17 Mikko C. 2010-01-04 12:57:40 UTC
*** Bug 221225 has been marked as a duplicate of this bug. ***
Comment 18 Mikko C. 2010-01-04 12:59:44 UTC
from bug 221225

Application that crashed: amarok
Version of the application: 2.2-GIT
KDE Version: 4.3.4 (KDE 4.3.4)
Qt Version: 4.5.2
Operating System: Linux 2.6.31-17-generic x86_64
Distribution: Ubuntu 9.10

So it seems it's not kde 4.4 or qt 4.6 related.
Does https://bugs.kde.org/show_bug.cgi?id=220532#c1 fix the problem for anyone?
Comment 19 Marian Kyral 2010-01-04 13:09:41 UTC
(In reply to comment #18)

> Does https://bugs.kde.org/show_bug.cgi?id=220532#c1 fix the problem for anyone?

I tested, but did not help in my case.
Comment 20 Jeff Mitchell 2010-01-04 13:35:04 UTC
Another question: does everyone with this problem get the same issue in their debug output:

amarok:      [ERROR!] GREPME MySQL query failed! Column count doesn't match
value count at row 1  on  "INSERT INTO images SELECT * FROM images_temp;" 
amarok:      [ERROR!] GREPME MySQL query failed! Column count doesn't match
value count at row 1  on  "INSERT INTO directories SELECT * FROM
directories_temp;"
Comment 21 Jeff Mitchell 2010-01-04 13:56:56 UTC
Got a tip from Myriam:

Please ensure that you have updated to libc6 2.10.1-0ubuntu16 which provides glibc-2.10-1.

Apparently these are now in backports as of this morning or so, and may fix this bug (makes some sense as so far everyone seems to be a *buntu user).
Comment 22 Marian Kyral 2010-01-05 03:49:20 UTC
(In reply to comment #20)
> Another question: does everyone with this problem get the same issue in their
> debug output:
> 
> amarok:      [ERROR!] GREPME MySQL query failed! Column count doesn't match
> value count at row 1  on  "INSERT INTO images SELECT * FROM images_temp;" 
> amarok:      [ERROR!] GREPME MySQL query failed! Column count doesn't match
> value count at row 1  on  "INSERT INTO directories SELECT * FROM
> directories_temp;"

Yes, it is there.

amarok: BEGIN: void DaapCollectionFactory::connectToManualServers()
amarok: END__: void DaapCollectionFactory::connectToManualServers() - Took 6.9e-05s
amarok: [MountPointManager] [WARNING!] NOT-IMPLEMENTED:  void MountPointManager::startStatisticsUpdateJob()

amarok: BEGIN: void CurrentEngine::stoppedState()
amarok: END__: void CurrentEngine::stoppedState() - Took 0.00041s
amarok:  Initialized thread, count== 2
amarok:  [ERROR!] "GREPME MySQL-server query failed! No database selected on SELECT urls.deviceid, urls.rpath, urls.uniqueid, tracks.id, tracks.title, tracks.comment, tracks.tracknumber, tracks.discnumber, statistics.score, statistics.rating, tracks.bitrate, tracks.length, tracks.filesize, tracks.samplerate, statistics.createdate, statistics.accessdate, statistics.playcount, tracks.filetype, tracks.bpm, tracks.createdate, tracks.albumgain, tracks.albumpeakgain, tracks.trackgain, tracks.trackpeakgain, artists.name, artists.id, albums.name, albums.id, albums.artist, genres.name, genres.id, composers.name, composers.id, years.name, years.id FROM  tracks INNER JOIN urls ON tracks.url = urls.id LEFT JOIN artists ON tracks.artist = artists.id LEFT JOIN albums ON tracks.album = albums.id LEFT JOIN genres ON tracks.genre = genres.id LEFT JOIN composers ON tracks.composer = composers.id LEFT JOIN years ON tracks.year = years.id LEFT JOIN statistics ON urls.id = statistics.url WHERE 1  AND ( 1   AND  NOT tracks.title  = ''   )  ORDER BY statistics.accessdate DESC  LIMIT 5 OFFSET 0 ;"
amarok(31719)/kio (KDirListerCache) KDirListerCache::listDir: Entry currently being listed: KUrl("trash:/") by (KDirLister(0x15c1200) )
amarok(31719)/kio (Slave) KIO::Slave::createSlave: createSlave "trash" for KUrl("trash:/")
amarok(31719)/kio (KIOConnection) KIO::ConnectionServer::listenForRemote: Listening on  "local:/tmp/ksocket-marian/amarokn31719.slave-socket"
amarok(31719)/kio (Slave) KIO::Slave::createSlave: createSlave "file" for KUrl("file:///home/data/mp3/new/Tomas-Kocko-a-Orchestr_-_Do-tanca")
amarok(31719)/kio (KIOConnection) KIO::ConnectionServer::listenForRemote: Listening on  "local:/tmp/ksocket-marian/amarokm31719.slave-socket"
amarok:  Initialized thread, count== 3
amarok:  [ERROR!] "GREPME MySQL-server query failed! No database selected on SELECT DISTINCT albums.name, albums.id, albums.artist FROM  albums WHERE 1  AND albums.artist IS NULL ;"
amarok:  [ERROR!] "GREPME MySQL-server query failed! No database selected on SELECT DISTINCT artists.name, artists.id FROM  artists INNER JOIN tracks ON tracks.artist = artists.id LEFT JOIN albums ON tracks.album = albums.id WHERE 1  AND albums.artist IS NOT NULL ;"

My glibc6 version on gentoo is 2.11-r1.
Comment 23 Marian Kyral 2010-01-05 03:59:22 UTC
I tested it on different computer. I switched to external mysql database and there was no amarokdb database. So I created it and now are in log these errors:

amarok:     BEGIN: void DatabaseUpdater::checkTables(bool)
amarok:        [ERROR!] Tried to query an uninitialized m_db!
amarok:     END__: void DatabaseUpdater::checkTables(bool) - Took 0.00016s
amarok:   END__: void ScanManager::checkTables(bool) - Took 0.00039s
amarok:   BEGIN: void ScanManager::cleanTables()
amarok:      [ERROR!] Tried to query an uninitialized m_db!
amarok:      [ERROR!] Tried to query an uninitialized m_db!
amarok:      [ERROR!] Tried to query an uninitialized m_db!
amarok:      [ERROR!] Tried to query an uninitialized m_db!
amarok:      [ERROR!] Tried to query an uninitialized m_db!
amarok:      [ERROR!] Tried to query an uninitialized m_db!
Comment 24 Jeff Mitchell 2010-01-05 05:10:49 UTC
Please see comment #21...
Comment 25 Marian Kyral 2010-01-05 10:04:45 UTC
(In reply to comment #24)
> Please see comment #21...

See comment 22 below ;-)

> My glibc6 version on gentoo is 2.11-r1.
Comment 26 Mikko C. 2010-01-05 11:04:34 UTC
(In reply to comment #25)
> 
> > My glibc6 version on gentoo is 2.11-r1.

Then it's not an Ubuntu specific problem, and definitely not the glibc bug either, since 2.11-r1 in gentoo contains the patch.
Does the crash only happens with a full rescan or incremental too?
And could someone test with an older version like 2.2.1? Just to check if it's a regression in amarok.
Comment 27 Marian Kyral 2010-01-05 13:40:13 UTC
(In reply to comment #26)

> Does the crash only happens with a full rescan or incremental too?


Incremental scan looks OK. At least did not fail until I forced full scan.

> And could someone test with an older version like 2.2.1? Just to check if it's
> a regression in amarok.

I compiled 2.2.1. Several full scans without problem. In collected about 5600 tracks. Then I compiled last git version. After start a incremental scan finished without problem, collection contained 7300 tracks. Full scan failed.

But it looks like different error:

Thread 6 (Thread 0x7f7c21629710 (LWP 19272)):
[KCrash Handler]
#5  QBasicAtomicInt::ref (this=0x7f7c21627f70, url=..., uid=...) at /usr/include/qt4/QtCore/qatomic_x86_64.h:121
#6  QList<QString>::operator= (this=0x7f7c21627f70, url=..., uid=...) at /usr/include/qt4/QtCore/qlist.h:411
#7  operator= (this=0x7f7c21627f70, url=..., uid=...) at /usr/include/qt4/QtCore/qstringlist.h:67
#8  ScanResultProcessor::urlId (this=0x7f7c21627f70, url=..., uid=...) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/collection/sqlcollection/ScanResultProcessor.cpp:664
#9  0x00007f7c26b60ac4 in ScanResultProcessor::addTrack (this=0x7f7c21627f70, trackData=..., albumArtistId=<value optimized out>)
    at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/collection/sqlcollection/ScanResultProcessor.cpp:413
#10 0x00007f7c26b6b98f in ScanResultProcessor::processDirectory (this=0x7f7c21627f70, data=<value optimized out>)
    at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/collection/sqlcollection/ScanResultProcessor.cpp:274
#11 0x00007f7c26b556fa in XmlParseJob::run (this=0x1560080) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/collection/sqlcollection/ScanManager.cpp:776
#12 0x00000039b380e001 in ThreadWeaver::JobRunHelper::runTheJob (this=<value optimized out>, th=<value optimized out>, job=<value optimized out>)
    at /var/tmp/portage/kde-base/kdelibs-4.3.4/work/kdelibs-4.3.4/threadweaver/Weaver/Job.cpp:106
#13 0x00000039b380e1d9 in ThreadWeaver::Job::execute (this=<value optimized out>, th=<value optimized out>)
    at /var/tmp/portage/kde-base/kdelibs-4.3.4/work/kdelibs-4.3.4/threadweaver/Weaver/Job.cpp:135
#14 0x00000039b380d64f in ThreadWeaver::ThreadRunHelper::run (this=<value optimized out>, parent=<value optimized out>, th=<value optimized out>)
    at /var/tmp/portage/kde-base/kdelibs-4.3.4/work/kdelibs-4.3.4/threadweaver/Weaver/Thread.cpp:95
#15 0x00000039b380d794 in ThreadWeaver::Thread::run (this=<value optimized out>) at /var/tmp/portage/kde-base/kdelibs-4.3.4/work/kdelibs-4.3.4/threadweaver/Weaver/Thread.cpp:142
#16 0x00000039adc791d5 in QThreadPrivate::start (arg=<value optimized out>) at thread/qthread_unix.cpp:244
#17 0x000000311d006894 in start_thread () from /lib/libpthread.so.0
#18 0x000000311c4d0f9d in clone () from /lib/libc.so.6
#19 0x0000000000000000 in ?? ()

Last messages from log:
amarok:     END__: virtual bool PlaylistFileProvider::import(const KUrl&) - Took 9.4e-05s                                                                                                                                                                                      
amarok:   END__: bool PlaylistManager::import(const QString&) - Took 0.00024s                                                                                                                                                                                                  
amarok:   BEGIN: bool PlaylistManager::import(const QString&)                                                                                                                                                                                                                  
amarok:     BEGIN: virtual bool PlaylistFileProvider::import(const KUrl&)                                                                                                                                                                                                      
amarok:        Playlist  "/home/data/mp3/Q/queen/Queen/QUEEN04/PLAYLIST.M3U"  was already imported                                                                                                                                                                             
amarok:     END__: virtual bool PlaylistFileProvider::import(const KUrl&) - Took 0.00014s                                                                                                                                                                                      
amarok:   END__: bool PlaylistManager::import(const QString&) - Took 0.00027s                                                                                                                                                                                                  
QSocketNotifier: Invalid socket 6 and type 'Read', disabling...                                                                                                                                                                                                                
amarok: Fatal IO error: client killed                                                                                                                                                                                                                                          
kio_http(19290)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:                                                                                                                                                                                                      
kio_http(19290)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:                                                                                                                                                                                                      
kio_http(19301)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:                                                                                                                                                                                                      
kio_http(19302)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:                                                                                                                                                                                                      
kio_http(19303)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:                                                                                                                                                                                                      
kio_http(19293)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:                                                                                                                                                                                                      
kio_http(19305)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:                                                                                                                                                                                                      
kio_http(19292)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:                                                                                                                                                                                                      
kio_http(19291)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:
Comment 28 Mikko C. 2010-01-05 14:17:26 UTC
(In reply to comment #27)
> 
> I compiled 2.2.1. Several full scans without problem. In collected about 5600
> tracks. Then I compiled last git version. After start a incremental scan
> finished without problem, collection contained 7300 tracks. Full scan failed.
> 

If you have some time to spend you could do a git bisect between 2.2.1 and master :)
Comment 29 Jeff Mitchell 2010-01-05 14:22:27 UTC
I don't suppose anyone is willing to git bisect this. I don't see what could be wrong in the code, and I have no idea how to reproduce it.
Comment 30 Jeff Mitchell 2010-01-05 14:22:55 UTC
Mikko: jinx!
Comment 31 Jeff Mitchell 2010-01-05 14:24:18 UTC
By the by: if someone does git bisect this, please be sure to look for *just this crash* as there may be collection wonkiness from various changes. So if you run into a problem, be sure to vet it to make sure it's actually this one.
Comment 32 Marian Kyral 2010-01-05 14:52:37 UTC
(In reply to comment #28)
> (In reply to comment #27)
> > 
> > I compiled 2.2.1. Several full scans without problem. In collected about 5600
> > tracks. Then I compiled last git version. After start a incremental scan
> > finished without problem, collection contained 7300 tracks. Full scan failed.
> > 
> 
> If you have some time to spend you could do a git bisect between 2.2.1 and
> master :)

Will try evening.

In meantime I deleted the database and start with new one. Now I got original bt.

Last messages in log.

amarok:     BEGIN: virtual bool PlaylistFileProvider::import(const KUrl&)
amarok:        Playlist  "/home/data/mp3/R/Roxette/The_RoxBox-4CD-2006/400-roxette-the-roxbox-2006.m3u"  was already imported
amarok:     END__: virtual bool PlaylistFileProvider::import(const KUrl&) - Took 9.4e-05s
amarok:   END__: bool PlaylistManager::import(const QString&) - Took 0.00017s
amarok:    Success. Committing result to database.
amarok:   BEGIN: void ScanManager::slotFinished()
amarok:   END__: void ScanManager::slotFinished() - Took 0.0001s
amarok:   BEGIN: void DatabaseUpdater::cleanPermanentTables()
amarok:   END__: void DatabaseUpdater::cleanPermanentTables() - Took 0.00095s
amarok:   BEGIN: void ScanResultProcessor::copyHashesToTempTables()
amarok:      obtained max_allowed_packet is  "1048576"
amarok:      urls key size is  7105
amarok:      tracks key size is  7106
amarok:   END__: void ScanResultProcessor::copyHashesToTempTables() - Took 1s
amarok:    temp_tracks:  ("7106")
amarok:    tracks before commit:  ("0")
amarok:   BEGIN: void DatabaseUpdater::copyToPermanentTables()
amarok:   END__: void DatabaseUpdater::copyToPermanentTables() - Took 0.55s
amarok:   BEGIN: virtual void Dynamic::BiasedPlaylist::invalidate()
amarok:   END__: virtual void Dynamic::BiasedPlaylist::invalidate() - Took 7.2e-05s
amarok:    tracks after commit:  ("7106")
amarok:   BEGIN: void DatabaseUpdater::removeTemporaryTables()
amarok:   END__: void DatabaseUpdater::removeTemporaryTables() - Took 0.039s
amarok:    Sending changed signal
amarok:   BEGIN: CollectionTreeItem::CollectionTreeItem(const Meta::DataList&, CollectionTreeItem*, CollectionTreeItemModelBase*)
amarok:   END__: CollectionTreeItem::CollectionTreeItem(const Meta::DataList&, CollectionTreeItem*, CollectionTreeItemModelBase*) - Took 0.00016s
amarok:   BEGIN: virtual void Dynamic::BiasedPlaylist::invalidate()
amarok:   END__: virtual void Dynamic::BiasedPlaylist::invalidate() - Took 7.9e-05s
kio_http(21566)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:
kio_http(21553)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:
kio_http(21554)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:
kio_http(21553)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:
kio_http(21555)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:
kio_http(21554)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:
kio_http(21555)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:
kio_http(21570)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:
kio_http(21556)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:
kio_http(21564)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:
kio_http(21570)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:
kio_http(21556)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:
kio_http(21565)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:
kio_http(21564)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:
kio_http(21565)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = amarok path = <unknown> pid = 21510
Comment 33 Lydia Pintscher 2010-01-05 17:17:27 UTC
Tagging of 2.2.2., which was supposed to happen today, has been delayed 24h to investigate this bug more.
If anyone of you has a few spare minutes please help bisecting it and/or ping jefferai in #amarok on freenode.


Thanks :)
Comment 34 Jeff Mitchell 2010-01-05 18:23:13 UTC
Please do the following. If you can replicate this crash with a totally clean database (wipe), then it will actually help a lot in trying to figure this out, as I can rule out certain code paths.

Start amarok --debug. Let Amarok load up, then close it. Now, wipe the DB. Then do amarok --debug again, and this time capture the *full* output. (Either clear your scrollback, then copy and paste to a file, or try --nofork and start with something like "amarok --debug --nofork 2>&1 1>amarokoutput.txt"). Please also get me the backtrace associated with that particular run -- attach each as a file to this bug report.

We've delayed tagging by 24 hours to try to get this solved, so the faster the turnaround time that someone can provide, and the more of you that can work with me on this, the better. Also, as Lydia said, try to find me at #amarok as jefferai if you can do some real-time debugging with me.
Comment 35 hyper_ch 2010-01-05 19:42:18 UTC
Created attachment 39594 [details]
DrKonqi output and --debug output

I have now added the DrKonqi output and the command line output. The break is at line 243 for those two outputs.
Comment 36 Marian Kyral 2010-01-05 20:18:37 UTC
(In reply to comment #34)
> Please do the following. If you can replicate this crash with a totally clean
> database (wipe), then it will actually help a lot in trying to figure this out,
> as I can rule out certain code paths.
> 
> Start amarok --debug. Let Amarok load up, then close it. Now, wipe the DB. Then
> do amarok --debug again, and this time capture the *full* output. (Either clear
> your scrollback, then copy and paste to a file, or try --nofork and start with
> something like "amarok --debug --nofork 2>&1 1>amarokoutput.txt"). Please also
> get me the backtrace associated with that particular run -- attach each as a
> file to this bug report.
> 

I did it, but it failed on different error in /usr/lib64/libmysqlclient.so.16. Unfortunately I had not mysql compiled with debug infos, so bt contains ?? :-(
I just compiling mysql with debug infos, will try again.

After next start, amarok shows 7185 tracks in collection. I really don't know what to think about :-(
Comment 37 Marian Kyral 2010-01-05 22:10:20 UTC
Seems like I'm not able to reproduce the crash with blank database now :-(

With wipe database, amarok crashes at 98% with bt below. It doesn't mater whether I use embedded or standalone mysql. I tested with 5.1.40 and 5.1.42.


***************************************************************************** Thread 1 (Thread 0x7f04fcca37a0 (LWP 18340)):
[KCrash Handler]
#5  malloc_consolidate (av=0x7f04fbfdee60) at malloc.c:5136
#6  0x00007f04fbcfdd68 in _int_free (av=0x7f04fbfdee60, p=0x2395e20) at malloc.c:5015
#7  0x00007f04fbd011ac in *__GI___libc_free (mem=<value optimized out>) at malloc.c:3738
#8  0x00007f04f1b9bc41 in free_root () from /usr/lib64/kde4/amarok_collection-mysqlecollection.so
#9  0x00007f04f1c0eba0 in free_tmp_table(THD*, st_table*) () from /usr/lib64/kde4/amarok_collection-mysqlecollection.so
#10 0x00007f04f1c169dc in JOIN::destroy() () from /usr/lib64/kde4/amarok_collection-mysqlecollection.so
#11 0x00007f04f1c52ad2 in st_select_lex::cleanup() () from /usr/lib64/kde4/amarok_collection-mysqlecollection.so
#12 0x00007f04f1c26268 in mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) () from /usr/lib64/kde4/amarok_collection-mysqlecollection.so
#13 0x00007f04f1c2b87c in handle_select(THD*, st_lex*, select_result*, unsigned long) () from /usr/lib64/kde4/amarok_collection-mysqlecollection.so
#14 0x00007f04f1bf75c1 in execute_sqlcom_select(THD*, TABLE_LIST*) () from /usr/lib64/kde4/amarok_collection-mysqlecollection.so
#15 0x00007f04f1bf8cd9 in mysql_execute_command(THD*) () from /usr/lib64/kde4/amarok_collection-mysqlecollection.so
#16 0x00007f04f1bfcc7d in mysql_parse(THD*, char const*, unsigned int, char const**) () from /usr/lib64/kde4/amarok_collection-mysqlecollection.so
#17 0x00007f04f1bfe8dd in dispatch_command(enum_server_command, THD*, char*, unsigned int) () from /usr/lib64/kde4/amarok_collection-mysqlecollection.so
#18 0x00007f04f1b81849 in emb_advanced_command () from /usr/lib64/kde4/amarok_collection-mysqlecollection.so
#19 0x00007f04f1b4bab1 in mysql_send_query () from /usr/lib64/kde4/amarok_collection-mysqlecollection.so
#20 0x00007f04f1b4bb19 in mysql_real_query () from /usr/lib64/kde4/amarok_collection-mysqlecollection.so
#21 0x00007f04f1b3cb68 in MySqlCollection::query (this=0xfcde00, statement=...) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/collection/mysql-shared/MySqlCollection.cpp:121
#22 0x00007f04f1b1c90a in SqlQueryMakerInternal::run (this=0x7f04d4723800) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/collection/sqlcollection/SqlQueryMakerInternal.cpp:46
#23 0x00007f04f1b18bfc in SqlQueryMaker::run (this=0x1a9c930) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/collection/sqlcollection/SqlQueryMaker.cpp:229
#24 0x00007f04f1b279a2 in Meta::SqlAlbum::tracks (this=0x7f04dc4ff910) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/collection/sqlcollection/SqlMeta.cpp:1349
#25 0x00007f04fc16f98a in CollectionSortFilterProxyModel::albumYear (this=<value optimized out>, album=)
    at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/browsers/CollectionSortFilterProxyModel.cpp:148
#26 0x00007f04fc171801 in CollectionSortFilterProxyModel::lessThanAlbum (this=0x1454bb0, left=..., right=...)
    at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/browsers/CollectionSortFilterProxyModel.cpp:118
#27 0x00007f04fc171c1e in CollectionSortFilterProxyModel::lessThan (this=0x1454bb0, left=..., right=...)
    at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/browsers/CollectionSortFilterProxyModel.cpp:63
#28 0x00000039af4d9bba in void QAlgorithmsPrivate::qMerge<int*, int const, QSortFilterProxyModelLessThan>(int*, int*, int*, int const&, QSortFilterProxyModelLessThan) ()
   from /usr/lib64/qt4/libQtGui.so.4
#29 0x00000039af4d9d32 in void QAlgorithmsPrivate::qStableSortHelper<int*, int, QSortFilterProxyModelLessThan>(int*, int*, int const&, QSortFilterProxyModelLessThan) ()
   from /usr/lib64/qt4/libQtGui.so.4
#30 0x00000039af4d9c72 in void QAlgorithmsPrivate::qStableSortHelper<int*, int, QSortFilterProxyModelLessThan>(int*, int*, int const&, QSortFilterProxyModelLessThan) ()
   from /usr/lib64/qt4/libQtGui.so.4
#31 0x00000039af4d9cd2 in void QAlgorithmsPrivate::qStableSortHelper<int*, int, QSortFilterProxyModelLessThan>(int*, int*, int const&, QSortFilterProxyModelLessThan) ()
   from /usr/lib64/qt4/libQtGui.so.4
#32 0x00000039af4d9c72 in void QAlgorithmsPrivate::qStableSortHelper<int*, int, QSortFilterProxyModelLessThan>(int*, int*, int const&, QSortFilterProxyModelLessThan) ()
   from /usr/lib64/qt4/libQtGui.so.4
#33 0x00000039af4d10af in qStableSort<int*, QSortFilterProxyModelLessThan> (this=<value optimized out>, source_rows=<value optimized out>, source_parent=<value optimized out>)
    at ../../include/QtCore/../../src/corelib/tools/qalgorithms.h:212
#34 QSortFilterProxyModelPrivate::sort_source_rows (this=<value optimized out>, source_rows=<value optimized out>, source_parent=<value optimized out>) at itemviews/qsortfilterproxymodel.cpp:427
#35 0x00000039af4d1653 in QSortFilterProxyModelPrivate::create_mapping (this=<value optimized out>, source_parent=<value optimized out>) at itemviews/qsortfilterproxymodel.cpp:300
#36 0x00000039af4d2168 in QSortFilterProxyModel::rowCount (this=<value optimized out>, parent=<value optimized out>) at itemviews/qsortfilterproxymodel.cpp:1600
#37 0x00007f04fc185cd3 in CollectionTreeView::slotCheckAutoExpand (this=0x143b450) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/browsers/CollectionTreeView.cpp:641
#38 0x00007f04fc190ce8 in CollectionTreeView::qt_metacall (this=0x143b450, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff67571230)
    at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999_build/src/CollectionTreeView.moc:116
#39 0x00000039add7df33 in QMetaObject::activate (sender=<value optimized out>, m=<value optimized out>, local_signal_index=<value optimized out>, argv=<value optimized out>)
    at kernel/qobject.cpp:3286
#40 0x00007f04fc17c153 in CollectionTreeItemModelBase::queryDone (this=0x1432560) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/browsers/CollectionTreeItemModelBase.cpp:680
#41 0x00007f04fc17ca9d in CollectionTreeItemModelBase::qt_metacall (this=0x1432560, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x21c5f00)
    at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999_build/src/CollectionTreeItemModelBase.moc:92
#42 0x00007f04fc1750c0 in CollectionTreeItemModel::qt_metacall (this=0x7f04fbfdee60, _c=QMetaObject::InvokeMetaMethod, _id=24666032, _a=0x21)
    at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999_build/src/CollectionTreeItemModel.moc:73
#43 0x00000039add7aeb9 in QObject::event (this=<value optimized out>, e=<value optimized out>) at kernel/qobject.cpp:1252
#44 0x00000039aefb929c in QApplicationPrivate::notify_helper (this=<value optimized out>, receiver=<value optimized out>, e=<value optimized out>) at kernel/qapplication.cpp:4242
#45 0x00000039aefc1ada in QApplication::notify (this=<value optimized out>, receiver=<value optimized out>, e=<value optimized out>) at kernel/qapplication.cpp:4125
#46 0x00007f04fc55660a in App::notify (this=0x7f04fbfdee60, receiver=0x0, event=0x1785fb0) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/App.cpp:845
#47 0x00000039add6b2eb in QCoreApplication::notifyInternal (this=<value optimized out>, receiver=<value optimized out>, event=<value optimized out>) at kernel/qcoreapplication.cpp:704
#48 0x00000039add6da36 in QCoreApplication::sendEvent (receiver=<value optimized out>, event_type=<value optimized out>, data=<value optimized out>) at kernel/qcoreapplication.h:215
#49 QCoreApplicationPrivate::sendPostedEvents (receiver=<value optimized out>, event_type=<value optimized out>, data=<value optimized out>) at kernel/qcoreapplication.cpp:1345
#50 0x00000039add94bf3 in QCoreApplication::sendPostedEvents (s=<value optimized out>) at kernel/qcoreapplication.h:220
#51 postEventSourceDispatch (s=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:276
#52 0x00000030a323b4cd in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#53 0x00000030a323ee88 in ?? () from /usr/lib/libglib-2.0.so.0
#54 0x00000030a323efb0 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#55 0x00000039add94733 in QEventDispatcherGlib::processEvents (this=<value optimized out>, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:407
#56 0x00000039af05555e in QGuiEventDispatcherGlib::processEvents (this=<value optimized out>, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:202
#57 0x00000039add69c42 in QEventLoop::processEvents (this=<value optimized out>, flags=<value optimized out>) at kernel/qeventloop.cpp:149
#58 0x00000039add6a014 in QEventLoop::exec (this=<value optimized out>, flags=<value optimized out>) at kernel/qeventloop.cpp:201
#59 0x00000039add6dcfb in QCoreApplication::exec () at kernel/qcoreapplication.cpp:981
#60 0x000000000040876c in main (argc=2, argv=<value optimized out>) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/main.cpp:235
*****************************************************************************

After restart, Amarok correctly shows collection scanned in previous run. Start incremental scan and works correctly.  

When I now run full scan with data in database, I get BT below. Scan did not finish, Amarok crashes on 77%. And continue crashing in each start.

*****************************************************************************
Thread 8 (Thread 0x7f702e2e3710 (LWP 17241)):
[KCrash Handler]
#5  QBasicAtomicInt::ref (this=0x7f702e2e1f70, url=..., uid=...) at /usr/include/qt4/QtCore/qatomic_x86_64.h:121
#6  QList<QString>::operator= (this=0x7f702e2e1f70, url=..., uid=...) at /usr/include/qt4/QtCore/qlist.h:411
#7  operator= (this=0x7f702e2e1f70, url=..., uid=...) at /usr/include/qt4/QtCore/qstringlist.h:67
#8  ScanResultProcessor::urlId (this=0x7f702e2e1f70, url=..., uid=...) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/collection/sqlcollection/ScanResultProcessor.cpp:673
#9  0x00007f70382cbac4 in ScanResultProcessor::addTrack (this=0x7f702e2e1f70, trackData=..., albumArtistId=<value optimized out>)
    at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/collection/sqlcollection/ScanResultProcessor.cpp:413
#10 0x00007f70382d698f in ScanResultProcessor::processDirectory (this=0x7f702e2e1f70, data=<value optimized out>)
    at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/collection/sqlcollection/ScanResultProcessor.cpp:274
#11 0x00007f70382c06fa in XmlParseJob::run (this=0x7f703478c8b0) at /var/tmp/portage/media-sound/amarok-9999/work/amarok-9999/src/collection/sqlcollection/ScanManager.cpp:776
#12 0x00000039b380e001 in ThreadWeaver::JobRunHelper::runTheJob (this=<value optimized out>, th=<value optimized out>, job=<value optimized out>)
    at /var/tmp/portage/kde-base/kdelibs-4.3.4/work/kdelibs-4.3.4/threadweaver/Weaver/Job.cpp:106
#13 0x00000039b380e1d9 in ThreadWeaver::Job::execute (this=<value optimized out>, th=<value optimized out>)
    at /var/tmp/portage/kde-base/kdelibs-4.3.4/work/kdelibs-4.3.4/threadweaver/Weaver/Job.cpp:135
#14 0x00000039b380d64f in ThreadWeaver::ThreadRunHelper::run (this=<value optimized out>, parent=<value optimized out>, th=<value optimized out>)
    at /var/tmp/portage/kde-base/kdelibs-4.3.4/work/kdelibs-4.3.4/threadweaver/Weaver/Thread.cpp:95
#15 0x00000039b380d794 in ThreadWeaver::Thread::run (this=<value optimized out>) at /var/tmp/portage/kde-base/kdelibs-4.3.4/work/kdelibs-4.3.4/threadweaver/Weaver/Thread.cpp:142
#16 0x00000039adc791d5 in QThreadPrivate::start (arg=<value optimized out>) at thread/qthread_unix.cpp:244
#17 0x00007f704140d894 in start_thread (arg=<value optimized out>) at pthread_create.c:297
#18 0x00007f70416f3f9d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#19 0x0000000000000000 in ?? ()
*****************************************************************************
Comment 38 Marian Kyral 2010-01-05 22:14:46 UTC
Created attachment 39598 [details]
Full logs for all three cases

1) amarok_full_wipe_dba.log   - wipe database
2) amarok_full_wipe_dba_2.log - correct start after first crash
3) amarok_full_non_wipe.log   - crash after forced full scan with non wipe database
Comment 39 Mikko C. 2010-01-07 17:13:24 UTC
*** Bug 221674 has been marked as a duplicate of this bug. ***
Comment 40 Jeff Mitchell 2010-01-08 04:11:15 UTC
Created attachment 39676 [details]
Patch against 2.2.2 tag

Hi guys/gals,

Please test this patch ASAP.

You need to be sure to apply this against tagged 2.2.2. To do this, do:

git reset --hard v2.2.2

If you have updated to current HEAD and built current Amarok, make sure you clean your build dir...if you've installed it onto your filesystem somewhere, try to manually remove those files -- the names of some libraries may have changed and you could end up with cruft making things confusing.

Let me know how it goes.

Thanks!
Comment 41 Jussi Kekkonen 2010-01-08 06:25:53 UTC
How boring is this, no more crash here after applying a patch. Thanks Jeff for your heavy work. (:
Hopefully others have similar results.
Comment 42 Mikko C. 2010-01-08 09:13:46 UTC
The patch does indeed solve the crash Jeff!
But as you might already know, out of the two songs with identical MB ids, only one is added to the collection: the one that is scanned last I guess.
Comment 43 Jeff Mitchell 2010-01-08 13:42:36 UTC
(In reply to comment #42)
> The patch does indeed solve the crash Jeff!
> But as you might already know, out of the two songs with identical MB ids, only
> one is added to the collection: the one that is scanned last I guess.

Applicable to all on this bug:

It's true. The identifier is supposed to be globally unique to that track. You can't exactly fault Amarok for thinking that a unique identifier shouldn't be shared by the same file. You should probably submit a report to MusicBrainz about this (though try retagging it in Picard first).

There's a chance that most of you experiencing this crash have a similar situation -- two files with the exact same ID, either through duplication of a file tagged by amarok_afttagger or from MusicBrainz issues. If you have a random file not showing up in the collection, it's likely that this is the cause.

The good news is that there is a workaround:

1) If there are duplicated MBIDs and those can't be fixed by Picard, run amarok_afttagger on those files (currently MP3s, Ogg/Vorbis, Ogg/FLAC, and FLAC is supported). The AFT tag is preferred over the MBID.

2) If they were already tagged with amarok_afttagger, then probably you have actual duplicate files, where the file was copied at some point with that generated value in the tag. In this case you can run amarok_afttagger with the --newid flag to regenerate them, which will re-randomize the values.
Comment 44 Jeff Mitchell 2010-01-08 13:57:46 UTC
commit d35f708aec3b882dfc26484f157ac028259444e8
Author: Jeff Mitchell <mitchell@kde.org>
Date:   Fri Jan 8 07:45:12 2010 -0500

    Fix a crash in ScanResultProcessor's destructor.
    
    Despite all the extra checks I put for null pointers in the destructor,
    this wasn't actually the problem. The problem, which could occur in a
    few ways, was that in certain instances values were either not removed
    from a hash when they should have been, or added to a hash when they
    shouldn't have been. Then when the destructor ran, it would hit two
    values pointing to the same QStringList, and the second access would
    cause a crash.
    
    Thanks to Mikko for doing some heavy legwork helping me narrow down the
    cause, and Tm_T and hyper_ch for their help.
    
    BUG: 220532

diff --git a/src/collection/sqlcollection/ScanResultProcessor.cpp b/src/collection/sqlcollection/ScanResultProcessor.cpp
index f4bcaf2..d349c9a 100644
--- a/src/collection/sqlcollection/ScanResultProcessor.cpp
+++ b/src/collection/sqlcollection/ScanResultProcessor.cpp
@@ -42,18 +42,33 @@ ScanResultProcessor::~ScanResultProcessor()
 {
     //everything has a URL, so enough to just delete from here
     foreach( QStringList *list, m_urlsHashByUid )
-        delete list;
+    {
+        if( list )
+            delete list;
+    }
     foreach( QLinkedList<QStringList*> *list, m_albumsHashByName )
     {
-        foreach( QStringList *slist, *list )
-            delete slist;
-        delete list;
+        if( list )
+        {
+            foreach( QStringList *slist, *list )
+            {
+                if( slist )
+                   delete slist;
+            }
+            delete list;
+        }
     }
     foreach( QLinkedList<QStringList*> *list, m_tracksHashByAlbum )
     {
-        foreach( QStringList *slist, *list )
-            delete slist;
-        delete list;
+        if( list )
+        {
+            foreach( QStringList *slist, *list )
+            {
+                if( slist )
+                    delete slist;
+            }
+            delete list;
+        }
     }
 }
 
@@ -67,10 +82,10 @@ void
 ScanResultProcessor::addDirectory( const QString &dir, uint mtime )
 {
     DEBUG_BLOCK
-    debug() << "SRP::addDirectory on " << dir << " with mtime " << mtime;
+    //debug() << "SRP::addDirectory on " << dir << " with mtime " << mtime;
     if( dir.isEmpty() )
     {
-        debug() << "got directory with no path from the scanner, not adding";
+        //debug() << "got directory with no path from the scanner, not adding";
         return;
     }
     setupDatabase();
@@ -418,7 +433,15 @@ ScanResultProcessor::addTrack( const QVariantMap &trackData, int albumArtistId )
 
     //urlId will take care of the urls table part of AFT
     int url = urlId( path, uid );
-
+/*
+    foreach( QString key, m_urlsHashByUid.keys() )
+    debug() << "Key: " << key << ", list: " << *m_urlsHashByUid[key];
+    foreach( int key, m_urlsHashById.keys() )
+    debug() << "Key: " << key << ", list: " << *m_urlsHashById[key];
+    typedef QPair<int, QString> blahType; //QFOREACH is stupid when it comes to QPairs
+    foreach( blahType key, m_urlsHashByLocation.keys() )
+    debug() << "Key: " << key << ", list: " << *m_urlsHashByLocation[key];
+*/
     QStringList *trackList = new QStringList();
     int id = m_nextTrackNum;
     //debug() << "Appending new track number with tracknum: " << id;
@@ -469,7 +492,7 @@ ScanResultProcessor::addTrack( const QVariantMap &trackData, int albumArtistId )
     //insert into hashes
     if( m_tracksHashByUrl.contains( url ) && m_tracksHashByUrl[url] != 0 )
     {
-        //debug() << "m_tracksHashByUrl contains the url!";
+        //debug() << "m_tracksHashByUrl already contains url " << url;
         //need to replace, not overwrite/add a new one
         QStringList *oldValues = m_tracksHashByUrl[url];
         QString oldId = oldValues->at( 0 );
@@ -490,7 +513,12 @@ ScanResultProcessor::addTrack( const QVariantMap &trackData, int albumArtistId )
     }
 
     if( m_tracksHashByAlbum.contains( album ) && m_tracksHashByAlbum[album] != 0 )
-        m_tracksHashByAlbum[album]->append( trackList );
+    {
+        //contains isn't the fastest on linked lists, but in reality this is on the order of maybe
+        //ten quick pointer comparisons per track on average...probably lower
+        if( !m_tracksHashByAlbum[album]->contains( trackList ) )
+            m_tracksHashByAlbum[album]->append( trackList );
+    }
     else
     {
         QLinkedList<QStringList*> *list = new QLinkedList<QStringList*>();
@@ -630,7 +658,10 @@ ScanResultProcessor::albumInsert( const QString &album, int albumArtistId )
     albumList->append( QString() );
     m_albumsHashById[returnedNum] = albumList;
     if( m_albumsHashByName.contains( album ) && m_albumsHashByName[album] != 0 )
-        m_albumsHashByName[album]->append( albumList );
+    {
+        if( !m_albumsHashByName[album]->contains( albumList ) )
+            m_albumsHashByName[album]->append( albumList );
+    }
     else
     {
         QLinkedList<QStringList*> *list = new QLinkedList<QStringList*>();
@@ -644,8 +675,8 @@ ScanResultProcessor::albumInsert( const QString &album, int albumArtistId )
 int
 ScanResultProcessor::urlId( const QString &url, const QString &uid )
 {
-    /*
     DEBUG_BLOCK
+/*
     foreach( QString key, m_urlsHashByUid.keys() )
     debug() << "Key: " << key << ", list: " << *m_urlsHashByUid[key];
     foreach( int key, m_urlsHashById.keys() )
@@ -653,8 +684,8 @@ ScanResultProcessor::urlId( const QString &url, const QString &uid )
     typedef QPair<int, QString> blahType; //QFOREACH is stupid when it comes to QPairs
     foreach( blahType key, m_urlsHashByLocation.keys() )
     debug() << "Key: " << key << ", list: " << *m_urlsHashByLocation[key];
-    */
- 
+*/
+
     QFileInfo fileInfo( url );
     const QString dir = fileInfo.absoluteDir().absolutePath();
     int dirId = directoryId( dir );
@@ -664,6 +695,7 @@ ScanResultProcessor::urlId( const QString &url, const QString &uid )
     QPair<int, QString> locationPair( deviceId, rpath );
     //debug() << "in urlId with url = " << url << " and uid = " << uid;
     //debug() << "checking locationPair " << locationPair;
+/*
     if( m_urlsHashByLocation.contains( locationPair ) )
     {
         QStringList values;
@@ -673,6 +705,7 @@ ScanResultProcessor::urlId( const QString &url, const QString &uid )
             values << "zero";
         //debug() << "m_urlsHashByLocation contains it! It is " << values;
     }
+*/
     QStringList currUrlIdValues;
     if( m_urlsHashByUid.contains( uid ) && m_urlsHashByUid[uid] != 0 )
         currUrlIdValues = *m_urlsHashByUid[uid];
@@ -716,6 +749,7 @@ ScanResultProcessor::urlId( const QString &url, const QString &uid )
             //debug() << "m_urlsHashByUid contains this UID, updating deviceId and path";
             QStringList *list = m_urlsHashByUid[uid];
             //debug() << "list from UID hash is " << list << " with values " << *list;
+            QPair<int, QString> oldLocationPair( list->at( 1 ).toInt(), list->at( 2 ) );
             list->replace( 1, QString::number( deviceId ) );
             list->replace( 2, rpath );
             list->replace( 3, QString::number( dirId ) );
@@ -736,6 +770,7 @@ ScanResultProcessor::urlId( const QString &url, const QString &uid )
                 delete oldList;
             }
             m_urlsHashByLocation[locationPair] = list;
+            m_urlsHashByLocation.remove( oldLocationPair );
         }
         m_permanentTablesUrlUpdates.insert( uid, url );
         m_changedUrls.insert( uid, QPair<QString, QString>( m_collection->mountPointManager()->getAbsolutePath( currUrlIdValues[1].toInt(), currUrlIdValues[2] ), url ) );
@@ -750,6 +785,7 @@ ScanResultProcessor::urlId( const QString &url, const QString &uid )
         {
             QStringList *list = m_urlsHashByLocation[locationPair];
             //debug() << "Replacing hash " << list->at( 4 ) << " with " << uid;
+            QString oldId = list->at( 4 );
             list->replace( 4, uid );
             if( m_urlsHashByUid.contains( uid )
                 && m_urlsHashByUid[uid] != 0 
@@ -761,6 +797,7 @@ ScanResultProcessor::urlId( const QString &url, const QString &uid )
                 delete oldList;
             }
             m_urlsHashByUid[uid] = list;
+            m_urlsHashByUid.remove( oldId );
         }
         m_permanentTablesUidUpdates.insert( url, uid );
         m_changedUids.insert( currUrlIdValues[4], uid );
@@ -1166,6 +1203,18 @@ ScanResultProcessor::copyHashesToTempTables()
     foreach( blahType key, m_urlsHashByLocation.keys() )
         debug() << "Key: " << key << ", list: " << *m_urlsHashByLocation[key];
     debug() << "Next album num: " << m_nextAlbumNum;
+
+    foreach( int key, m_tracksHashById.keys() )
+        debug() << "Key: " << key << ", list: " << *m_tracksHashById[key];
+    foreach( int key, m_tracksHashByUrl.keys() )
+        debug() << "Key: " << key << ", list: " << *m_tracksHashByUrl[key];
+    typedef QLinkedList<QStringList*> blahType; //QFOREACH is stupid when it comes to QPairs
+    foreach( int key, m_tracksHashByAlbum.keys() )
+    {
+        debug() << "Key: " << key;
+        foreach( QStringList* item, *m_tracksHashByAlbum[key] )
+            debug() << "list: " << *item;
+    }
     */
  
     DEBUG_BLOCK
Comment 45 Jeff Mitchell 2010-01-08 13:58:38 UTC
commit d35f708aec3b882dfc26484f157ac028259444e8
Author: Jeff Mitchell <mitchell@kde.org>
Date:   Fri Jan 8 07:45:12 2010 -0500

    Fix a crash in ScanResultProcessor's destructor.
    
    Despite all the extra checks I put for null pointers in the destructor,
    this wasn't actually the problem. The problem, which could occur in a
    few ways, was that in certain instances values were either not removed
    from a hash when they should have been, or added to a hash when they
    shouldn't have been. Then when the destructor ran, it would hit two
    values pointing to the same QStringList, and the second access would
    cause a crash.
    
    Thanks to Mikko for doing some heavy legwork helping me narrow down the
    cause, and Tm_T and hyper_ch for their help.
    
    BUG: 220532

diff --git a/src/collection/sqlcollection/ScanResultProcessor.cpp b/src/collection/sqlcollection/ScanResultProcessor.cpp
index f4bcaf2..d349c9a 100644
--- a/src/collection/sqlcollection/ScanResultProcessor.cpp
+++ b/src/collection/sqlcollection/ScanResultProcessor.cpp
@@ -42,18 +42,33 @@ ScanResultProcessor::~ScanResultProcessor()
 {
     //everything has a URL, so enough to just delete from here
     foreach( QStringList *list, m_urlsHashByUid )
-        delete list;
+    {
+        if( list )
+            delete list;
+    }
     foreach( QLinkedList<QStringList*> *list, m_albumsHashByName )
     {
-        foreach( QStringList *slist, *list )
-            delete slist;
-        delete list;
+        if( list )
+        {
+            foreach( QStringList *slist, *list )
+            {
+                if( slist )
+                   delete slist;
+            }
+            delete list;
+        }
     }
     foreach( QLinkedList<QStringList*> *list, m_tracksHashByAlbum )
     {
-        foreach( QStringList *slist, *list )
-            delete slist;
-        delete list;
+        if( list )
+        {
+            foreach( QStringList *slist, *list )
+            {
+                if( slist )
+                    delete slist;
+            }
+            delete list;
+        }
     }
 }
 
@@ -67,10 +82,10 @@ void
 ScanResultProcessor::addDirectory( const QString &dir, uint mtime )
 {
     DEBUG_BLOCK
-    debug() << "SRP::addDirectory on " << dir << " with mtime " << mtime;
+    //debug() << "SRP::addDirectory on " << dir << " with mtime " << mtime;
     if( dir.isEmpty() )
     {
-        debug() << "got directory with no path from the scanner, not adding";
+        //debug() << "got directory with no path from the scanner, not adding";
         return;
     }
     setupDatabase();
@@ -418,7 +433,15 @@ ScanResultProcessor::addTrack( const QVariantMap &trackData, int albumArtistId )
 
     //urlId will take care of the urls table part of AFT
     int url = urlId( path, uid );
-
+/*
+    foreach( QString key, m_urlsHashByUid.keys() )
+    debug() << "Key: " << key << ", list: " << *m_urlsHashByUid[key];
+    foreach( int key, m_urlsHashById.keys() )
+    debug() << "Key: " << key << ", list: " << *m_urlsHashById[key];
+    typedef QPair<int, QString> blahType; //QFOREACH is stupid when it comes to QPairs
+    foreach( blahType key, m_urlsHashByLocation.keys() )
+    debug() << "Key: " << key << ", list: " << *m_urlsHashByLocation[key];
+*/
     QStringList *trackList = new QStringList();
     int id = m_nextTrackNum;
     //debug() << "Appending new track number with tracknum: " << id;
@@ -469,7 +492,7 @@ ScanResultProcessor::addTrack( const QVariantMap &trackData, int albumArtistId )
     //insert into hashes
     if( m_tracksHashByUrl.contains( url ) && m_tracksHashByUrl[url] != 0 )
     {
-        //debug() << "m_tracksHashByUrl contains the url!";
+        //debug() << "m_tracksHashByUrl already contains url " << url;
         //need to replace, not overwrite/add a new one
         QStringList *oldValues = m_tracksHashByUrl[url];
         QString oldId = oldValues->at( 0 );
@@ -490,7 +513,12 @@ ScanResultProcessor::addTrack( const QVariantMap &trackData, int albumArtistId )
     }
 
     if( m_tracksHashByAlbum.contains( album ) && m_tracksHashByAlbum[album] != 0 )
-        m_tracksHashByAlbum[album]->append( trackList );
+    {
+        //contains isn't the fastest on linked lists, but in reality this is on the order of maybe
+        //ten quick pointer comparisons per track on average...probably lower
+        if( !m_tracksHashByAlbum[album]->contains( trackList ) )
+            m_tracksHashByAlbum[album]->append( trackList );
+    }
     else
     {
         QLinkedList<QStringList*> *list = new QLinkedList<QStringList*>();
@@ -630,7 +658,10 @@ ScanResultProcessor::albumInsert( const QString &album, int albumArtistId )
     albumList->append( QString() );
     m_albumsHashById[returnedNum] = albumList;
     if( m_albumsHashByName.contains( album ) && m_albumsHashByName[album] != 0 )
-        m_albumsHashByName[album]->append( albumList );
+    {
+        if( !m_albumsHashByName[album]->contains( albumList ) )
+            m_albumsHashByName[album]->append( albumList );
+    }
     else
     {
         QLinkedList<QStringList*> *list = new QLinkedList<QStringList*>();
@@ -644,8 +675,8 @@ ScanResultProcessor::albumInsert( const QString &album, int albumArtistId )
 int
 ScanResultProcessor::urlId( const QString &url, const QString &uid )
 {
-    /*
     DEBUG_BLOCK
+/*
     foreach( QString key, m_urlsHashByUid.keys() )
     debug() << "Key: " << key << ", list: " << *m_urlsHashByUid[key];
     foreach( int key, m_urlsHashById.keys() )
@@ -653,8 +684,8 @@ ScanResultProcessor::urlId( const QString &url, const QString &uid )
     typedef QPair<int, QString> blahType; //QFOREACH is stupid when it comes to QPairs
     foreach( blahType key, m_urlsHashByLocation.keys() )
     debug() << "Key: " << key << ", list: " << *m_urlsHashByLocation[key];
-    */
- 
+*/
+
     QFileInfo fileInfo( url );
     const QString dir = fileInfo.absoluteDir().absolutePath();
     int dirId = directoryId( dir );
@@ -664,6 +695,7 @@ ScanResultProcessor::urlId( const QString &url, const QString &uid )
     QPair<int, QString> locationPair( deviceId, rpath );
     //debug() << "in urlId with url = " << url << " and uid = " << uid;
     //debug() << "checking locationPair " << locationPair;
+/*
     if( m_urlsHashByLocation.contains( locationPair ) )
     {
         QStringList values;
@@ -673,6 +705,7 @@ ScanResultProcessor::urlId( const QString &url, const QString &uid )
             values << "zero";
         //debug() << "m_urlsHashByLocation contains it! It is " << values;
     }
+*/
     QStringList currUrlIdValues;
     if( m_urlsHashByUid.contains( uid ) && m_urlsHashByUid[uid] != 0 )
         currUrlIdValues = *m_urlsHashByUid[uid];
@@ -716,6 +749,7 @@ ScanResultProcessor::urlId( const QString &url, const QString &uid )
             //debug() << "m_urlsHashByUid contains this UID, updating deviceId and path";
             QStringList *list = m_urlsHashByUid[uid];
             //debug() << "list from UID hash is " << list << " with values " << *list;
+            QPair<int, QString> oldLocationPair( list->at( 1 ).toInt(), list->at( 2 ) );
             list->replace( 1, QString::number( deviceId ) );
             list->replace( 2, rpath );
             list->replace( 3, QString::number( dirId ) );
@@ -736,6 +770,7 @@ ScanResultProcessor::urlId( const QString &url, const QString &uid )
                 delete oldList;
             }
             m_urlsHashByLocation[locationPair] = list;
+            m_urlsHashByLocation.remove( oldLocationPair );
         }
         m_permanentTablesUrlUpdates.insert( uid, url );
         m_changedUrls.insert( uid, QPair<QString, QString>( m_collection->mountPointManager()->getAbsolutePath( currUrlIdValues[1].toInt(), currUrlIdValues[2] ), url ) );
@@ -750,6 +785,7 @@ ScanResultProcessor::urlId( const QString &url, const QString &uid )
         {
             QStringList *list = m_urlsHashByLocation[locationPair];
             //debug() << "Replacing hash " << list->at( 4 ) << " with " << uid;
+            QString oldId = list->at( 4 );
             list->replace( 4, uid );
             if( m_urlsHashByUid.contains( uid )
                 && m_urlsHashByUid[uid] != 0 
@@ -761,6 +797,7 @@ ScanResultProcessor::urlId( const QString &url, const QString &uid )
                 delete oldList;
             }
             m_urlsHashByUid[uid] = list;
+            m_urlsHashByUid.remove( oldId );
         }
         m_permanentTablesUidUpdates.insert( url, uid );
         m_changedUids.insert( currUrlIdValues[4], uid );
@@ -1166,6 +1203,18 @@ ScanResultProcessor::copyHashesToTempTables()
     foreach( blahType key, m_urlsHashByLocation.keys() )
         debug() << "Key: " << key << ", list: " << *m_urlsHashByLocation[key];
     debug() << "Next album num: " << m_nextAlbumNum;
+
+    foreach( int key, m_tracksHashById.keys() )
+        debug() << "Key: " << key << ", list: " << *m_tracksHashById[key];
+    foreach( int key, m_tracksHashByUrl.keys() )
+        debug() << "Key: " << key << ", list: " << *m_tracksHashByUrl[key];
+    typedef QLinkedList<QStringList*> blahType; //QFOREACH is stupid when it comes to QPairs
+    foreach( int key, m_tracksHashByAlbum.keys() )
+    {
+        debug() << "Key: " << key;
+        foreach( QStringList* item, *m_tracksHashByAlbum[key] )
+            debug() << "list: " << *item;
+    }
     */
  
     DEBUG_BLOCK
Comment 46 Marian Kyral 2010-01-08 14:01:46 UTC
Hi,
I just tested the patch (continue #37). After scan, amarok crashed, but not BT generated :-(

Then I started Amarok again - database was updated. I forced full scan. Amarok crashed again with following BT. I'll do more tests evening.

Thread 5 (Thread 0x7f79c6079710 (LWP 14045)):
[KCrash Handler]
#5  malloc_consolidate (av=<value optimized out>) at malloc.c:5136
#6  0x000000336be73d68 in _int_free (av=<value optimized out>, p=<value optimized out>) at malloc.c:5015
#7  0x000000336be771ac in *__GI___libc_free (mem=<value optimized out>) at malloc.c:3738
#8  0x0000003374e94d8d in QHashData::free_helper (this=<value optimized out>, node_delete=<value optimized out>) at tools/qhash.cpp:281
#9  0x00007f79d2060436 in ~ScanResultProcessor (this=0x7f79c6078270, __in_chrg=<value optimized out>) at /home/marian/data/amarok/src/collection/sqlcollection/ScanResultProcessor.cpp:74
#10 0x00007f79d2056225 in XmlParseJob::run (this=<value optimized out>) at /home/marian/data/amarok/src/collection/sqlcollection/ScanManager.cpp:855
#11 0x000000337c60e001 in ThreadWeaver::JobRunHelper::runTheJob (this=<value optimized out>, th=<value optimized out>, job=<value optimized out>)
    at /var/tmp/portage/kde-base/kdelibs-4.3.4/work/kdelibs-4.3.4/threadweaver/Weaver/Job.cpp:106
#12 0x000000337c60e1d9 in ThreadWeaver::Job::execute (this=<value optimized out>, th=<value optimized out>)
    at /var/tmp/portage/kde-base/kdelibs-4.3.4/work/kdelibs-4.3.4/threadweaver/Weaver/Job.cpp:135
#13 0x000000337c60d64f in ThreadWeaver::ThreadRunHelper::run (this=<value optimized out>, parent=<value optimized out>, th=<value optimized out>)
    at /var/tmp/portage/kde-base/kdelibs-4.3.4/work/kdelibs-4.3.4/threadweaver/Weaver/Thread.cpp:95
#14 0x000000337c60d794 in ThreadWeaver::Thread::run (this=<value optimized out>) at /var/tmp/portage/kde-base/kdelibs-4.3.4/work/kdelibs-4.3.4/threadweaver/Weaver/Thread.cpp:142
#15 0x0000003374e791d5 in QThreadPrivate::start (arg=<value optimized out>) at thread/qthread_unix.cpp:244
#16 0x000000336ca06894 in start_thread (arg=<value optimized out>) at pthread_create.c:297
#17 0x000000336bed0f9d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#18 0x0000000000000000 in ?? ()

--------- amarok last messages ------------
amarok:   END__: int ScanResultProcessor::urlId(const QString&, const QString&) - Took 9.1e-05s
amarok:   BEGIN: int ScanResultProcessor::urlId(const QString&, const QString&)
amarok:   END__: int ScanResultProcessor::urlId(const QString&, const QString&) - Took 8.7e-05s
amarok:    Success. Committing result to database.
amarok:   BEGIN: int ScanResultProcessor::urlId(const QString&, const QString&)
amarok:   END__: int ScanResultProcessor::urlId(const QString&, const QString&) - Took 0.0012s
amarok:   BEGIN: int ScanResultProcessor::urlId(const QString&, const QString&)
amarok:   END__: int ScanResultProcessor::urlId(const QString&, const QString&) - Took 0.0007s
amarok:   BEGIN: int ScanResultProcessor::urlId(const QString&, const QString&)
amarok:   END__: int ScanResultProcessor::urlId(const QString&, const QString&) - Took 9.3e-05s
amarok:   BEGIN: int ScanResultProcessor::urlId(const QString&, const QString&)
amarok:   END__: int ScanResultProcessor::urlId(const QString&, const QString&) - Took 8.7e-05s
amarok:   BEGIN: int ScanResultProcessor::urlId(const QString&, const QString&)
amarok:   END__: int ScanResultProcessor::urlId(const QString&, const QString&) - Took 0.00012s
amarok:   BEGIN: int ScanResultProcessor::urlId(const QString&, const QString&)
amarok:   END__: int ScanResultProcessor::urlId(const QString&, const QString&) - Took 9e-05s
amarok:   BEGIN: int ScanResultProcessor::urlId(const QString&, const QString&)
amarok:   END__: int ScanResultProcessor::urlId(const QString&, const QString&) - Took 9.4e-05s
amarok:   BEGIN: void ScanManager::slotFinished()
amarok:     BEGIN: int ScanResultProcessor::urlId(const QString&, const QString&)
amarok:     END__: void ScanManager::slotFinished() - Took 0.00015s
amarok:   END__: int ScanResultProcessor::urlId(const QString&, const QString&) - Took 0.00021s
amarok:   BEGIN: int ScanResultProcessor::urlId(const QString&, const QString&)
amarok:   END__: int ScanResultProcessor::urlId(const QString&, const QString&) - Took 9.4e-05s
amarok:   BEGIN: int ScanResultProcessor::urlId(const QString&, const QString&)
amarok:   END__: int ScanResultProcessor::urlId(const QString&, const QString&) - Took 0.00011s
amarok:   BEGIN: void DatabaseUpdater::cleanPermanentTables()
amarok:   END__: void DatabaseUpdater::cleanPermanentTables() - Took 0.0019s
amarok:   BEGIN: void ScanResultProcessor::copyHashesToTempTables()
amarok:      obtained max_allowed_packet is  "1048576"
amarok:      urls key size is  7109
amarok:      tracks key size is  7114
amarok:   END__: void ScanResultProcessor::copyHashesToTempTables() - Took 0.94s
amarok:    temp_tracks:  ("7114")
amarok:    tracks before commit:  ("0")
amarok:   BEGIN: void DatabaseUpdater::copyToPermanentTables()
amarok:   END__: void DatabaseUpdater::copyToPermanentTables() - Took 0.66s
amarok:   BEGIN: virtual void Dynamic::BiasedPlaylist::invalidate()
amarok:   END__: virtual void Dynamic::BiasedPlaylist::invalidate() - Took 0.00012s
amarok:    tracks after commit:  ("7114")
amarok:   BEGIN: void DatabaseUpdater::removeTemporaryTables()
amarok:   END__: void DatabaseUpdater::removeTemporaryTables() - Took 0.14s
amarok:    Sending changed signal
amarok:   BEGIN: virtual void Dynamic::BiasedPlaylist::invalidate()
amarok:   END__: virtual void Dynamic::BiasedPlaylist::invalidate() - Took 6.5e-05s
amarok:   BEGIN: void SqlCollection::updateTrackUrlsUids(const ChangedTrackUrls&, const QHash<QString, QString>&)
amarok:   END__: void SqlCollection::updateTrackUrlsUids(const ChangedTrackUrls&, const QHash<QString, QString>&) - Took 0.03s
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = amarok path = <unknown> pid = 14019
sock_file=/home/marian/.kde4/socket-gool/kdeinit4_localhost_10
kdeinit4: Got EXEC_NEW '/usr/lib64/kde4/libexec/drkonqi' from wrapper.
kdeinit4: preparing to launch /usr/lib64/kde4/libexec/drkonqi
QSocketNotifier: Invalid socket 45 and type 'Read', disabling...
kio_http(14058)/kio (TCPSlaveBase) KIO::TCPSlaveBase::disconnectFromHost:
Comment 47 Jeff Mitchell 2010-01-08 14:17:01 UTC
Marian,

Is it possible for you to be available today on IRC and/or IM? It would really help if I can work through this with you directly...we want to get this patch fixed up for packagers before 2.2.2 releases. (You can email me contact info at mitchell@kde.org instead of posting here). 

Thanks!
Comment 48 Marian Kyral 2010-01-08 17:25:08 UTC
Hi,
I wiped out the database and amarok crashed with a message:

*** glibc detected *** amarok: corrupted double-linked list: 0x00007fcf78a452e0 ***

Thread 1 (Thread 0x7fcf897c27a0 (LWP 24139)):
[KCrash Handler]
#5  0x000000336be321b5 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#6  0x000000336be335e0 in *__GI_abort () at abort.c:92
#7  0x000000336be6ce77 in __libc_message (do_abort=<value optimized out>, fmt=<value optimized out>) at ../sysdeps/unix/sysv/linux/libc_fatal.c:186
#8  0x000000336be72406 in malloc_printerr (action=<value optimized out>, str=<value optimized out>, ptr=<value optimized out>) at malloc.c:6264
#9  0x000000336be7283d in malloc_consolidate (av=<value optimized out>) at malloc.c:5142
#10 0x000000336be74ba4 in _int_malloc (av=<value optimized out>, bytes=<value optimized out>) at malloc.c:4370
#11 0x000000336be77290 in *__GI___libc_malloc (bytes=<value optimized out>) at malloc.c:3660
#12 0x0000003374e96f7d in QListData::detach3 (this=<value optimized out>) at tools/qlist.cpp:137
#13 0x00007fcf89dcf08b in QList<KSharedPtr<Meta::Track> >::detach_helper (this=0x7fffa44b8d70) at /usr/include/qt4/QtCore/qlist.h:604
#14 0x00007fcf89df6f97 in QList<KSharedPtr<Meta::Track> >::operator[] (this=0x7fffa44b8d70, i=0) at /usr/include/qt4/QtCore/qlist.h:448
#15 0x00007fcf89df6476 in CollectionSortFilterProxyModel::albumYear (this=<value optimized out>, album=) at /home/marian/data/amarok/src/browsers/CollectionSortFilterProxyModel.cpp:150
#16 0x00007fcf89df69f2 in CollectionSortFilterProxyModel::lessThanAlbum (this=0x7fcf782515c0, left=..., right=...) at /home/marian/data/amarok/src/browsers/CollectionSortFilterProxyModel.cpp:125
#17 0x00007fcf89df6bae in CollectionSortFilterProxyModel::lessThan (this=0x7fcf782515c0, left=..., right=...) at /home/marian/data/amarok/src/browsers/CollectionSortFilterProxyModel.cpp:63
#18 0x0000003377ed9bba in void QAlgorithmsPrivate::qMerge<int*, int const, QSortFilterProxyModelLessThan>(int*, int*, int*, int const&, QSortFilterProxyModelLessThan) ()
   from /usr/lib64/qt4/libQtGui.so.4
#19 0x0000003377ed99c7 in void QAlgorithmsPrivate::qMerge<int*, int const, QSortFilterProxyModelLessThan>(int*, int*, int*, int const&, QSortFilterProxyModelLessThan) ()
   from /usr/lib64/qt4/libQtGui.so.4
#20 0x0000003377ed9d32 in void QAlgorithmsPrivate::qStableSortHelper<int*, int, QSortFilterProxyModelLessThan>(int*, int*, int const&, QSortFilterProxyModelLessThan) ()
   from /usr/lib64/qt4/libQtGui.so.4
#21 0x0000003377ed9cd2 in void QAlgorithmsPrivate::qStableSortHelper<int*, int, QSortFilterProxyModelLessThan>(int*, int*, int const&, QSortFilterProxyModelLessThan) ()
   from /usr/lib64/qt4/libQtGui.so.4
#22 0x0000003377ed9cd2 in void QAlgorithmsPrivate::qStableSortHelper<int*, int, QSortFilterProxyModelLessThan>(int*, int*, int const&, QSortFilterProxyModelLessThan) ()
   from /usr/lib64/qt4/libQtGui.so.4
#23 0x0000003377ed9c72 in void QAlgorithmsPrivate::qStableSortHelper<int*, int, QSortFilterProxyModelLessThan>(int*, int*, int const&, QSortFilterProxyModelLessThan) ()
   from /usr/lib64/qt4/libQtGui.so.4
#24 0x0000003377ed10af in qStableSort<int*, QSortFilterProxyModelLessThan> (this=<value optimized out>, source_rows=<value optimized out>, source_parent=<value optimized out>)
    at ../../include/QtCore/../../src/corelib/tools/qalgorithms.h:212
#25 QSortFilterProxyModelPrivate::sort_source_rows (this=<value optimized out>, source_rows=<value optimized out>, source_parent=<value optimized out>) at itemviews/qsortfilterproxymodel.cpp:427
#26 0x0000003377ed1653 in QSortFilterProxyModelPrivate::create_mapping (this=<value optimized out>, source_parent=<value optimized out>) at itemviews/qsortfilterproxymodel.cpp:300
#27 0x0000003377ed2168 in QSortFilterProxyModel::rowCount (this=<value optimized out>, parent=<value optimized out>) at itemviews/qsortfilterproxymodel.cpp:1600
#28 0x00007fcf89e0efa2 in CollectionTreeView::slotCheckAutoExpand (this=0x7fcf782467f0) at /home/marian/data/amarok/src/browsers/CollectionTreeView.cpp:641
#29 0x00007fcf89e102d0 in CollectionTreeView::qt_metacall (this=0x7fcf782467f0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fffa44b9900)
    at /home/marian/data/amarok/build/src/CollectionTreeView.moc:116
#30 0x0000003374f7df33 in QMetaObject::activate (sender=<value optimized out>, m=<value optimized out>, local_signal_index=<value optimized out>, argv=<value optimized out>)
    at kernel/qobject.cpp:3286
#31 0x00007fcf89e018aa in CollectionTreeItemModelBase::queryDone (this=0x7fcf782504d0) at /home/marian/data/amarok/src/browsers/CollectionTreeItemModelBase.cpp:680
#32 0x00007fcf89e00dc5 in CollectionTreeItemModelBase::qt_metacall (this=0x7fcf782504d0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fcf78b136f0)
    at /home/marian/data/amarok/build/src/CollectionTreeItemModelBase.moc:92
#33 0x00007fcf89df9f60 in CollectionTreeItemModel::qt_metacall (this=0x5e4b, _c=24139, _id=6, _a=0xffffffffffffffff) at /home/marian/data/amarok/build/src/CollectionTreeItemModel.moc:73
#34 0x0000003374f7aeb9 in QObject::event (this=<value optimized out>, e=<value optimized out>) at kernel/qobject.cpp:1252
#35 0x00000033779b929c in QApplicationPrivate::notify_helper (this=<value optimized out>, receiver=<value optimized out>, e=<value optimized out>) at kernel/qapplication.cpp:4242
#36 0x00000033779c1ada in QApplication::notify (this=<value optimized out>, receiver=<value optimized out>, e=<value optimized out>) at kernel/qapplication.cpp:4125
#37 0x00007fcf8a0f16ea in App::notify (this=0x5e4b, receiver=0x5e4b, event=0x6) at /home/marian/data/amarok/src/App.cpp:845
#38 0x0000003374f6b2eb in QCoreApplication::notifyInternal (this=<value optimized out>, receiver=<value optimized out>, event=<value optimized out>) at kernel/qcoreapplication.cpp:704
#39 0x0000003374f6da36 in QCoreApplication::sendEvent (receiver=<value optimized out>, event_type=<value optimized out>, data=<value optimized out>) at kernel/qcoreapplication.h:215
#40 QCoreApplicationPrivate::sendPostedEvents (receiver=<value optimized out>, event_type=<value optimized out>, data=<value optimized out>) at kernel/qcoreapplication.cpp:1345
#41 0x0000003374f94bf3 in QCoreApplication::sendPostedEvents (s=<value optimized out>) at kernel/qcoreapplication.h:220
#42 postEventSourceDispatch (s=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:276
#43 0x000000336f63b4cd in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#44 0x000000336f63ee88 in ?? () from /usr/lib/libglib-2.0.so.0
#45 0x000000336f63efb0 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#46 0x0000003374f94733 in QEventDispatcherGlib::processEvents (this=<value optimized out>, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:407
#47 0x0000003377a5555e in QGuiEventDispatcherGlib::processEvents (this=<value optimized out>, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:202
#48 0x0000003374f69c42 in QEventLoop::processEvents (this=<value optimized out>, flags=<value optimized out>) at kernel/qeventloop.cpp:149
#49 0x0000003374f6a014 in QEventLoop::exec (this=<value optimized out>, flags=<value optimized out>) at kernel/qeventloop.cpp:201
#50 0x0000003374f6dcfb in QCoreApplication::exec () at kernel/qcoreapplication.cpp:981
#51 0x00000000004089e1 in main (argc=2, argv=0x7fffa44bc338) at /home/marian/data/amarok/src/main.cpp:235


Messages in log:
amarok:   END__: int ScanResultProcessor::urlId(const QString&, const QString&) - Took 9.1e-05s
amarok:   BEGIN: int ScanResultProcessor::urlId(const QString&, const QString&)
amarok:   END__: int ScanResultProcessor::urlId(const QString&, const QString&) - Took 9.3e-05s
amarok:   BEGIN: void DatabaseUpdater::cleanPermanentTables()
amarok:   END__: void DatabaseUpdater::cleanPermanentTables() - Took 0.002s
amarok:   BEGIN: void ScanResultProcessor::copyHashesToTempTables()
amarok:      obtained max_allowed_packet is  "1048576"
amarok:     BEGIN: void ScanManager::slotFinished()
amarok:     END__: void ScanManager::slotFinished() - Took 0.00013s
amarok:      urls key size is  7109
amarok:      tracks key size is  7109
amarok:   END__: void ScanResultProcessor::copyHashesToTempTables() - Took 0.96s
amarok:    temp_tracks:  ("7109")
amarok:    tracks before commit:  ("0")
amarok:   BEGIN: void DatabaseUpdater::copyToPermanentTables()
amarok:   END__: void DatabaseUpdater::copyToPermanentTables() - Took 0.59s
amarok:   BEGIN: virtual void Dynamic::BiasedPlaylist::invalidate()
amarok:   END__: virtual void Dynamic::BiasedPlaylist::invalidate() - Took 0.00013s
amarok:    tracks after commit:  ("7109")
amarok:   BEGIN: void DatabaseUpdater::removeTemporaryTables()
amarok:   END__: void DatabaseUpdater::removeTemporaryTables() - Took 0.0024s
amarok:   BEGIN: CollectionTreeItem::CollectionTreeItem(const Meta::DataList&, CollectionTreeItem*, CollectionTreeItemModelBase*)
amarok:   END__: CollectionTreeItem::CollectionTreeItem(const Meta::DataList&, CollectionTreeItem*, CollectionTreeItemModelBase*) - Took 0.00012s
amarok:    Sending changed signal
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = amarok path = <unknown> pid = 24139
Comment 49 Dario Andres 2010-01-08 17:59:41 UTC
The last backtrace looks like bug 196207
Comment 50 Jeff Mitchell 2010-01-09 00:02:47 UTC
(In reply to comment #49)
> The last backtrace looks like bug 196207

It isn't...I have her testing a new patch. Will report back soon.
Comment 51 Mikko C. 2010-01-13 18:39:36 UTC
*** Bug 222440 has been marked as a duplicate of this bug. ***
Comment 52 Mikko C. 2010-01-15 14:28:08 UTC
*** Bug 222842 has been marked as a duplicate of this bug. ***
Comment 53 Mikko C. 2010-01-15 16:13:40 UTC
*** Bug 222857 has been marked as a duplicate of this bug. ***
Comment 54 Mikko C. 2010-01-15 17:56:02 UTC
*** Bug 222874 has been marked as a duplicate of this bug. ***
Comment 55 Mikko C. 2010-01-15 17:57:35 UTC
Looking at these dupes I'm guessing Arch packagers did not include the patch for 2.2.2?
Comment 56 Mete Cetin 2010-01-15 18:04:52 UTC
(In reply to comment #55)
> Looking at these dupes I'm guessing Arch packagers did not include the patch
> for 2.2.2?

I am using archlinux and amarok 2.2.2 but i am still suffering from this bug.
Comment 57 Myriam Schweingruber 2010-01-16 10:36:09 UTC
Yes, that should really be fixed by now, Archlinux provides the patch. See also comment #3 in bug 222842
Comment 58 Myriam Schweingruber 2010-01-16 12:31:03 UTC
*** Bug 222438 has been marked as a duplicate of this bug. ***
Comment 59 Ulf Bartholomäus 2010-01-16 16:45:41 UTC
Application that crashed: amarok
Version of the application: 2.2.2
KDE Version: 4.3.4 (KDE 4.3.4) "release 2"
Qt Version: 4.5.3
Operating System: Linux 2.6.31.8-0.1-desktop x86_64
Distribution: "openSUSE 11.2 (x86_64)"

What I was doing when the application crashed:
So as in [Bug 215731] "Collection browser shows wrong cover" described, a full
rescan is started in the amaroK settings dialog. The rescan starts (on the
NFS-Mounted path) and send to a local MySQL database. No other tasks ar
running, playlist is empty (works with 2.2.1 version fine - but crashes with
2.2.2 Version (from yesterday and today - from openSUSE 11.2 repository). The
crash is coming short befor rescan is finished (in my case all 6 times at 97%).

Additional Traces are in Bug 222438, if needed I make new tests.

PS: But I don't understand in detail, what is to do to handle the workarround.
Comment 60 Mikko C. 2010-01-17 11:07:19 UTC
*** Bug 222528 has been marked as a duplicate of this bug. ***
Comment 61 Myriam Schweingruber 2010-01-17 13:40:51 UTC
(In reply to comment #59)
> But I don't understand in detail, what is to do to handle the workarround.

It is not a workaround, but a patch, normally the patched version should be available in OpenSuSE already.
Comment 62 Jeff Mitchell 2010-01-17 17:08:52 UTC
Ulf, please open a new bug. Your issue is probably not related to this.
Comment 63 Ulf Bartholomäus 2010-01-17 19:03:53 UTC
What is the different? But the Bug ist allways open as Bug 222438 (must be reopened?).
Comment 64 Jeff Mitchell 2010-01-17 20:13:36 UTC
It's a completely different backtrace.
Comment 65 Myriam Schweingruber 2010-02-01 23:04:23 UTC
*** Bug 225207 has been marked as a duplicate of this bug. ***