OrganizeCollectionDialog null track pointer bug

Casey Link unnamedrambler at gmail.com
Fri Jun 13 07:52:16 CEST 2008


This one is probably for Max.

Setup: Occasionally (I can't determine what the cause is) when you
Copy to the Local Collection amarok crashes with the bt at the end of
this email.
I spent some time debugging this and the cause is
OrganizeCollectionDialog::buildDestination() de-referencing a null
track ptr. If you add a if( track.isNull() ) {  //debug and/or return
} to the method then Amarok doesn't crash, however the Destination
Preview (in the dialog) is blank...not an optimal fix.

After a bit more sleuthing I am pretty confident that
OrganizeCollectionDialog::setPreviewTrack( ) is not being called,
which means (as far as I can tell) that preview() is being called
after the constructor where m_previewTrack is set to 0.

Thread 1 (Thread 0xb3ac16f0 (LWP 4719)):
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb7da3eeb in waitpid () from /lib/libpthread.so.0
#2  0xb78b30cd in Amarok::Crash::crashHandler () at
/share/devel/kdesvn/extragear/amarokgit/src/CrashHandler.cpp:254
#3  <signal handler called>
#4  0xffffe424 in __kernel_vsyscall ()
#5  0xb49ee525 in raise () from /lib/libc.so.6
#6  0xb49efd41 in abort () from /lib/libc.so.6
#7  0xb7e1f899 in qt_message_output (msgType=QtFatalMsg,
buf=0xbfde9430 "ASSERT: \"d\" in file
/share/devel/kde/include/ksharedptr.h, line 115")
    at /share/devel/kdesvn/qt-copy/src/corelib/global/qglobal.cpp:2058
#8  0xb7e1f8fd in qFatal (msg=0xb7f74ca0 "ASSERT: \"%s\" in file %s,
line %d") at /share/devel/kdesvn/qt-copy/src/corelib/global/qglobal.cpp:2260
#9  0xb7e1fd43 in qt_assert (assertion=0xafa34d9b "d", file=0xafa2ef98
"/share/devel/kde/include/ksharedptr.h", line=115)
    at /share/devel/kdesvn/qt-copy/src/corelib/global/qglobal.cpp:1828
#10 0xaf9df8b7 in OrganizeCollectionDialog::buildDestination
(this=0xa799400, format=@0xbfdeb738, track=@0xa79941c)
    at /share/devel/kde/include/ksharedptr.h:115
#11 0xaf9e0f4a in OrganizeCollectionDialog::preview (this=0xa799400,
format=@0xbfdeb738)
    at /share/devel/kdesvn/extragear/amarokgit/src/collection/sqlcollection/OrganizeCollectionDialog.cpp:264
#12 0xaf9e0fbb in OrganizeCollectionDialog::slotUpdatePreview
(this=0xa799400)
    at /share/devel/kdesvn/extragear/amarokgit/src/collection/sqlcollection/OrganizeCollectionDialog.cpp:359
#13 0xaf9e2526 in OrganizeCollectionDialog::init (this=0xa799400)
    at /share/devel/kdesvn/extragear/amarokgit/src/collection/sqlcollection/OrganizeCollectionDialog.cpp:354
#14 0xaf9e2a87 in OrganizeCollectionDialog (this=0xa799400,
tracks=@0xa79f0a0, parent=0x0, name=0x0, modal=<value optimized out>,
caption=@0xbfdeb848,
    buttonMask=@0xbfdeb844) at
/share/devel/kdesvn/extragear/amarokgit/src/collection/sqlcollection/OrganizeCollectionDialog.cpp:108
#15 0xaf9ff650 in SqlCollectionLocation::showDestinationDialog
(this=0xa2ed1f8, tracks=@0xa79f0a0, removeSources=false)
    at /share/devel/kdesvn/extragear/amarokgit/src/collection/sqlcollection/SqlCollectionLocation.cpp:128
#16 0xb78038d5 in CollectionLocation::slotPrepareOperation
(this=0xa2ed1f8, tracks=@0xa79f0a0, removeSources=<value optimized
out>)
    at /share/devel/kdesvn/extragear/amarokgit/src/collection/CollectionLocation.cpp:239
#17 0xb7804845 in CollectionLocation::qt_metacall (this=0xa2ed1f8,
_c=QMetaObject::InvokeMetaMethod, _id=9, _a=0xbfdeb9b8)
    at /share/devel/kdesvn/build/extragear/multimedia/src/CollectionLocation.moc:106
#18 0xaf9ff54a in SqlCollectionLocation::qt_metacall (this=0xa2ed1f8,
_c=QMetaObject::InvokeMetaMethod, _id=13, _a=0xbfdeb9b8)
    at /share/devel/kdesvn/build/extragear/multimedia/src/collection/sqlcollection/SqlCollectionLocation.moc:64
#19 0xb7f3233f in QMetaObject::activate (sender=0xa79f090,
from_signal_index=6, to_signal_index=6, argv=0xbfdeb9b8)
    at /share/devel/kdesvn/qt-copy/src/corelib/kernel/qobject.cpp:3007
