Version: 0.10.0-SVN-890620 (using KDE 4.1.3) Compiler: cmake 2.6, gcc 4.1.2 OS: Linux Installed from: Gentoo Packages When moving all photos from an album to an other crashes digikam. gdb trace & patch coming.
Created attachment 28928 [details] gdb trace
Created attachment 28929 [details] patch Patch to apply in digikam/utilities/imageeditor/editor Solved the problem.
Backtrace from comment #1: digikam(21661) Digikam::ImageScanner::addImage: Adding new item "144.JPG" digikam(21661) Digikam::ImageScanner::copyFromSource: Recognized "XXX/144.JPG" as copied from 61584 ASSERT failure in QList<T>::operator[]: "index out of range", file /usr/include/qt4/QtCore/qlist.h, line 401 Program received signal SIGABRT, Aborted. [Switching to Thread 0xb4c29700 (LWP 21661)] 0xffffe424 in __kernel_vsyscall () (gdb) (gdb) bt #0 0xffffe424 in __kernel_vsyscall () #1 0xb51edf4f in raise () from /lib/libc.so.6 #2 0xb530eff4 in ?? () from /lib/libc.so.6 #3 0xb4c29700 in ?? () #4 0xb51ef958 in abort () from /lib/libc.so.6 #5 0x00000040 in ?? () #6 0x0808f38a in Digikam::ImageWindow::removeItem (this=0xaa31cac8, index=1) at /home/build/digikam_4.1/graphics/digikam/utilities/imageeditor/editor/imagewindow.cpp:1135 #7 0x0808f6ae in Digikam::ImageWindow::slotCollectionImageChange ( this=0xaa31cac8, changeset=@0xa6ff1a88) at /home/build/digikam_4.1/graphics/digikam/utilities/imageeditor/editor/imagewindow.cpp:1184 #8 0x08096b1f in Digikam::ImageWindow::qt_metacall (this=0xaa31cac8, _c=QMetaObject::InvokeMetaMethod, _id=30, _a=0xa6ff1a78) at /home/build/digikam_4.1/graphics/build/digikam/digikam/imagewindow.moc:152 #9 0xb7e1517a in QMetaCallEvent::placeMetaCall () from /usr/lib/qt4/libQtCore.so.4 #10 0xb7e1701d in QObject::event () from /usr/lib/qt4/libQtCore.so.4 #11 0xb5fa496a in QWidget::event () from /usr/lib/qt4/libQtGui.so.4 #12 0xb6312dd1 in QMainWindow::event () from /usr/lib/qt4/libQtGui.so.4 #13 0xb79aa1a0 in KMainWindow::event () from /usr/kde/4.1/lib/libkdeui.so.5 #14 0xaa31cac8 in ?? () #15 0xaa981670 in ?? () #16 0x00000000 in ?? ()
Yann, Thanks for the patch... It's sound fine for me... Andi, What do you think about ? Gilles
Sounds ok, although I can not reproduce the crash here... moved my whole albums and images around, works like a charm. Andi
SVN commit 891327 by mwiesweg: Patch by Yann Le Hir: Fix off-by-one error causing a crash when the last image is removed CCBUG: 176472 M +1 -1 imagewindow.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=891327
Yann, you see that I committed one line of your patch that fixes a problem that can lead to a crash. As to the rest of your patch: If you remove index first, then index and not index+1 already points to the next entry. If you increment index, you get the entry two slots after the initial entry. Or am I mistaken?
Yes, you're right about my patch , I completly forgot about this index changing after a remove. But with your patch the program will never delete the first element (id 0) of a list which has 1 element. So maybe doing something like that : d->urlList.removeAt(index); if (!d->imageInfoList.isEmpty()) d->imageInfoList.removeAt(index); if (index < d->urlList.size()) { // Try to get the next image in the current Album... d->urlCurrent = d->urlList[index]; d->imageInfoCurrent = d->imageInfoList[index]; return true; } else if(index - 1 >= 0) { // Try to get the previous image in the current Album. --index; d->urlCurrent = d->urlList[index]; d->imageInfoCurrent = d->imageInfoList[index]; return true; }
SVN commit 891351 by mwiesweg: Patch from Yann Le Hir: The last element of a list of size 1 was never deleted. CCBUG: 176472 M +7 -10 imagewindow.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=891351