Bug 342510 - KPA crashed when confirming detected face
Summary: KPA crashed when confirming detected face
Status: RESOLVED FIXED
Alias: None
Product: kphotoalbum
Classification: Applications
Component: Annotation Dialog (show other bugs)
Version: GIT master
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: KPhotoAlbum Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-05 13:37 UTC by Martin Jost
Modified: 2015-02-12 20:06 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Possible workaround for crash (931 bytes, patch)
2015-01-05 15:49 UTC, Johannes Zarl-Zierl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Jost 2015-01-05 13:37:19 UTC
- Opened tag dialog for one photo
- Had let KPA detect the face
- Clicked the confirmation button for the recognized face ("This is ...")
  => BOOOM

Reproducible: Always

Steps to Reproduce:
see "details"



Note: KPA identifies itself as " (v4.5-141-g7e9cdc7-RelWithDebInfo)"
Comment 1 Martin Jost 2015-01-05 13:38:45 UTC
Sorry, missed the backtrace. Here it is:

-- Backtrace:
Application: KPhotoAlbum (kphotoalbum), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7fcc089ea900 (LWP 13996))]

Thread 5 (Thread 0x7fcbe3fff700 (LWP 13999)):
#0  0x00007fcc03e140af in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007fcc040a7b66 in wait (time=18446744073709551615, this=0x5a367e0) at thread/qwaitcondition_unix.cpp:86
#2  QWaitCondition::wait (this=this@entry=0x5a367a8, mutex=mutex@entry=0x5a367b0, time=time@entry=18446744073709551615) at thread/qwaitcondition_unix.cpp:158
#3  0x00000000005470fa in ImageManager::AsyncLoader::next (this=0x5a36780) at /home/pd/pd-sw/foto/kphotoalbum/kphotoalbum_git/ImageManager/AsyncLoader.cpp:143
#4  0x0000000000546860 in ImageManager::ImageLoaderThread::run (this=0x57f14f0) at /home/pd/pd-sw/foto/kphotoalbum/kphotoalbum_git/ImageManager/ImageLoaderThread.cpp:56
#5  0x00007fcc040a768f in QThreadPrivate::start (arg=0x57f14f0) at thread/qthread_unix.cpp:338
#6  0x00007fcc03e100db in start_thread () from /lib64/libpthread.so.0
#7  0x00007fcc0331f58d in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7fcbe37fe700 (LWP 14000)):
#0  0x00007fcc03e140af in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007fcc040a7b66 in wait (time=18446744073709551615, this=0x5a367e0) at thread/qwaitcondition_unix.cpp:86
#2  QWaitCondition::wait (this=this@entry=0x5a367a8, mutex=mutex@entry=0x5a367b0, time=time@entry=18446744073709551615) at thread/qwaitcondition_unix.cpp:158
#3  0x00000000005470fa in ImageManager::AsyncLoader::next (this=0x5a36780) at /home/pd/pd-sw/foto/kphotoalbum/kphotoalbum_git/ImageManager/AsyncLoader.cpp:143
#4  0x0000000000546860 in ImageManager::ImageLoaderThread::run (this=0x5a36ec0) at /home/pd/pd-sw/foto/kphotoalbum/kphotoalbum_git/ImageManager/ImageLoaderThread.cpp:56
#5  0x00007fcc040a768f in QThreadPrivate::start (arg=0x5a36ec0) at thread/qthread_unix.cpp:338
#6  0x00007fcc03e100db in start_thread () from /lib64/libpthread.so.0
#7  0x00007fcc0331f58d in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7fcbe2ffd700 (LWP 14001)):
#0  0x00007fcc03e140af in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007fcc040a7b66 in wait (time=18446744073709551615, this=0x5a367e0) at thread/qwaitcondition_unix.cpp:86
#2  QWaitCondition::wait (this=this@entry=0x5a367a8, mutex=mutex@entry=0x5a367b0, time=time@entry=18446744073709551615) at thread/qwaitcondition_unix.cpp:158
#3  0x00000000005470fa in ImageManager::AsyncLoader::next (this=0x5a36780) at /home/pd/pd-sw/foto/kphotoalbum/kphotoalbum_git/ImageManager/AsyncLoader.cpp:143
#4  0x0000000000546860 in ImageManager::ImageLoaderThread::run (this=0x5a37260) at /home/pd/pd-sw/foto/kphotoalbum/kphotoalbum_git/ImageManager/ImageLoaderThread.cpp:56
#5  0x00007fcc040a768f in QThreadPrivate::start (arg=0x5a37260) at thread/qthread_unix.cpp:338
#6  0x00007fcc03e100db in start_thread () from /lib64/libpthread.so.0
#7  0x00007fcc0331f58d in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7fcbda21d700 (LWP 14046)):
#0  0x00007fcbfb704ffa in ?? () from /usr/lib64/libglib-2.0.so.0
#1  0x00007fcbfb7052b9 in g_mutex_unlock () from /usr/lib64/libglib-2.0.so.0
#2  0x00007fcbfb6c4d38 in g_main_context_prepare () from /usr/lib64/libglib-2.0.so.0
#3  0x00007fcbfb6c5523 in ?? () from /usr/lib64/libglib-2.0.so.0
#4  0x00007fcbfb6c570c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#5  0x00007fcc041d3d76 in QEventDispatcherGlib::processEvents (this=0x7fcbd00008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:427
#6  0x00007fcc041a5d0f in QEventLoop::processEvents (this=this@entry=0x7fcbda21cca0, flags=...) at kernel/qeventloop.cpp:149
#7  0x00007fcc041a6005 in QEventLoop::exec (this=this@entry=0x7fcbda21cca0, flags=...) at kernel/qeventloop.cpp:204
#8  0x00007fcc040a4fef in QThread::exec (this=this@entry=0x6fdee80) at thread/qthread.cpp:536
#9  0x00007fcc04187513 in QInotifyFileSystemWatcherEngine::run (this=0x6fdee80) at io/qfilesystemwatcher_inotify.cpp:256
#10 0x00007fcc040a768f in QThreadPrivate::start (arg=0x6fdee80) at thread/qthread_unix.cpp:338
#11 0x00007fcc03e100db in start_thread () from /lib64/libpthread.so.0
#12 0x00007fcc0331f58d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7fcc089ea900 (LWP 13996)):
[KCrash Handler]
#6  setCheckState (state=Qt::Checked, column=0, this=0x21) at /usr/include/QtGui/qtreewidget.h:165
#7  AnnotationDialog::ListSelect::ensureTagIsSelected (this=<optimized out>, category=..., tag=...) at /home/pd/pd-sw/foto/kphotoalbum/kphotoalbum_git/AnnotationDialog/ListSelect.cpp:777
#8  0x00000000005a1fc9 in AnnotationDialog::ListSelect::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /home/pd/pd-sw/foto/kphotoalbum/kphotoalbum_git/ListSelect.moc:89
#9  0x00007fcc041bad68 in QMetaObject::activate (sender=sender@entry=0x725c7c0, m=m@entry=0x621da0 <AnnotationDialog::ImagePreview::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fff8f65e450) at kernel/qobject.cpp:3556
#10 0x00000000005a32c8 in AnnotationDialog::ImagePreview::proposedTagSelected (this=this@entry=0x725c7c0, _t1=..., _t2=...) at /home/pd/pd-sw/foto/kphotoalbum/kphotoalbum_git/ImagePreview.moc:118
#11 0x00000000005a3783 in AnnotationDialog::ImagePreview::acceptProposedTag (this=0x725c7c0, tagData=..., area=area@entry=0x6cff860) at /home/pd/pd-sw/foto/kphotoalbum/kphotoalbum_git/AnnotationDialog/ImagePreview.cpp:500
#12 0x00000000005ae7cd in AnnotationDialog::ResizableFrame::acceptTag (this=0x6cff860) at /home/pd/pd-sw/foto/kphotoalbum/kphotoalbum_git/AnnotationDialog/ResizableFrame.cpp:593
#13 0x00000000005e846d in AnnotationDialog::ProposedFaceDialog::acceptTag (this=0x75d8670) at /home/pd/pd-sw/foto/kphotoalbum/kphotoalbum_git/AnnotationDialog/ProposedFaceDialog.cpp:107
#14 0x00007fcc041bad68 in QMetaObject::activate (sender=sender@entry=0x6680540, m=m@entry=0x7fcc05b58e20 <QAbstractButton::staticMetaObject>, local_signal_index=local_signal_index@entry=2, argv=argv@entry=0x7fff8f65e6b0) at kernel/qobject.cpp:3556
#15 0x00007fcc056d64f2 in QAbstractButton::clicked (this=this@entry=0x6680540, _t1=false) at .moc/release-shared/moc_qabstractbutton.cpp:219
#16 0x00007fcc0543a4e3 in QAbstractButtonPrivate::emitClicked (this=this@entry=0x6d84e40) at widgets/qabstractbutton.cpp:548
#17 0x00007fcc0543b653 in QAbstractButtonPrivate::click (this=this@entry=0x6d84e40) at widgets/qabstractbutton.cpp:541
#18 0x00007fcc0543b73c in QAbstractButton::mouseReleaseEvent (this=0x6680540, e=0x7fff8f65ebb0) at widgets/qabstractbutton.cpp:1123
#19 0x00007fcc054f26ba in QToolButton::mouseReleaseEvent (this=<optimized out>, e=<optimized out>) at widgets/qtoolbutton.cpp:718
#20 0x00007fcc050dcdfe in QWidget::event (this=0x6680540, event=0x7fff8f65ebb0) at kernel/qwidget.cpp:8376
#21 0x00007fcc0508d8ac in QApplicationPrivate::notify_helper (this=this@entry=0x1e81fc0, receiver=receiver@entry=0x6680540, e=e@entry=0x7fff8f65ebb0) at kernel/qapplication.cpp:4562
#22 0x00007fcc05093fad in QApplication::notify (this=this@entry=0x7fff8f660b10, receiver=receiver@entry=0x6680540, e=e@entry=0x7fff8f65ebb0) at kernel/qapplication.cpp:4105
#23 0x00007fcc05da418a in KApplication::notify (this=0x7fff8f660b10, receiver=0x6680540, event=0x7fff8f65ebb0) at /usr/src/debug/kdelibs-4.11.5/kdeui/kernel/kapplication.cpp:311
#24 0x00007fcc041a70ad in QCoreApplication::notifyInternal (this=0x7fff8f660b10, receiver=receiver@entry=0x6680540, event=event@entry=0x7fff8f65ebb0) at kernel/qcoreapplication.cpp:949
#25 0x00007fcc05093763 in sendEvent (event=<optimized out>, receiver=<optimized out>) at ../../src/corelib/kernel/qcoreapplication.h:231
#26 QApplicationPrivate::sendMouseEvent (receiver=receiver@entry=0x6680540, event=event@entry=0x7fff8f65ebb0, alienWidget=alienWidget@entry=0x6680540, nativeWidget=nativeWidget@entry=0x75d8670, buttonDown=buttonDown@entry=0x7fcc05b6b278 <qt_button_down>, lastMouseReceiver=..., spontaneous=spontaneous@entry=true) at kernel/qapplication.cpp:3173
#27 0x00007fcc05104f7b in QETWidget::translateMouseEvent (this=this@entry=0x75d8670, event=event@entry=0x7fff8f65ef20) at kernel/qapplication_x11.cpp:4528
#28 0x00007fcc051039ec in QApplication::x11ProcessEvent (this=0x7fff8f660b10, event=event@entry=0x7fff8f65ef20) at kernel/qapplication_x11.cpp:3651
#29 0x00007fcc0512a882 in x11EventSourceDispatch (s=0x1e7ec10, callback=0x0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#30 0x00007fcbfb6c5316 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#31 0x00007fcbfb6c5668 in ?? () from /usr/lib64/libglib-2.0.so.0
#32 0x00007fcbfb6c570c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#33 0x00007fcc041d3d55 in QEventDispatcherGlib::processEvents (this=0x1e07c00, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#34 0x00007fcc0512a936 in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#35 0x00007fcc041a5d0f in QEventLoop::processEvents (this=this@entry=0x7fff8f65f310, flags=...) at kernel/qeventloop.cpp:149
#36 0x00007fcc041a6005 in QEventLoop::exec (this=this@entry=0x7fff8f65f310, flags=...) at kernel/qeventloop.cpp:204
#37 0x00007fcc0552fcec in QDialog::exec (this=this@entry=0x68068c0) at dialogs/qdialog.cpp:562
#38 0x000000000058f3d3 in AnnotationDialog::Dialog::exec (this=this@entry=0x68068c0) at /home/pd/pd-sw/foto/kphotoalbum/kphotoalbum_git/AnnotationDialog/Dialog.cpp:908
#39 0x0000000000595367 in AnnotationDialog::Dialog::configure (this=0x68068c0, list=..., oneAtATime=oneAtATime@entry=true) at /home/pd/pd-sw/foto/kphotoalbum/kphotoalbum_git/AnnotationDialog/Dialog.cpp:716
#40 0x000000000053385a in MainWindow::Window::configImages (this=0x1ff0620, list=..., oneAtATime=oneAtATime@entry=true) at /home/pd/pd-sw/foto/kphotoalbum/kphotoalbum_git/MainWindow/Window.cpp:440
#41 0x00000000005339d7 in configureImages (oneAtATime=true, list=...) at /home/pd/pd-sw/foto/kphotoalbum/kphotoalbum_git/MainWindow/Window.cpp:433
#42 MainWindow::Window::configureImages (this=0x1ff0620, oneAtATime=<optimized out>) at /home/pd/pd-sw/foto/kphotoalbum/kphotoalbum_git/MainWindow/Window.cpp:427
#43 0x00007fcc041bad68 in QMetaObject::activate (sender=sender@entry=0x575d040, m=m@entry=0x7fcc05b2f2a0 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fff8f65f5f0) at kernel/qobject.cpp:3556
#44 0x00007fcc05087752 in QAction::triggered (this=this@entry=0x575d040, _t1=false) at .moc/release-shared/moc_qaction.cpp:276
#45 0x00007fcc05089123 in QAction::activate (this=0x575d040, event=event@entry=QAction::Trigger) at kernel/qaction.cpp:1257
#46 0x00007fcc0508927c in QAction::event (this=<optimized out>, e=e@entry=0x7fff8f65f990) at kernel/qaction.cpp:1183
#47 0x00007fcc05cce2bf in KAction::event (this=<optimized out>, event=0x7fff8f65f990) at /usr/src/debug/kdelibs-4.11.5/kdeui/actions/kaction.cpp:131
#48 0x00007fcc0508d8ac in QApplicationPrivate::notify_helper (this=this@entry=0x1e81fc0, receiver=receiver@entry=0x575d040, e=e@entry=0x7fff8f65f990) at kernel/qapplication.cpp:4562
#49 0x00007fcc05093e70 in QApplication::notify (this=this@entry=0x7fff8f660b10, receiver=receiver@entry=0x575d040, e=e@entry=0x7fff8f65f990) at kernel/qapplication.cpp:4348
#50 0x00007fcc05da418a in KApplication::notify (this=0x7fff8f660b10, receiver=0x575d040, event=0x7fff8f65f990) at /usr/src/debug/kdelibs-4.11.5/kdeui/kernel/kapplication.cpp:311
#51 0x00007fcc041a70ad in QCoreApplication::notifyInternal (this=0x7fff8f660b10, receiver=0x575d040, event=event@entry=0x7fff8f65f990) at kernel/qcoreapplication.cpp:949
#52 0x00007fcc050beb86 in sendEvent (event=0x7fff8f65f990, receiver=<optimized out>) at ../../src/corelib/kernel/qcoreapplication.h:231
#53 QShortcutMap::dispatchEvent (this=this@entry=0x1e820e0, e=e@entry=0x7fff8f65fcd0) at kernel/qshortcutmap.cpp:884
#54 0x00007fcc050becb4 in QShortcutMap::tryShortcutEvent (this=0x1e820e0, o=o@entry=0x5751f30, e=e@entry=0x7fff8f65fcd0) at kernel/qshortcutmap.cpp:364
#55 0x00007fcc05095143 in QApplication::notify (this=this@entry=0x7fff8f660b10, receiver=receiver@entry=0x5751f30, e=e@entry=0x7fff8f65fcd0) at kernel/qapplication.cpp:3986
#56 0x00007fcc05da418a in KApplication::notify (this=0x7fff8f660b10, receiver=0x5751f30, event=0x7fff8f65fcd0) at /usr/src/debug/kdelibs-4.11.5/kdeui/kernel/kapplication.cpp:311
#57 0x00007fcc041a70ad in QCoreApplication::notifyInternal (this=0x7fff8f660b10, receiver=receiver@entry=0x5751f30, event=event@entry=0x7fff8f65fcd0) at kernel/qcoreapplication.cpp:949
#58 0x00007fcc0508c246 in sendSpontaneousEvent (event=event@entry=0x7fff8f65fcd0, receiver=receiver@entry=0x5751f30) at ../../src/corelib/kernel/qcoreapplication.h:234
#59 qt_sendSpontaneousEvent (receiver=receiver@entry=0x5751f30, event=event@entry=0x7fff8f65fcd0) at kernel/qapplication.cpp:5560
#60 0x00007fcc05127d79 in QKeyMapper::sendKeyEvent (keyWidget=keyWidget@entry=0x5751f30, grab=grab@entry=false, type=QEvent::KeyPress, code=49, modifiers=..., text=..., autorepeat=autorepeat@entry=false, count=1, nativeScanCode=10, nativeVirtualKey=49, nativeModifiers=20) at kernel/qkeymapper_x11.cpp:1866
#61 0x00007fcc05128119 in QKeyMapperPrivate::translateKeyEvent (this=0x1edf050, keyWidget=keyWidget@entry=0x5751f30, event=event@entry=0x7fff8f660250, grab=grab@entry=false) at kernel/qkeymapper_x11.cpp:1836
#62 0x00007fcc05103d3f in QApplication::x11ProcessEvent (this=0x7fff8f660b10, event=event@entry=0x7fff8f660250) at kernel/qapplication_x11.cpp:3544
#63 0x00007fcc0512a882 in x11EventSourceDispatch (s=0x1e7ec10, callback=0x0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:146
#64 0x00007fcbfb6c5316 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#65 0x00007fcbfb6c5668 in ?? () from /usr/lib64/libglib-2.0.so.0
#66 0x00007fcbfb6c570c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#67 0x00007fcc041d3d55 in QEventDispatcherGlib::processEvents (this=0x1e07c00, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#68 0x00007fcc0512a936 in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#69 0x00007fcc041a5d0f in QEventLoop::processEvents (this=this@entry=0x7fff8f660630, flags=...) at kernel/qeventloop.cpp:149
#70 0x00007fcc041a6005 in QEventLoop::exec (this=this@entry=0x7fff8f660630, flags=...) at kernel/qeventloop.cpp:204
#71 0x00007fcc041ab13b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1221
#72 0x00007fcc0508c06c in QApplication::exec () at kernel/qapplication.cpp:3823
#73 0x0000000000444b23 in main (argc=1, argv=0x7fff8f660c48) at /home/pd/pd-sw/foto/kphotoalbum/kphotoalbum_git/main.cpp:89
Comment 2 Johannes Zarl-Zierl 2015-01-05 15:49:58 UTC
Created attachment 90230 [details]
Possible workaround for crash