#20 0xb7f327c1 in QMetaObject::activate (sender=0xa79f090,
m=0xb79bb02c, local_signal_index=2, argv=0xbfdeb9b8)
    at /share/devel/kdesvn/qt-copy/src/corelib/kernel/qobject.cpp:3080
#21 0xb7803abf in CollectionLocation::prepareOperation
(this=0xa79f090, _t1=@0xa79f0a0, _t2=false)
    at /share/devel/kdesvn/build/extragear/multimedia/src/CollectionLocation.moc:136
#22 0xb7803afc in CollectionLocation::slotShowSourceDialogDone
(this=0xa79f090)
    at /share/devel/kdesvn/extragear/amarokgit/src/collection/CollectionLocation.cpp:226
#23 0xb7803b2d in CollectionLocation::showSourceDialog
(this=0xa79f090, tracks=@0xa79f0a0, removeSources=false)
    at /share/devel/kdesvn/extragear/amarokgit/src/collection/CollectionLocation.cpp:200
#24 0xb780421d in CollectionLocation::startWorkflow (this=0xa79f090,
tracks=@0xa79f0a0, removeSources=false)
    at /share/devel/kdesvn/extragear/amarokgit/src/collection/CollectionLocation.cpp:317
#25 0xb7804356 in CollectionLocation::prepareCopy (this=0xa79f090,
tracks=@0xa79f0a0, destination=0xa2ed1f8)
    at /share/devel/kdesvn/extragear/amarokgit/src/collection/CollectionLocation.cpp:100
#26 0xb78043ca in CollectionLocation::queryDone (this=0xa79f090) at
/share/devel/kdesvn/extragear/amarokgit/src/collection/CollectionLocation.cpp:293
#27 0xb7804770 in CollectionLocation::qt_metacall (this=0xa79f090,
_c=QMetaObject::InvokeMetaMethod, _id=15, _a=0xbfdebaf4)
    at /share/devel/kdesvn/build/extragear/multimedia/src/CollectionLocation.moc:112
#28 0xb7f3233f in QMetaObject::activate (sender=0xa79ff50,
from_signal_index=12, to_signal_index=12, argv=0x0)
    at /share/devel/kdesvn/qt-copy/src/corelib/kernel/qobject.cpp:3007
#29 0xb7f327c1 in QMetaObject::activate (sender=0xa79ff50,
m=0xb79bb18c, local_signal_index=8, argv=0x0)
    at /share/devel/kdesvn/qt-copy/src/corelib/kernel/qobject.cpp:3080
#30 0xb7806c57 in QueryMaker::queryDone (this=0xa79ff50) at
/share/devel/kdesvn/build/extragear/multimedia/src/QueryMaker.moc:156
#31 0xb7804df3 in MetaQueryMaker::slotQueryDone (this=0xa79ff50) at
/share/devel/kdesvn/extragear/amarokgit/src/collection/MetaQueryMaker.cpp:337
#32 0xb7804e53 in MetaQueryMaker::qt_metacall (this=0xa79ff50,
_c=QMetaObject::InvokeMetaMethod, _id=0, _a=0xbfdebc24)
    at /share/devel/kdesvn/build/extragear/multimedia/src/MetaQueryMaker.moc:65
#33 0xb7f3233f in QMetaObject::activate (sender=0xa79d7e8,
from_signal_index=12, to_signal_index=12, argv=0x0)
    at /share/devel/kdesvn/qt-copy/src/corelib/kernel/qobject.cpp:3007
#34 0xb7f327c1 in QMetaObject::activate (sender=0xa79d7e8,
m=0xb79bb18c, local_signal_index=8, argv=0x0)
    at /share/devel/kdesvn/qt-copy/src/corelib/kernel/qobject.cpp:3080
#35 0xb7806c57 in QueryMaker::queryDone (this=0xa79d7e8) at
/share/devel/kdesvn/build/extragear/multimedia/src/QueryMaker.moc:156
#36 0xb776624b in ServiceSqlQueryMaker::done (this=0xa79d7e8,
job=0xa4f4720)
    at /share/devel/kdesvn/extragear/amarokgit/src/servicebrowser/ServiceSqlQueryMaker.cpp:167
#37 0xb77662bf in ServiceSqlQueryMaker::qt_metacall (this=0xa79d7e8,
_c=QMetaObject::InvokeMetaMethod, _id=0, _a=0xbfdebddc)
    at /share/devel/kdesvn/build/extragear/multimedia/src/ServiceSqlQueryMaker.moc:66
#38 0xb7f3233f in QMetaObject::activate (sender=0xa4f4720,
from_signal_index=5, to_signal_index=5, argv=0xbfdebddc)
    at /share/devel/kdesvn/qt-copy/src/corelib/kernel/qobject.cpp:3007
