Summary: | KPhotoAlbum crashes after Delete Image in Annotations window for an image that is already deleted | ||
---|---|---|---|
Product: | [Applications] kphotoalbum | Reporter: | Victor Lobo <victor.ip.lobo> |
Component: | Annotation Dialog | Assignee: | KPhotoAlbum Bugs <kpabugs> |
Status: | VERIFIED FIXED | ||
Severity: | crash | CC: | johannes |
Priority: | NOR | ||
Version: | 5.11.0 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/graphics/kphotoalbum/-/commit/2a138f3ac613d945516e9a885efeab927ee28d68 | Version Fixed In: | |
Sentry Crash Report: |
Description
Victor Lobo
2023-10-08 23:41:19 UTC
Git commit c62626f6c4a5f42fc2518c75aae4665e901f9c33 by Johannes Zarl-Zierl. Committed on 09/10/2023 at 22:38. Pushed by johanneszarl into branch 'master'. Discard images from annotation dialog if they are deleted. This makes the annotation dialog behave like one would expect when an image is deleted while being annotated: Old behaviour: deleted images are still present in the annotation dialog, leading to unclear semantics. New behaviour: deleted images are removed from the dialog. The dialog is closed when the last image is deleted. Additionally, this fixes two crashes that are enabled by the old behaviour: Fix a crash when deleting the currently annotated image and then toggling the fullscreen preview in the annotation window (#475387). Fix a crash when deleting the currently annotated image and then pressing delete in the annotation dialog (#475388). Related: bug 475387 M +26 -0 AnnotationDialog/Dialog.cpp M +8 -0 AnnotationDialog/Dialog.h https://invent.kde.org/graphics/kphotoalbum/-/commit/c62626f6c4a5f42fc2518c75aae4665e901f9c33 Reopening this bug since a crash occurs now on click of Delete in the Annotations window for a image that exists. STEPS TO REPRODUCE 1. Open KPhotoAlbum 2. Go to Thumbnail View 3. Open an Image/Video in Annotations window 4. Click on Delete Image icon 5. Click OK (in the Removing Items dialog popup) 6. Crash Backtrace Application: KPhotoAlbum (kphotoalbum), signal: Aborted [KCrash Handler] #4 0x00007fcb63e91e0c in __pthread_kill_implementation () from /lib64/libc.so.6 #5 0x00007fcb63e3f0e6 in raise () from /lib64/libc.so.6 #6 0x00007fcb63e268d7 in abort () from /lib64/libc.so.6 #7 0x00007fcb646bb4f9 in qt_message_fatal (message=<synthetic pointer>..., context=...) at global/qlogging.cpp:1914 #8 QMessageLogger::fatal (this=this@entry=0x7ffc31447588, msg=msg@entry=0x7fcb649d2028 "ASSERT failure in %s: \"%s\", file %s, line %d") at global/qlogging.cpp:893 #9 0x00007fcb646ba78c in qt_assert_x (where=<optimized out>, what=<optimized out>, file=<optimized out>, line=<optimized out>) at global/qglobal.cpp:3399 #10 0x00000000005f34e2 in QList<DB::ImageInfo>::at (this=0x2ca73a8, i=0) at /usr/include/qt5/QtCore/qlist.h:571 #11 0x0000000000608cda in AnnotationDialog::ImagePreviewWidget::slotDeleteImage (this=0x33c07c0) at /home/victor/kphotoalbum/AnnotationDialog/ImagePreviewWidget.cpp:230 #12 0x00000000005f9ac3 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (AnnotationDialog::ImagePreviewWidget::*)()>::call(void (AnnotationDialog::ImagePreviewWidget::*)(), AnnotationDialog::ImagePreviewWidget*, void**) (f=(void (AnnotationDialog::ImagePreviewWidget::*)(AnnotationDialog::ImagePreviewWidget * const)) 0x608bae <AnnotationDialog::ImagePreviewWidget::slotDeleteImage()>, o=0x33c07c0, arg=0x7ffc31447910) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:152 #13 0x00000000005f9961 in QtPrivate::FunctionPointer<void (AnnotationDialog::ImagePreviewWidget::*)()>::call<QtPrivate::List<>, void>(void (AnnotationDialog::ImagePreviewWidget::*)(), AnnotationDialog::ImagePreviewWidget*, void**) (f=(void (AnnotationDialog::ImagePreviewWidget::*)(AnnotationDialog::ImagePreviewWidget * const)) 0x608bae <AnnotationDialog::ImagePreviewWidget::slotDeleteImage()>, o=0x33c07c0, arg=0x7ffc31447910) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:185 #14 0x00000000005f97df in QtPrivate::QSlotObject<void (AnnotationDialog::ImagePreviewWidget::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x33c78f0, r=0x33c07c0, a=0x7ffc31447910, ret=0x0) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:418 #15 0x00007fcb64925812 in QtPrivate::QSlotObjectBase::call (a=0x7ffc31447910, r=0x33c07c0, this=0x33c78f0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398 #16 doActivate<false> (sender=0x33c66b0, signal_index=9, argv=0x7ffc31447910) at kernel/qobject.cpp:3925 #17 0x00007fcb6491e47f in QMetaObject::activate (sender=sender@entry=0x33c66b0, m=m@entry=0x7fcb65ac0280 <QAbstractButton::staticMetaObject>, local_signal_index=local_signal_index@entry=2, argv=argv@entry=0x7ffc31447910) at kernel/qobject.cpp:3985 #18 0x00007fcb65696ac2 in QAbstractButton::clicked (this=this@entry=0x33c66b0, _t1=<optimized out>) at .moc/moc_qabstractbutton.cpp:308 #19 0x00007fcb65696d2a in QAbstractButtonPrivate::emitClicked (this=0x33c6e20) at widgets/qabstractbutton.cpp:416 #20 0x00007fcb65698567 in QAbstractButtonPrivate::click (this=0x33c6e20) at widgets/qabstractbutton.cpp:409 #21 0x00007fcb65698777 in QAbstractButton::mouseReleaseEvent (this=0x33c66b0, e=0x7ffc31447ea0) at widgets/qabstractbutton.cpp:1045 #22 0x00007fcb655e6d68 in QWidget::event (this=0x33c66b0, event=0x7ffc31447ea0) at kernel/qwidget.cpp:9045 #23 0x00007fcb655a519e in QApplicationPrivate::notify_helper (this=this@entry=0x25fa1c0, receiver=receiver@entry=0x33c66b0, e=e@entry=0x7ffc31447ea0) at kernel/qapplication.cpp:3640 #24 0x00007fcb655ad5cf in QApplication::notify (this=<optimized out>, receiver=<optimized out>, e=0x7ffc31447ea0) at kernel/qapplication.cpp:3084 #25 0x00007fcb648ed568 in QCoreApplication::notifyInternal2 (receiver=0x33c66b0, event=0x7ffc31447ea0) at kernel/qcoreapplication.cpp:1064 #26 0x00007fcb648ed73e in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1474 #27 0x00007fcb655ab92e in QApplicationPrivate::sendMouseEvent (receiver=receiver@entry=0x33c66b0, event=event@entry=0x7ffc31447ea0, alienWidget=<optimized out>, nativeWidget=0x2ca7360, buttonDown=buttonDown@entry=0x7fcb65af2330 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at kernel/qapplication.cpp:2622 #28 0x00007fcb655ff7fd in QWidgetWindow::handleMouseEvent (this=this@entry=0x3e99420, event=event@entry=0x7ffc31448150) at kernel/qwidgetwindow.cpp:684 #29 0x00007fcb65602d1f in QWidgetWindow::event (this=0x3e99420, event=0x7ffc31448150) at kernel/qwidgetwindow.cpp:300 #30 0x00007fcb655a519e in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x3e99420, e=0x7ffc31448150) at kernel/qapplication.cpp:3640 #31 0x00007fcb648ed568 in QCoreApplication::notifyInternal2 (receiver=0x3e99420, event=0x7ffc31448150) at kernel/qcoreapplication.cpp:1064 #32 0x00007fcb648ed73e in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1474 #33 0x00007fcb64d7d0eb in QGuiApplicationPrivate::processMouseEvent (e=0x3ed1800) at kernel/qguiapplication.cpp:2285 #34 0x00007fcb64d5036c in QWindowSystemInterface::sendWindowSystemEvents (flags=flags@entry=...) at kernel/qwindowsysteminterface.cpp:1169 #35 0x00007fcb58f1b1aa in xcbSourceDispatch (source=<optimized out>) at qxcbeventdispatcher.cpp:105 #36 0x00007fcb6112b9d8 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0 #37 0x00007fcb6112bde8 in ?? () from /lib64/libglib-2.0.so.0 #38 0x00007fcb6112be7c in g_main_context_iteration () from /lib64/libglib-2.0.so.0 #39 0x00007fcb649464a6 in QEventDispatcherGlib::processEvents (this=0x26d4e30, flags=...) at kernel/qeventdispatcher_glib.cpp:423 #40 0x00007fcb648ebffb in QEventLoop::exec (this=this@entry=0x7ffc31448480, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69 #41 0x00007fcb657ada07 in QDialog::exec (this=0x2ca7360) at ../../include/QtCore/../../src/corelib/global/qflags.h:121 #42 0x00000000005ea0ee in AnnotationDialog::Dialog::exec (this=0x2ca7360) at /home/victor/kphotoalbum/AnnotationDialog/Dialog.cpp:957 #43 0x00000000005e8399 in AnnotationDialog::Dialog::configure (this=0x2ca7360, list=..., oneAtATime=true) at /home/victor/kphotoalbum/AnnotationDialog/Dialog.cpp:768 #44 0x0000000000536c57 in MainWindow::Window::configImages (this=0x282c740, list=..., oneAtATime=true) at /home/victor/kphotoalbum/MainWindow/Window.cpp:509 #45 0x0000000000536bf5 in MainWindow::Window::configureImages (list=..., oneAtATime=true) at /home/victor/kphotoalbum/MainWindow/Window.cpp:503 #46 0x0000000000536b4c in MainWindow::Window::configureImages (this=0x282c740, oneAtATime=true) at /home/victor/kphotoalbum/MainWindow/Window.cpp:497 #47 0x00000000005369db in MainWindow::Window::slotConfigureImagesOneAtATime (this=0x282c740) at /home/victor/kphotoalbum/MainWindow/Window.cpp:483 #48 0x000000000054e828 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (MainWindow::Window::*)()>::call(void (MainWindow::Window::*)(), MainWindow::Window*, void**) (f=(void (MainWindow::Window::*)(MainWindow::Window * const)) 0x5369be <MainWindow::Window::slotConfigureImagesOneAtATime()>, o=0x282c740, arg=0x7ffc314488a0) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:152 #49 0x000000000054de6d in QtPrivate::FunctionPointer<void (MainWindow::Window::*)()>::call<QtPrivate::List<>, void>(void (MainWindow::Window::*)(), MainWindow::Window*, void**) (f=(void (MainWindow::Window::*)(MainWindow::Window * const)) 0x5369be <MainWindow::Window::slotConfigureImagesOneAtATime()>, o=0x282c740, arg=0x7ffc314488a0) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:185 #50 0x000000000054c5e9 in QtPrivate::QSlotObject<void (MainWindow::Window::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x2dd0a60, r=0x282c740, a=0x7ffc314488a0, ret=0x0) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:418 #51 0x00007fcb64925812 in QtPrivate::QSlotObjectBase::call (a=0x7ffc314488a0, r=0x282c740, this=0x2dd0a60) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398 #52 doActivate<false> (sender=0x2dd0b90, signal_index=4, argv=0x7ffc314488a0) at kernel/qobject.cpp:3925 #53 0x00007fcb6491e47f in QMetaObject::activate (sender=sender@entry=0x2dd0b90, m=m@entry=0x7fcb65abacc0 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7ffc314488a0) at kernel/qobject.cpp:3985 #54 0x00007fcb6559e8b2 in QAction::triggered (this=this@entry=0x2dd0b90, _t1=<optimized out>) at .moc/moc_qaction.cpp:376 #55 0x00007fcb655a142f in QAction::activate (this=0x2dd0b90, event=<optimized out>) at kernel/qaction.cpp:1161 #56 0x00007fcb65725ef2 in QMenuPrivate::activateCausedStack (this=this@entry=0x2d7ef20, causedStack=..., action=action@entry=0x2dd0b90, action_e=action_e@entry=QAction::Trigger, self=self@entry=true) at widgets/qmenu.cpp:1384 #57 0x00007fcb6572dd23 in QMenuPrivate::activateAction (this=0x2d7ef20, action=0x2dd0b90, action_e=QAction::Trigger, self=true) at widgets/qmenu.cpp:1461 #58 0x00007fcb655e6d68 in QWidget::event (this=0x7ffc31449560, event=0x7ffc31448e90) at kernel/qwidget.cpp:9045 #59 0x00007fcb655a519e in QApplicationPrivate::notify_helper (this=this@entry=0x25fa1c0, receiver=receiver@entry=0x7ffc31449560, e=e@entry=0x7ffc31448e90) at kernel/qapplication.cpp:3640 #60 0x00007fcb655ad5cf in QApplication::notify (this=<optimized out>, receiver=<optimized out>, e=0x7ffc31448e90) at kernel/qapplication.cpp:3084 #61 0x00007fcb648ed568 in QCoreApplication::notifyInternal2 (receiver=0x7ffc31449560, event=0x7ffc31448e90) at kernel/qcoreapplication.cpp:1064 #62 0x00007fcb648ed73e in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1474 #63 0x00007fcb655ab92e in QApplicationPrivate::sendMouseEvent (receiver=0x7ffc31449560, event=event@entry=0x7ffc31448e90, alienWidget=<optimized out>, nativeWidget=0x7ffc31449560, buttonDown=buttonDown@entry=0x7fcb65af2330 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at kernel/qapplication.cpp:2622 #64 0x00007fcb656002ca in QWidgetWindow::handleMouseEvent (this=this@entry=0x2da6c90, event=event@entry=0x7ffc31449140) at kernel/qwidgetwindow.cpp:580 #65 0x00007fcb65602d1f in QWidgetWindow::event (this=0x2da6c90, event=0x7ffc31449140) at kernel/qwidgetwindow.cpp:300 #66 0x00007fcb655a519e in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x2da6c90, e=0x7ffc31449140) at kernel/qapplication.cpp:3640 #67 0x00007fcb648ed568 in QCoreApplication::notifyInternal2 (receiver=0x2da6c90, event=0x7ffc31449140) at kernel/qcoreapplication.cpp:1064 #68 0x00007fcb648ed73e in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1474 #69 0x00007fcb64d7d0eb in QGuiApplicationPrivate::processMouseEvent (e=0x2d5e520) at kernel/qguiapplication.cpp:2285 #70 0x00007fcb64d5036c in QWindowSystemInterface::sendWindowSystemEvents (flags=flags@entry=...) at kernel/qwindowsysteminterface.cpp:1169 #71 0x00007fcb58f1b1aa in xcbSourceDispatch (source=<optimized out>) at qxcbeventdispatcher.cpp:105 #72 0x00007fcb6112b9d8 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0 #73 0x00007fcb6112bde8 in ?? () from /lib64/libglib-2.0.so.0 #74 0x00007fcb6112be7c in g_main_context_iteration () from /lib64/libglib-2.0.so.0 #75 0x00007fcb649464a6 in QEventDispatcherGlib::processEvents (this=0x26d4e30, flags=...) at kernel/qeventdispatcher_glib.cpp:423 #76 0x00007fcb648ebffb in QEventLoop::exec (this=this@entry=0x7ffc31449480, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69 #77 0x00007fcb6572b70f in QMenuPrivate::exec(QPoint const&, QAction*, std::function<QPoint (QSize const&)>) (this=0x2d7ef20, p=..., action=0x0, positionFunction=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:121 #78 0x00007fcb6572b82f in QMenu::exec (this=<optimized out>, p=..., action=<optimized out>) at widgets/qmenu.cpp:2686 #79 0x0000000000541abe in MainWindow::Window::contextMenuEvent (this=0x282c740, e=0x7ffc314498b0) at /home/victor/kphotoalbum/MainWindow/Window.cpp:1318 #80 0x00007fcb655e6d68 in QWidget::event (this=0x282c740, event=0x7ffc314498b0) at kernel/qwidget.cpp:9045 #81 0x00007fcb6ff32469 in KXmlGuiWindow::event(QEvent*) () from /lib64/libKF5XmlGui.so.5 #82 0x0000000000538843 in MainWindow::Window::event (this=0x282c740, event=0x7ffc314498b0) at /home/victor/kphotoalbum/MainWindow/Window.cpp:751 #83 0x00007fcb655a519e in QApplicationPrivate::notify_helper (this=this@entry=0x25fa1c0, receiver=receiver@entry=0x282c740, e=e@entry=0x7ffc314498b0) at kernel/qapplication.cpp:3640 #84 0x00007fcb655adaaa in QApplication::notify (this=<optimized out>, receiver=<optimized out>, e=0x7ffc31449ae0) at kernel/qapplication.cpp:3246 #85 0x00007fcb648ed568 in QCoreApplication::notifyInternal2 (receiver=0x2be1660, event=0x7ffc31449ae0) at kernel/qcoreapplication.cpp:1064 #86 0x00007fcb648ed5b2 in QCoreApplication::forwardEvent (receiver=<optimized out>, event=<optimized out>, originatingEvent=<optimized out>) at kernel/qcoreapplication.cpp:1079 #87 0x00007fcb655fff59 in QWidgetWindow::handleMouseEvent (this=this@entry=0x2af1d20, event=event@entry=0x7ffc31449dd0) at kernel/qwidgetwindow.cpp:692 #88 0x00007fcb65602d1f in QWidgetWindow::event (this=0x2af1d20, event=0x7ffc31449dd0) at kernel/qwidgetwindow.cpp:300 #89 0x00007fcb655a519e in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x2af1d20, e=0x7ffc31449dd0) at kernel/qapplication.cpp:3640 #90 0x00007fcb648ed568 in QCoreApplication::notifyInternal2 (receiver=0x2af1d20, event=0x7ffc31449dd0) at kernel/qcoreapplication.cpp:1064 #91 0x00007fcb648ed73e in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1474 #92 0x00007fcb64d7d0eb in QGuiApplicationPrivate::processMouseEvent (e=0x2d5a660) at kernel/qguiapplication.cpp:2285 #93 0x00007fcb64d5036c in QWindowSystemInterface::sendWindowSystemEvents (flags=flags@entry=...) at kernel/qwindowsysteminterface.cpp:1169 #94 0x00007fcb58f1b1aa in xcbSourceDispatch (source=<optimized out>) at qxcbeventdispatcher.cpp:105 #95 0x00007fcb6112b9d8 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0 #96 0x00007fcb6112bde8 in ?? () from /lib64/libglib-2.0.so.0 #97 0x00007fcb6112be7c in g_main_context_iteration () from /lib64/libglib-2.0.so.0 #98 0x00007fcb649464a6 in QEventDispatcherGlib::processEvents (this=0x26d4e30, flags=...) at kernel/qeventdispatcher_glib.cpp:423 #99 0x00007fcb648ebffb in QEventLoop::exec (this=this@entry=0x7ffc3144a100, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69 #100 0x00007fcb648f4490 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121 #101 0x0000000000472a30 in main (argc=2, argv=0x7ffc3144a808) at /home/victor/kphotoalbum/main.cpp:161 [Inferior 1 (process 2763) detached] Git commit 2a138f3ac613d945516e9a885efeab927ee28d68 by Johannes Zarl-Zierl. Committed on 13/10/2023 at 09:09. Pushed by johanneszarl into branch 'master'. Fix regression when deleting images The introduction of AnnotationDialog::Dialog::slotDiscardImages() reimplemented the things done in Dialog::slotDeleteImage(), causing duplicated removal of images from the ImagePreviewWidget and annotation Dialog. This caused a crash when deleting an image via the delete button of the annotation dialog. Fortunately, it turns out that the slotDiscardImages function does everything slotDeleteImage() does, which means that the older code could simply be removed. Note: This patch removes the action "annotationdialog-delete-image", which called Dialog::slotDeleteImage directly, and had a conflicting default shortcut Ctrl+Delete (conflicting with Viewer -> delete image). I believe the original intention for that action was to call ImagePreviewWidget::slotDeleteImage(). Since the action was clearly not in a working state, I thought it better to remove it entirely. M +0 -33 AnnotationDialog/Dialog.cpp M +0 -1 AnnotationDialog/Dialog.h M +1 -10 AnnotationDialog/ImagePreviewWidget.cpp M +1 -2 AnnotationDialog/ImagePreviewWidget.h https://invent.kde.org/graphics/kphotoalbum/-/commit/2a138f3ac613d945516e9a885efeab927ee28d68 Thanks! I believe the bug is now fixed for good. Yes, fix works well. Thank you! |