Hi Martin,

I can't reproduce the crash here with the information that you supplied. Was there anything else that might have triggered the bug (e.g. renaming of tags or categories, other special circumstances)?

I've prepared a patch that should fix the crash itself, but not the root cause. Does the crash still happen after applying the patch?

Thanks,
  Johannes
Comment 3 Tobias Leupold 2015-01-05 23:08:45 UTC
I can't reproduce it, either … can you produce it with a completely new setup (saying a new database and a new recognition.db)? If so, could you please provide the very steps to produce it?

We changed a lot while developing the positionable tags and face detection/recognition implementation, and we did have some serious problems on our way. Probably, this is due to something that has been fixed in the meantime (esp. the db version 5 to 6 transition).
Comment 4 Martin Jost 2015-01-06 14:22:53 UTC
Further analysis:
1. I copied some photos which had originally caused the crash to a directory of its own.
   I configured KPA to start with a empty DB from there.
  => No crash
1.a. I copied my own complete DB to this dir and started KPA again.
   => Still no crash
2. I applied the patch.  I configured KPA back to using my original directory for index.xml and the whole  list of photos. (24,000 and counting...)
    It made the crash disappear. But I got several times
   "Could not find tag after adding it! Please report a bug at http://bugs.kde.org!" on the console.
  (As was to be expected)