#39 0xb7f327c1 in QMetaObject::activate (sender=0xa4f4720,
m=0xb557f8d4, local_signal_index=1, argv=0xbfdebddc)
    at /share/devel/kdesvn/qt-copy/src/corelib/kernel/qobject.cpp:3080
#40 0xb5576443 in ThreadWeaver::Job::done (this=0xa4f4720,
_t1=0xa4f4720) at
/share/devel/kdesvn/build/kdelibs/threadweaver/Weaver/Job.moc:89
#41 0xb557661a in ThreadWeaver::Job::qt_metacall (this=0xa4f4720,
_c=QMetaObject::InvokeMetaMethod, _id=-2, _a=0xa09b660)
    at /share/devel/kdesvn/build/kdelibs/threadweaver/Weaver/Job.moc:70
#42 0xb7f2c2e2 in QMetaCallEvent::placeMetaCall (this=0xa7a0888,
object=0xa4f4720) at
/share/devel/kdesvn/qt-copy/src/corelib/kernel/qobject.cpp:535
#43 0xb7f30684 in QObject::event (this=0xa4f4720, e=0xa7a0888) at
/share/devel/kdesvn/qt-copy/src/corelib/kernel/qobject.cpp:1137
#44 0xb56d450d in QApplicationPrivate::notify_helper (this=0x8b65758,
receiver=0xa4f4720, e=0xa7a0888)
    at /share/devel/kdesvn/qt-copy/src/gui/kernel/qapplication.cpp:3772
#45 0xb56d4826 in QApplication::notify (this=0xbfdec63c,
receiver=0xa4f4720, e=0xa7a0888)
    at /share/devel/kdesvn/qt-copy/src/gui/kernel/qapplication.cpp:3366
#46 0xb74203ed in KApplication::notify (this=0xbfdec63c,
receiver=0xa4f4720, event=0xa7a0888)
    at /share/devel/kdesvn/kdelibs/kdeui/kernel/kapplication.cpp:311
#47 0xb7f1d696 in QCoreApplication::notifyInternal (this=0xbfdec63c,
receiver=0xa4f4720, event=0xa7a0888)
    at /share/devel/kdesvn/qt-copy/src/corelib/kernel/qcoreapplication.cpp:583
#48 0xb7f211d7 in QCoreApplication::sendEvent (receiver=0xa4f4720,
event=0xa7a0888)
    at ../../include/QtCore/../../../../qt-copy/src/corelib/kernel/qcoreapplication.h:215
#49 0xb7f1dbae in QCoreApplicationPrivate::sendPostedEvents
(receiver=0x0, event_type=0, data=0x8b4bf48)
    at /share/devel/kdesvn/qt-copy/src/corelib/kernel/qcoreapplication.cpp:1195
#50 0xb7f1dd5f in QCoreApplication::sendPostedEvents (receiver=0x0,
event_type=0)
    at /share/devel/kdesvn/qt-copy/src/corelib/kernel/qcoreapplication.cpp:1091
#51 0xb7f4e42a in QCoreApplication::sendPostedEvents () at
../../include/QtCore/../../../../qt-copy/src/corelib/kernel/qcoreapplication.h:220
#52 0xb7f4d63b in postEventSourceDispatch (s=0x8b678c8) at
/share/devel/kdesvn/qt-copy/src/corelib/kernel/qeventdispatcher_glib.cpp:211
#53 0xb491e748 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#54 0xb492199e in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#55 0xb4921eec in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#56 0xb7f4ca54 in QEventDispatcherGlib::processEvents (this=0x8b651a8,
flags=@0xbfdec538)
    at /share/devel/kdesvn/qt-copy/src/corelib/kernel/qeventdispatcher_glib.cpp:325
#57 0xb577af28 in QGuiEventDispatcherGlib::processEvents
(this=0x8b651a8, flags=@0xbfdec568)
    at /share/devel/kdesvn/qt-copy/src/gui/kernel/qguieventdispatcher_glib.cpp:204
#58 0xb7f1a54a in QEventLoop::processEvents (this=0xbfdec5e0,
flags=@0xbfdec5a4) at
/share/devel/kdesvn/qt-copy/src/corelib/kernel/qeventloop.cpp:149
#59 0xb7f1a789 in QEventLoop::exec (this=0xbfdec5e0,
flags=@0xbfdec5e8) at
/share/devel/kdesvn/qt-copy/src/corelib/kernel/qeventloop.cpp:196
#60 0xb7f1de7f in QCoreApplication::exec () at
/share/devel/kdesvn/qt-copy/src/corelib/kernel/qcoreapplication.cpp:845
#61 0xb56d4226 in QApplication::exec () at
/share/devel/kdesvn/qt-copy/src/gui/kernel/qapplication.cpp:3304
#62 0x0804b456 in main (argc=1, argv=0xbfdeca54) at
/share/devel/kdesvn/extragear/amarokgit/src/main.cpp:125
#0  0xffffe424 in __kernel_vsyscall ()


More information about the Amarok-devel mailing list