D15812: Don't crash if person gets removed

Igor Poboiko noreply at phabricator.kde.org
Fri Sep 28 13:39:14 BST 2018


poboiko created this revision.
poboiko added reviewers: Frameworks, dvratil, apol.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
poboiko requested review of this revision.

REVISION SUMMARY
  Currently, right after removing a person (which i.e. removes it from personIndex), we call personChanged.
  Which itself tries to access personIndex with recently removed key, which creates a default (invalid) value with such key.
  In the end we obtain inconsistent (invalid) index, which leads to crash.

TEST PLAN
  I've noted the bug when was working on T9595: [KAddressbook] Use KPeople model for contact list <https://phabricator.kde.org/T9595>, see scratch repo <https://cgit.kde.org/scratch/poboiko/akonadi-kpeople-plugin.git/> and "testab" application there.
  It's sufficient to check/uncheck address books several times to crash it.
  After applying this patch, it no longer crashes.

REPOSITORY
  R307 KPeople

BRANCH
  person-remove (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D15812

AFFECTED FILES
  src/personsmodel.cpp

To: poboiko, #frameworks, dvratil, apol
Cc: kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180928/3d382abb/attachment.html>


More information about the Kde-frameworks-devel mailing list