Summary: | Crash while scanning collection (@SqlScanResultProcessor) | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | Martin <martin.ruessler> |
Component: | Collections/Local | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | martin.ruessler, matej, ralf-engels |
Priority: | NOR | Keywords: | regression, release_blocker |
Version: | 2.7-git | ||
Target Milestone: | 2.8 | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/amarok/acf7cfabe5e51cef2704d76a4312724ebf4abfcf | Version Fixed In: | 2.8 |
Sentry Crash Report: | |||
Attachments: | New crash information added by DrKonqi |
Description
Martin
2013-05-14 18:34:58 UTC
Is this crash reproducible? Please make sure you always use the very latest git build, current is at v2.7.0-299-g00eb2e4 Created attachment 79899 [details]
New crash information added by DrKonqi
amarok (2.7-git) on KDE Platform 4.10.3 using Qt 4.8.4
Yes it seems that I can reproduce the bug. I went to the settings and started a full rescan of my library. After a while Amarok crashed. I used v2.7.0-291-g89a8141 but I will update and try again.
-- Backtrace (Reduced):
#6 0x00007f9d90a33037 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#7 0x00007f9d90a36698 in __GI_abort () at abort.c:90
[...]
#11 0x00007f9d6dcc4107 in SqlScanResultProcessor::removeTrack (this=0x14cc500, entry=...) at /home/martin/sources/amarok/src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp:544
#12 0x00007f9d6dcc375f in SqlScanResultProcessor::deleteDeletedTracks (this=0x14cc500, directoryId=10832) at /home/martin/sources/amarok/src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp:451
#13 0x00007f9d6dcc3647 in SqlScanResultProcessor::deleteDeletedTracks (this=0x14cc500, directory=0x7f9d548e96c0) at /home/martin/sources/amarok/src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp:433
It is the same with v2.7.0-302-gc208b80. Every collection scan crashes the program. Right now I have at least one album in my collection where all files have two entries: One from before and one from after the move of the files. Thanks for testing. Confirming the report based on your backtrace. Could you please run the amarokcollectionscanner to see if it crashes on a specific file? See amarokcollectionscanner --help for options. When I ran the collection scanner it worked through all the files and completed the scan without any problems. @Myriam: The particular piece of code that crashed is in Amarok itself, not in the scanner. Thanks for the fast feedback. Just had the same crash: Amarok v2.7.0-313-g35c6b12. Lauched a full colelction rescan, no tracks playing: Thread 16 (Thread 0x7ff8a37fe700 (LWP 21339)): [KCrash Handler] #6 0x00007ff8e0c43037 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #7 0x00007ff8e0c46698 in __GI_abort () at abort.c:90 #8 0x00007ff8e0c805ab in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7ff8e0d93860 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:199 #9 0x00007ff8e0c8ca46 in malloc_printerr (ptr=0x7ff7e11fd9a0, str=0x7ff8e0d93948 "double free or corruption (!prev)", action=3) at malloc.c:4902 #10 _int_free (av=av@entry=0x7ff89c000020, p=p@entry=0x7ff7e11fd990, have_lock=have_lock@entry=1) at malloc.c:3758 #11 0x00007ff8e0c8ec30 in _int_realloc (av=av@entry=0x7ff89c000020, oldp=oldp@entry=0x7ff7e11fd990, oldsize=524304, nb=nb@entry=1048592) at malloc.c:4245 #12 0x00007ff8e0c8fb92 in __GI___libc_realloc (oldmem=0x7ff7e11fd9a0, bytes=1048576) at malloc.c:2984 #13 0x00007ff8e188b5f6 in QListData::realloc (this=this@entry=0x2996b38, alloc=131069) at tools/qlist.cpp:221 #14 0x00007ff8e188b6a7 in QListData::append (this=0x2996b38, n=1) at tools/qlist.cpp:243 #15 0x00007ff8e5a2156b in QList<QString>::append (this=0x2996b38, t=...) at /usr/include/qt4/QtCore/qlist.h:530 #16 0x00007ff8bce95af5 in SqlScanResultProcessor::commitTrack (this=0x2996ab0, track=0x7ff89c481350, srcAlbum=0x7ff89f0c2e90) at /home/myriam/kde/src/amarok/src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp:212 #17 0x00007ff8bce94f6b in SqlScanResultProcessor::commitAlbum (this=0x2996ab0, album=0x7ff89f0c2e90) at /home/myriam/kde/src/amarok/src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp:155 #18 0x00007ff8e4b5ee1f in AbstractScanResultProcessor::scanSucceeded (this=0x2996ab0) at /home/myriam/kde/src/amarok/src/scanner/AbstractScanResultProcessor.cpp:169 #19 0x00007ff8bce93d41 in SqlScanResultProcessor::scanSucceeded (this=0x2996ab0) at /home/myriam/kde/src/amarok/src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp:69 #20 0x00007ff8e4b602bf in AbstractScanResultProcessor::qt_static_metacall (_o=0x2996ab0, _c=QMetaObject::InvokeMetaMethod, _id=6, _a=0x7ff8a37fd980) at /home/myriam/kde/build/amarok/src/AbstractScanResultProcessor.moc:73 #21 0x00007ff8e197f0ef in QMetaObject::activate (sender=0x291df60, m=<optimized out>, local_signal_index=<optimized out>, argv=0x0) at kernel/qobject.cpp:3539 #22 0x00007ff8e47eb4ab in GenericScanManager::succeeded (this=0x291df60) at /home/myriam/kde/build/amarok/src/moc_GenericScanManager.cpp:153 #23 0x00007ff8e4b55b6b in GenericScanManager::slotSucceeded (this=0x291df60) at /home/myriam/kde/src/amarok/src/scanner/GenericScanManager.cpp:134 #24 0x00007ff8e47eb304 in GenericScanManager::qt_static_metacall (_o=0x291df60, _c=QMetaObject::InvokeMetaMethod, _id=10, _a=0x7ff8a37fdb90) at /home/myriam/kde/build/amarok/src/moc_GenericScanManager.cpp:83 #25 0x00007ff8e197f0ef in QMetaObject::activate (sender=0xb5f0cb0, m=<optimized out>, local_signal_index=<optimized out>, argv=0x0) at kernel/qobject.cpp:3539 #26 0x00007ff8e4b58dab in GenericScannerJob::succeeded (this=0xb5f0cb0) at /home/myriam/kde/build/amarok/src/GenericScannerJob.moc:132 #27 0x00007ff8e4b56e00 in GenericScannerJob::run (this=0xb5f0cb0) at /home/myriam/kde/src/amarok/src/scanner/GenericScannerJob.cpp:157 #28 0x00007ff8df134e3a in ThreadWeaver::JobRunHelper::runTheJob (this=this@entry=0x7ff8a37fdd70, th=th@entry=0x2c2fef0, job=job@entry=0xb5f0cb0) at ../../../threadweaver/Weaver/Job.cpp:106 #29 0x00007ff8df134fb1 in ThreadWeaver::Job::execute (this=0xb5f0cb0, th=0x2c2fef0) at ../../../threadweaver/Weaver/Job.cpp:135 #30 0x00007ff8df13460f in ThreadWeaver::ThreadRunHelper::run (this=this@entry=0x7ff8a37fddc0, parent=0x29d3fb0, th=th@entry=0x2c2fef0) at ../../../threadweaver/Weaver/Thread.cpp:95 #31 0x00007ff8df1346cb in ThreadWeaver::Thread::run (this=0x2c2fef0) at ../../../threadweaver/Weaver/Thread.cpp:142 #32 0x00007ff8e186dbec in QThreadPrivate::start (arg=0x2c2fef0) at thread/qthread_unix.cpp:338 #33 0x00007ff8dfacff8e in start_thread (arg=0x7ff8a37fe700) at pthread_create.c:311 #34 0x00007ff8e0d05e1d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113 This is because GenericScanManager::slotSucceeded(), in turn SqlScanResultProcessor::scanSucceeded() in turn AbstractScanResultProcessor::scanSucceeded() in turn SqlScanResultProcessor::commitAlbum() in turn SqlScanResultProcessor::commitTrack() being called from the non-main thread, which it doesn't expect. I'll have a look at this later. Git commit acf7cfabe5e51cef2704d76a4312724ebf4abfcf by Matěj Laitl. Committed on 26/06/2013 at 16:49. Pushed by laitl into branch 'master'. ScanManagers, ScanResultProcessors: don't call non-thread-safe code from a thread Excessive usage of direct Qt connections lead to a large amount of code in various ScanResultProcessors being called from a non-main thread, but the result processors didn't expected it, weren't thread-safe, which lead to data races. This fixes one confirmed crash and may fix more seemingly random Local Collection updating behaviour. FIXED-IN: 2.8 M +1 -0 ChangeLog M +6 -5 src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp M +3 -2 src/core-impl/collections/db/sql/SqlScanResultProcessor.h M +3 -3 src/core-impl/collections/umscollection/UmsCollection.cpp M +1 -1 src/core-impl/collections/umscollection/UmsCollection.h M +13 -23 src/scanner/AbstractScanResultProcessor.cpp M +6 -5 src/scanner/AbstractScanResultProcessor.h M +12 -16 src/scanner/GenericScanManager.cpp M +13 -10 src/scanner/GenericScanManager.h M +1 -5 src/scanner/GenericScannerJob.cpp M +12 -17 src/scanner/GenericScannerJob.h M +7 -15 tests/scanner/TestGenericScanManager.cpp M +1 -1 tests/scanner/TestGenericScanManager.h http://commits.kde.org/amarok/acf7cfabe5e51cef2704d76a4312724ebf4abfcf |