Summary: | Crash of Amarok after copying files between collections [@ Collections::SqlCollectionLocation::insert] | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | Mickaël <mprizee> |
Component: | Collections/Local | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | 123kash, mitchell, ralf-engels, valorie.zimmerman |
Priority: | HI | ||
Version: | 2.4-GIT | ||
Target Milestone: | 2.4.0 | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 2.4 | |
Sentry Crash Report: |
Description
Mickaël
2010-12-27 13:15:51 UTC
*** Bug 261510 has been marked as a duplicate of this bug. *** Confirmed by duplicate. My backtrace, reproducible every time: Thread 1 (Thread 0x7fc2ec761780 (LWP 26244)): [KCrash Handler] #6 0x00007fc2e90eeba5 in raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 #7 0x00007fc2e90f26b0 in abort () at abort.c:92 #8 0x00007fc2e99c6864 in qt_message_output (msgType=QtFatalMsg, buf=<value optimized out>) at global/qglobal.cpp:2259 #9 0x00007fc2e99c6a42 in qt_message(QtMsgType, const char *, typedef __va_list_tag __va_list_tag *) (msgType=QtFatalMsg, msg=0x7fc2e9b290c8 "ASSERT: \"%s\" in file %s, line %d", ap=0x7fff876a0e50) at global/qglobal.cpp:2305 #10 0x00007fc2e99c6bf5 in qFatal (msg=0x6684 <Address 0x6684 out of bounds>) at global/qglobal.cpp:2488 #11 0x00007fc2987e919c in KSharedPtr<Meta::Album>::operator-> (this=0x7fff876a1140) at /usr/include/ksharedptr.h:126 #12 0x00007fc29881d85a in Collections::SqlCollectionLocation::insert (this=0x7564030, track=..., url=...) at /home/myriam/kde/src/amarok/src/core-impl/collections/db/sql/SqlCollectionLocation.cpp:198 #13 0x00007fc29881f310 in Collections::SqlCollectionLocation::slotTransferJobFinished (this=0x7564030, job=0x4c7a800) at /home/myriam/kde/src/amarok/src/core-impl/collections/db/sql/SqlCollectionLocation.cpp:427 #14 0x00007fc298821a34 in Collections::SqlCollectionLocation::qt_metacall (this=0x7564030, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7fff876a1520) at /home/myriam/kde/build/amarok/src/core-impl/collections/db/sql/SqlCollectionLocation.moc:152 #15 0x00007fc2e9adab27 in QMetaObject::activate (sender=0x4c7a800, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0xffffffffffffffff) at kernel/qobject.cpp:3280 #16 0x00007fc2e9f30a52 in KJob::result (this=0x6684, _t1=0x4c7a800) at ./kjob.moc:194 #17 0x00007fc2e9f30cf0 in KJob::emitResult (this=0x4c7a800) at ../../kdecore/jobs/kjob.cpp:312 #18 0x00007fc2988214a4 in Collections::TransferJob::slotJobFinished (this=0x4c7a800, job=0x7590430) at /home/myriam/kde/src/amarok/src/core-impl/collections/db/sql/SqlCollectionLocation.cpp:705 #19 0x00007fc29882185a in Collections::TransferJob::qt_metacall (this=0x4c7a800, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7fff876a1720) at /home/myriam/kde/build/amarok/src/core-impl/collections/db/sql/SqlCollectionLocation.moc:77 #20 0x00007fc2e9adab27 in QMetaObject::activate (sender=0x7590430, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0xffffffffffffffff) at kernel/qobject.cpp:3280 #21 0x00007fc2e9f30a52 in KJob::result (this=0x6684, _t1=0x7590430) at ./kjob.moc:194 #22 0x00007fc2e9f30cf0 in KJob::emitResult (this=0x7590430) at ../../kdecore/jobs/kjob.cpp:312 #23 0x00007fc2e720bedb in KIO::FileCopyJob::slotResult (this=0x7590430, job=0x756f5e0) at ../../kio/kio/job.cpp:2341 #24 0x00007fc2e7209d60 in KIO::FileCopyJob::qt_metacall (this=0x7590430, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff876a18c0) at ./jobclasses.moc:721 #25 0x00007fc2e9adab27 in QMetaObject::activate (sender=0x756f5e0, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0xffffffffffffffff) at kernel/qobject.cpp:3280 #26 0x00007fc2e9f30a52 in KJob::result (this=0x6684, _t1=0x756f5e0) at ./kjob.moc:194 #27 0x00007fc2e9f30cf0 in KJob::emitResult (this=0x756f5e0) at ../../kdecore/jobs/kjob.cpp:312 #28 0x00007fc2e72069f3 in KIO::SimpleJob::slotFinished (this=0x756f5e0) at ../../kio/kio/job.cpp:525 #29 0x00007fc2e7204ad1 in KIO::SimpleJob::qt_metacall (this=0x756f5e0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff876a1b20) at ./jobclasses.moc:171 #30 0x00007fc2e7204bb0 in KIO::DirectCopyJob::qt_metacall (this=0x6684, _c=26244, _id=6, _a=0xffffffffffffffff) at ./job_p.moc:157 #31 0x00007fc2e9adab27 in QMetaObject::activate (sender=0x2333200, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0xffffffffffffffff) at kernel/qobject.cpp:3280 #32 0x00007fc2e72b880e in KIO::SlaveInterface::dispatch (this=0x2333200, _cmd=104, rawdata=...) at ../../kio/kio/slaveinterface.cpp:173 #33 0x00007fc2e72b5853 in KIO::SlaveInterface::dispatch (this=0x2333200) at ../../kio/kio/slaveinterface.cpp:89 #34 0x00007fc2e72a91e6 in KIO::Slave::gotInput (this=0x2333200) at ../../kio/kio/slave.cpp:348 #35 0x00007fc2e72a93cc in KIO::Slave::qt_metacall (this=0x2333200, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fff876a1fa0) at ./slave.moc:82 #36 0x00007fc2e9adab27 in QMetaObject::activate (sender=0x4763810, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0xffffffffffffffff) at kernel/qobject.cpp:3280 #37 0x00007fc2e71d35d7 in KIO::ConnectionPrivate::dequeue (this=0x2072b80) at ../../kio/kio/connection.cpp:82 #38 0x00007fc2e71d36fd in KIO::Connection::qt_metacall (this=0x4763810, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x2187a50) at ./connection.moc:79 #39 0x00007fc2e9ad4bde in QObject::event (this=0x4763810, e=0x6684) at kernel/qobject.cpp:1219 #40 0x00007fc2ea4a4fdc in QApplicationPrivate::notify_helper (this=0xecb060, receiver=0x4763810, e=0x2d7cd70) at kernel/qapplication.cpp:4396 #41 0x00007fc2ea4aaaed in QApplication::notify (this=0x7fff876a2a50, receiver=0x4763810, e=0x2d7cd70) at kernel/qapplication.cpp:4277 #42 0x00007fc2ec171a36 in KApplication::notify (this=0x7fff876a2a50, receiver=0x4763810, event=0x2d7cd70) at ../../kdeui/kernel/kapplication.cpp:311 #43 0x00007fc2e9ac2cdc in QCoreApplication::notifyInternal (this=0x7fff876a2a50, receiver=0x4763810, event=0x2d7cd70) at kernel/qcoreapplication.cpp:732 #44 0x00007fc2e9ac5c22 in sendEvent (receiver=0x0, event_type=<value optimized out>, data=0xd39690) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215 #45 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=<value optimized out>, data=0xd39690) at kernel/qcoreapplication.cpp:1373 #46 0x00007fc2e9aef653 in sendPostedEvents (s=0xec4930) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220 #47 postEventSourceDispatch (s=0xec4930) at kernel/qeventdispatcher_glib.cpp:277 #48 0x00007fc2e26d7342 in g_main_context_dispatch () from /lib/libglib-2.0.so.0 #49 0x00007fc2e26db2a8 in ?? () from /lib/libglib-2.0.so.0 #50 0x00007fc2e26db45c in g_main_context_iteration () from /lib/libglib-2.0.so.0 #51 0x00007fc2e9aef193 in QEventDispatcherGlib::processEvents (this=0xd38d40, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:415 #52 0x00007fc2ea557a4e in QGuiEventDispatcherGlib::processEvents (this=0x6684, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:204 #53 0x00007fc2e9ac1a02 in QEventLoop::processEvents (this=<value optimized out>, flags=) at kernel/qeventloop.cpp:149 #54 0x00007fc2e9ac1dec in QEventLoop::exec (this=0x7fff876a29f0, flags=) at kernel/qeventloop.cpp:201 #55 0x00007fc2e9ac5ebb in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1009 #56 0x000000000040ca20 in main (argc=3, argv=0x7fff876a4eb8) at /home/myriam/kde/src/amarok/src/main.cpp:268 commit 4c4d561a078262d6a8724a1d8b4fb6819b263320 branch master Author: Sergey Ivanov <123kash@gmail.com> Date: Sun Jan 9 17:40:29 2011 +0300 Fix crash on copying tracks between collection. BUG: 261364 diff --git a/ChangeLog b/ChangeLog index 7851071..4c5b6aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ VERSION 2.4.0 * Fixed some broken radio stream URLs. BUGFIXES: + * Fix crash on copying tracks between collection. (BR 261364) * Fix fetching of script data. BBC, Free Music Charts and others should work again. (BR 261839) * Actually show the Splash Screen by default, as it was meant to work. diff --git a/src/core-impl/collections/db/sql/SqlCollectionLocation.cpp b/src/core-impl/collections/db/sql/SqlCollectionLocation.cpp index 6322c44..078ce09 100644 --- a/src/core-impl/collections/db/sql/SqlCollectionLocation.cpp +++ b/src/core-impl/collections/db/sql/SqlCollectionLocation.cpp @@ -192,12 +192,7 @@ SqlCollectionLocation::insert( const Meta::TrackPtr &track, const QString &url ) metaTrack->setTitle( track->name() ); if( track->album() ) - { metaTrack->setAlbum( track->album()->name() ); - // also copy over the album cover - if( track->album()->hasImage() && !metaTrack->album()->hasImage() ) - metaTrack->album()->setImage( track->album()->image().toImage() ); - } if( track->artist() ) metaTrack->setArtist( track->artist()->name() ); @@ -260,6 +255,12 @@ SqlCollectionLocation::insert( const Meta::TrackPtr &track, const QString &url ) metaTrack->addLabel( label ); metaTrack->endMetaDataUpdate(); + + // Used to be updated after changes commit to prevent crash on NULL pointer access + // if metaTrack had no album. + if( track->album() && track->album()->hasImage() && !metaTrack->album()->hasImage() ) + metaTrack->album()->setImage( track->album()->image().toImage() ); + metaTrack->setWriteFile( true ); return true; |