Bug 261364 - Crash of Amarok after copying files between collections [@ Collections::SqlCollectionLocation::insert]
Summary: Crash of Amarok after copying files between collections [@ Collections::SqlCo...
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Local (show other bugs)
Version: 2.4-GIT
Platform: Arch Linux Linux
: HI crash
Target Milestone: 2.4.0
Assignee: Amarok Developers
URL:
Keywords:
: 261510 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-12-27 13:15 UTC by Mickaël
Modified: 2011-01-09 19:47 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.4


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mickaël 2010-12-27 13:15:51 UTC
Application: amarok (2.4-GIT)
KDE Platform Version: 4.5.4 (KDE 4.5.4)
Qt Version: 4.7.1
Operating System: Linux 2.6.36-ARCH x86_64
Distribution (Platform): Archlinux Packages

-- Information about the crash:
I wanted to transfer files from my new music player (Sony - Walkman) to my local collection, connection by USB en mass storage mode, then I clicked on "Copy", the copy started and at the end (the progress bar showed 100%) Amarok crashed.
Files have correctly been copied, and I am able to listen to them after restarting Amarok (and updating the collection).

The crash can be reproduced every time.

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

Thread 13 (Thread 0x7f38a666d710 (LWP 2488)):
#0  0x00007f38c2aa840c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f38c4e6cc1b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f38c1ece034 in ?? () from /usr/lib/libthreadweaver.so.4
#3  0x00007f38c1ed06c3 in ?? () from /usr/lib/libthreadweaver.so.4
#4  0x00007f38c1ecf4af in ?? () from /usr/lib/libthreadweaver.so.4
#5  0x00007f38c1ecf538 in ThreadWeaver::Thread::run() () from /usr/lib/libthreadweaver.so.4
#6  0x00007f38c4e6c52e in ?? () from /usr/lib/libQtCore.so.4
#7  0x00007f38c2aa3cb0 in start_thread () from /lib/libpthread.so.0
#8  0x00007f38c464b9dd in clone () from /lib/libc.so.6
#9  0x0000000000000000 in ?? ()

Thread 12 (Thread 0x7f38a6e6e710 (LWP 2489)):
#0  0x00007f38c2aa840c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f38c4e6cc1b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f38c1ece034 in ?? () from /usr/lib/libthreadweaver.so.4
#3  0x00007f38c1ed06c3 in ?? () from /usr/lib/libthreadweaver.so.4
#4  0x00007f38c1ed06dc in ?? () from /usr/lib/libthreadweaver.so.4
#5  0x00007f38c1ecf4af in ?? () from /usr/lib/libthreadweaver.so.4
#6  0x00007f38c1ecf538 in ThreadWeaver::Thread::run() () from /usr/lib/libthreadweaver.so.4
#7  0x00007f38c4e6c52e in ?? () from /usr/lib/libQtCore.so.4
#8  0x00007f38c2aa3cb0 in start_thread () from /lib/libpthread.so.0
#9  0x00007f38c464b9dd in clone () from /lib/libc.so.6
#10 0x0000000000000000 in ?? ()

Thread 11 (Thread 0x7f38a13a6710 (LWP 2490)):
#0  0x00007f38c2aa840c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f38c4e6cc1b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f38c1ece034 in ?? () from /usr/lib/libthreadweaver.so.4
#3  0x00007f38c1ed06c3 in ?? () from /usr/lib/libthreadweaver.so.4
#4  0x00007f38c1ed06dc in ?? () from /usr/lib/libthreadweaver.so.4
#5  0x00007f38c1ed06dc in ?? () from /usr/lib/libthreadweaver.so.4
#6  0x00007f38c1ed06dc in ?? () from /usr/lib/libthreadweaver.so.4
#7  0x00007f38c1ed06dc in ?? () from /usr/lib/libthreadweaver.so.4
#8  0x00007f38c1ecf4af in ?? () from /usr/lib/libthreadweaver.so.4
#9  0x00007f38c1ecf538 in ThreadWeaver::Thread::run() () from /usr/lib/libthreadweaver.so.4
#10 0x00007f38c4e6c52e in ?? () from /usr/lib/libQtCore.so.4
#11 0x00007f38c2aa3cb0 in start_thread () from /lib/libpthread.so.0
#12 0x00007f38c464b9dd in clone () from /lib/libc.so.6
#13 0x0000000000000000 in ?? ()

Thread 10 (Thread 0x7f38a0ba5710 (LWP 2491)):
#0  0x00007f38c2aa840c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f38c4e6cc1b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007f38c1ece034 in ?? () from /usr/lib/libthreadweaver.so.4
#3  0x00007f38c1ed06c3 in ?? () from /usr/lib/libthreadweaver.so.4
#4  0x00007f38c1ed06dc in ?? () from /usr/lib/libthreadweaver.so.4
#5  0x00007f38c1ecf4af in ?? () from /usr/lib/libthreadweaver.so.4
#6  0x00007f38c1ecf538 in ThreadWeaver::Thread::run() () from /usr/lib/libthreadweaver.so.4
#7  0x00007f38c4e6c52e in ?? () from /usr/lib/libQtCore.so.4
#8  0x00007f38c2aa3cb0 in start_thread () from /lib/libpthread.so.0
#9  0x00007f38c464b9dd in clone () from /lib/libc.so.6
#10 0x0000000000000000 in ?? ()

Thread 9 (Thread 0x7f389a257710 (LWP 2492)):
#0  0x00007f38c46452d3 in select () from /lib/libc.so.6
#1  0x00007f38c4f356dd in ?? () from /usr/lib/libQtCore.so.4
#2  0x00007f38c4e6c52e in ?? () from /usr/lib/libQtCore.so.4
#3  0x00007f38c2aa3cb0 in start_thread () from /lib/libpthread.so.0
#4  0x00007f38c464b9dd in clone () from /lib/libc.so.6
#5  0x0000000000000000 in ?? ()

Thread 8 (Thread 0x7f3891ffb710 (LWP 2499)):
#0  0x00007f38c2aa840c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f38c07fa794 in ?? () from /usr/lib/libQtScript.so.4
#2  0x00007f38c07fa7c9 in ?? () from /usr/lib/libQtScript.so.4
#3  0x00007f38c2aa3cb0 in start_thread () from /lib/libpthread.so.0
#4  0x00007f38c464b9dd in clone () from /lib/libc.so.6
#5  0x0000000000000000 in ?? ()

Thread 7 (Thread 0x7f38927fc710 (LWP 3023)):
#0  0x00007f38c2aa840c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f38ab979970 in ?? () from /usr/lib/libgstreamer-0.10.so.0
#2  0x00007f38bdf3b6e4 in ?? () from /usr/lib/libglib-2.0.so.0
#3  0x00007f38bdf38ff6 in ?? () from /usr/lib/libglib-2.0.so.0
#4  0x00007f38c2aa3cb0 in start_thread () from /lib/libpthread.so.0
#5  0x00007f38c464b9dd in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 6 (Thread 0x7f38935fb710 (LWP 3024)):
#0  0x00007f38c2aa840c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f38ab979970 in ?? () from /usr/lib/libgstreamer-0.10.so.0
#2  0x00007f38bdf3b6e4 in ?? () from /usr/lib/libglib-2.0.so.0
#3  0x00007f38bdf38ff6 in ?? () from /usr/lib/libglib-2.0.so.0
#4  0x00007f38c2aa3cb0 in start_thread () from /lib/libpthread.so.0
#5  0x00007f38c464b9dd in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 5 (Thread 0x7f3899175710 (LWP 3025)):
#0  0x00007f38c2aa840c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f38ab979970 in ?? () from /usr/lib/libgstreamer-0.10.so.0
#2  0x00007f38bdf3b6e4 in ?? () from /usr/lib/libglib-2.0.so.0
#3  0x00007f38bdf38ff6 in ?? () from /usr/lib/libglib-2.0.so.0
#4  0x00007f38c2aa3cb0 in start_thread () from /lib/libpthread.so.0
#5  0x00007f38c464b9dd in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f3887eb6710 (LWP 3026)):
#0  0x00007f38c2aa840c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f38ab979970 in ?? () from /usr/lib/libgstreamer-0.10.so.0
#2  0x00007f38bdf3b6e4 in ?? () from /usr/lib/libglib-2.0.so.0
#3  0x00007f38bdf38ff6 in ?? () from /usr/lib/libglib-2.0.so.0
#4  0x00007f38c2aa3cb0 in start_thread () from /lib/libpthread.so.0
#5  0x00007f38c464b9dd in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f3893fff710 (LWP 3027)):
#0  0x00007f38c2aa840c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007f38ab979970 in ?? () from /usr/lib/libgstreamer-0.10.so.0
#2  0x00007f38bdf3b6e4 in ?? () from /usr/lib/libglib-2.0.so.0
#3  0x00007f38bdf38ff6 in ?? () from /usr/lib/libglib-2.0.so.0
#4  0x00007f38c2aa3cb0 in start_thread () from /lib/libpthread.so.0
#5  0x00007f38c464b9dd in clone () from /lib/libc.so.6
#6  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f3888abf710 (LWP 3040)):
#0  0x00007f38ac0a2810 in ?? () from /usr/lib/libasound.so.2
#1  0x00007f38ac0a441a in ?? () from /usr/lib/libasound.so.2
#2  0x00007f38ac0a4764 in ?? () from /usr/lib/libasound.so.2
#3  0x00007f38ac080ab5 in ?? () from /usr/lib/libasound.so.2
#4  0x00007f38ac08b6b3 in ?? () from /usr/lib/libasound.so.2
#5  0x00007f38ac08b782 in ?? () from /usr/lib/libasound.so.2
#6  0x00007f38ac08b85c in ?? () from /usr/lib/libasound.so.2
#7  0x00007f38ac07ec1b in ?? () from /usr/lib/libasound.so.2
#8  0x00007f38ac074835 in ?? () from /usr/lib/libasound.so.2
#9  0x00007f38ac07eefb in snd_pcm_mmap_writei () from /usr/lib/libasound.so.2
#10 0x00007f38aaa1847e in ?? () from /usr/lib/gstreamer-0.10/libgstalsa.so
#11 0x00007f38ab08a3ce in ?? () from /usr/lib/libgstaudio-0.10.so.0
#12 0x00007f38bdf38ff6 in ?? () from /usr/lib/libglib-2.0.so.0
#13 0x00007f38c2aa3cb0 in start_thread () from /lib/libpthread.so.0
#14 0x00007f38c464b9dd in clone () from /lib/libc.so.6
#15 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f38c78d7780 (LWP 2402)):
[KCrash Handler]
#6  0x00007f38c45af595 in raise () from /lib/libc.so.6
#7  0x00007f38c45b0a16 in abort () from /lib/libc.so.6
#8  0x00007f38c4e644ff in qt_message_output(QtMsgType, char const*) () from /usr/lib/libQtCore.so.4
#9  0x00007f38c4e6468d in ?? () from /usr/lib/libQtCore.so.4
#10 0x00007f38c4e64825 in qFatal(char const*, ...) () from /usr/lib/libQtCore.so.4
#11 0x00007f38a8a1aa34 in KSharedPtr<Meta::Album>::operator-> (this=0x7fff9fe13320) at /usr/include/ksharedptr.h:126
#12 0x00007f38a8a4d031 in Collections::SqlCollectionLocation::insert (this=0x2f82f20, track=..., url=...) at /donnees/amarok-git/src/core-impl/collections/db/sql/SqlCollectionLocation.cpp:198
#13 0x00007f38a8a4ecf9 in Collections::SqlCollectionLocation::slotTransferJobFinished (this=0x2f82f20, job=0x300cf30) at /donnees/amarok-git/src/core-impl/collections/db/sql/SqlCollectionLocation.cpp:429
#14 0x00007f38a8a51342 in Collections::SqlCollectionLocation::qt_metacall (this=0x2f82f20, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7fff9fe13710) at /var/build/src/core-impl/collections/db/sql/SqlCollectionLocation.moc:152
#15 0x00007f38c4f6a31f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#16 0x00007f38c53b4162 in KJob::result(KJob*) () from /usr/lib/libkdecore.so.5
#17 0x00007f38c53b41a0 in KJob::emitResult() () from /usr/lib/libkdecore.so.5
#18 0x00007f38a8a50db0 in Collections::TransferJob::slotJobFinished (this=0x300cf30, job=0x3572780) at /donnees/amarok-git/src/core-impl/collections/db/sql/SqlCollectionLocation.cpp:709
#19 0x00007f38a8a51166 in Collections::TransferJob::qt_metacall (this=0x300cf30, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7fff9fe138f0) at /var/build/src/core-impl/collections/db/sql/SqlCollectionLocation.moc:77
#20 0x00007f38c4f6a31f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#21 0x00007f38c53b4162 in KJob::result(KJob*) () from /usr/lib/libkdecore.so.5
#22 0x00007f38c53b41a0 in KJob::emitResult() () from /usr/lib/libkdecore.so.5
#23 0x00007f38c246cbba in KIO::FileCopyJob::slotResult(KJob*) () from /usr/lib/libkio.so.5
#24 0x00007f38c246d910 in KIO::FileCopyJob::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkio.so.5
#25 0x00007f38c4f6a31f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#26 0x00007f38c53b4162 in KJob::result(KJob*) () from /usr/lib/libkdecore.so.5
#27 0x00007f38c53b41a0 in KJob::emitResult() () from /usr/lib/libkdecore.so.5
#28 0x00007f38c246402d in KIO::SimpleJob::slotFinished() () from /usr/lib/libkio.so.5
#29 0x00007f38c24654e1 in KIO::SimpleJob::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkio.so.5
#30 0x00007f38c2467730 in ?? () from /usr/lib/libkio.so.5
#31 0x00007f38c4f6a31f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#32 0x00007f38c250c161 in KIO::SlaveInterface::dispatch(int, QByteArray const&) () from /usr/lib/libkio.so.5
#33 0x00007f38c2509093 in KIO::SlaveInterface::dispatch() () from /usr/lib/libkio.so.5
#34 0x00007f38c24fc766 in KIO::Slave::gotInput() () from /usr/lib/libkio.so.5
#35 0x00007f38c24fcd7c in KIO::Slave::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkio.so.5
#36 0x00007f38c4f6a31f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#37 0x00007f38c24356a7 in ?? () from /usr/lib/libkio.so.5
#38 0x00007f38c243575d in KIO::Connection::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkio.so.5
#39 0x00007f38c4f6917a in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#40 0x00007f38c58f72b4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#41 0x00007f38c58fbdca in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#42 0x00007f38c7419306 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#43 0x00007f38c4f54e9c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#44 0x00007f38c4f586c5 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#45 0x00007f38c4f7fd73 in ?? () from /usr/lib/libQtCore.so.4
#46 0x00007f38bdf11bf3 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#47 0x00007f38bdf123d0 in ?? () from /usr/lib/libglib-2.0.so.0
#48 0x00007f38bdf1266d in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#49 0x00007f38c4f7ff0f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#50 0x00007f38c599c1ae in ?? () from /usr/lib/libQtGui.so.4
#51 0x00007f38c4f54232 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#52 0x00007f38c4f5447c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#53 0x00007f38c4f5897b in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#54 0x00000000004084ca in main (argc=3, argv=0x7fff9fe16ff8) at /donnees/amarok-git/src/main.cpp:261

Reported using DrKonqi
Comment 1 Myriam Schweingruber 2011-01-04 00:10:02 UTC
*** Bug 261510 has been marked as a duplicate of this bug. ***
Comment 2 Myriam Schweingruber 2011-01-04 00:10:36 UTC
Confirmed by duplicate.
Comment 3 Myriam Schweingruber 2011-01-09 11:59:54 UTC
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
Comment 4 Sergey Ivanov 2011-01-09 15:41:08 UTC
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;