Notes on environment:
This is a Suse 13.1 (64 bit) patched up to date.
The index.xml already contains "<KPhotoAlbum version="6" compressed="0">"
After installing the version from GIT, KPA had asked to change some category names.
I allowed it and afterwards saved the file as asked for.

Now I'm a little bit at the end of my wits...
- Could you please explain, which condition is catched by the patch ?
- Would it help to send you my index.xml privately ?
  (Surely I don't like a full copy on the Web and I can't reproduce the crash, starting from scratch)
- This also seems to indicate, that the problem is not (only) caused by my environment, but by some specific stuff in my data.
Especially: Can you imagine something which causes a crash in the normal tree but not with the original index.xml in the stripped down tree ? (I can only think of the EXIF DB which was missing from my copy - but I don't think this is the trick...)
Comment 5 Tobias Leupold 2015-01-06 14:59:35 UTC
The patch does nothing but preventing KPA from accessing an empty list (which causes the crash). But this should not happen in the first place. This is really odd, especially that the crash does not happen with the same data in another place.

I suppose you still have a pre-6 backup of your db? Saying a db that has not been processed by earlier git versions of KPA? Could you test it with that db and current git? Probably, it's some problem with the category name updates we introduced. In your case especially the renaming of the old "Persons" category to "People" (or perhaps, you have a localized version stored in your db, like "Personen").

I can't imagine how it could happen though. Without knowing your data, I would dump the recoginition.db and see what's there. If you do a

    select value from identityAttributes where attribute="fullName"

You will see the relevant content. Should be something like "People-/-Tobias". This is the data used by KPA. You should both see a respective category ("People") and a tag ("Tobias") in your xml db.

But even with differences here, the crash should not happen, as we did consider such a situation (copying a recognition.db from somebody else etc.).

I'm currently out of ideas … the ideal case would be if you could provide some minimal index.xml and recognition.db along with one photo which can produce the crash. As long as we can't see it, it's impossible to fix :-(
Comment 6 Johannes Zarl-Zierl 2015-01-06 15:55:51 UTC
Hi Martin,

Thanks for the feedback.

It seems that the crash is indeed caused by some value in the recognition.db, and the behaviour after you applied the patch means that I read the stack trace correctly. I think we can work from this.

> - Could you please explain, which condition is catched by the patch ?

When the tag for identified person is not found in the tags, KPA just adds the tag to the database and searches the tag again in the database. Normally that last search is a guaranteed hit. In your case, the tag is still not found after adding it.

> - Would it help to send you my index.xml privately ? (Surely I don't like a full copy on the Web and I can't reproduce the crash, starting from scratch)

That would be very kind of you. I don't even need the whole database, just the following two things:

DBDIR=/path/to/your/database
sqlite3 "$DBDIR/recognition.db" 'select * from identityAttributes'
sed -n '/Category name="People"/,/Category/ p' "$DBDIR/index.xml"

(assuming "People" is the category that you are using for face recognition).

If you are not using the English locale, please also write the translated name of the category.
If you send these parts of your database, please also indicate whether I can share it with Tobias or other devs.

> - This also seems to indicate, that the problem is not (only) caused by my environment, but by some specific stuff in my data. Especially: Can you imagine something which causes a crash in the normal tree but not with the original index.xml in the stripped down tree ? (I can only think of the EXIF DB which was missing from my copy - but I don't think this is the trick...)

I'm pretty sure the root cause lies somewhere in the recognition.db file.

This also leads to a possible workaround: you can delete the recognition db file. Afterwards you have to re-train it, but the problem should not occur anymore.
Comment 7 Teemu Hämäläinen 2015-02-07 16:23:47 UTC
Hi, 
I can confirm this bug. Installed 4.6 today with Face recognition.I could reproduce this bug & crash every time I tried to confirm a recognition.

But the good news is that I believe I found the cause for this bug. 

I have grouped my People tags into hierarchies, so in the annotation dialog I have structure:
<family name>
   <firstname>
   <firstname2>
<family2>
  <firstname>....
I used those firstnames when reproducing the crash. 

But, when I added a new person and it was on top level of hierarchy, the Confirmation of recognition worked just fine! Only when the name is on lower levels of hierarchy, is the crash reproducible.

I could even crash KPA when I was annotating a previously annotated image (with a recognized face) by dragging that name under an existing hierachy -> crash when mouse-up from the drag.
Comment 8 Teemu Hämäläinen 2015-02-07 17:40:55 UTC
It seems that I could fix the bug in my local copy by making this change:
In AnnotationDialog/ListSelect.cpp, in function
void AnnotationDialog::ListSelect::ensureTagIsSelected(QString category, QString tag)

I changed this
    QList<QTreeWidgetItem *> matchingTags = m_treeWidget->findItems(tag, Qt::MatchExactly , 0);
to this:
    QList<QTreeWidgetItem *> matchingTags = m_treeWidget->findItems(tag, Qt::MatchExactly | Qt::MatchRecursive , 0);

Of course I'm not sure, if that is the proper fix, but seemed to find the Tag now on the lower level of the hierarchy and the problem disappeared for me.

Later in the function is code to Add a tag if it is not found - the reason for the crash is probably somewhere there and still needs separate investigation - but as the comment there says, it should be a exceptional case (recognition databased copied from elsewhere, etc).
Comment 9 Johannes Zarl-Zierl 2015-02-07 19:21:58 UTC
Thanks Teemu! Using your tag structure I can reproduce the crash...
Comment 10 Johannes Zarl-Zierl 2015-02-07 19:42:13 UTC
Git commit 975ce55b85fbd9c747c231dbadcdbd923424d871 by Johannes Zarl.
Committed on 07/02/2015 at 19:39.
Pushed by johanneszarl into branch 'master'.

Deal with tag hierarchies correctly in tagIsChecked and ensureTagIsSelected.

Kudos to Teemu Hämäläinen for identifying the root cause!

M  +3    -3    AnnotationDialog/ListSelect.cpp

http://commits.kde.org/kphotoalbum/975ce55b85fbd9c747c231dbadcdbd923424d871
Comment 11 Tobias Leupold 2015-02-08 10:33:01 UTC
Thanks a lot for tracking this down :-)
Comment 12 Martin Jost 2015-02-12 20:06:23 UTC
This also fixed the bug on my side.
I also have this sort of hierarchy.