Summary: | Crash when trying to edit a contact | ||
---|---|---|---|
Product: | [Applications] kaddressbook | Reporter: | Simon Brown <bugs> |
Component: | general | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | jjm |
Priority: | NOR | Keywords: | drkonqi |
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Neon | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/pim/akonadi-contacts/-/commit/f11e81cebba7956f0b0aca27420ab66d7da2b602 | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: |
New crash information added by DrKonqi
Patch to fix the crash |
Description
Simon Brown
2024-10-07 14:14:36 UTC
Created attachment 174505 [details]
New crash information added by DrKonqi
DrKonqi auto-attaching complete backtrace.
Created attachment 174589 [details]
Patch to fix the crash
Can confirm this happening. It seems to be when the contact entry being edited has a phone number type which is not one of the standard ones ("Home", "Work" etc). In this case Akonadi::PhoneComboBoxType::setType() in src/akonadi-contacts-widgets/editor/generalinfoeditor/phone/phonecomboboxtype.cpp tries to insert the previously unknown type into mTypeList as the penultimate entry. The code looks correct to me (although it's a bit clumsy), but it crashes with the assert as per the backtrace.
The attached patch appears to fix the problem, although there may be a better way.
A possibly relevant merge request was started @ https://invent.kde.org/pim/akonadi-contacts/-/merge_requests/48 Git commit f11e81cebba7956f0b0aca27420ab66d7da2b602 by Jonathan Marten. Committed on 10/10/2024 at 08:29. Pushed by marten into branch 'master'. Fix KAddressBook crash when editing a contact with nonstandard phone type In this case PhoneComboBoxType::setType() attempts to insert the new type as the penultimate item in the mTypeList. However, using an iterator for insertion appears to cause an assertion within QList. There is no need to obtain an interator to do the insertion, the index can be used directly. Test case: Importing this contact into KAddressBook and attempting to edit it will trigger the crash. VERSION:3.0 EMAIL;TYPE=PREF,WORK:foo@bar.com EMAIL;TYPE=WORK:info@bar.com FN:Foo Bar N:Bar;Foo;;Mx.; TEL;TYPE=CELL,WORK:0000 000 0000 TEL;TYPE=HOME:01000 000000 END:VCARD M +1 -1 src/akonadi-contacts-widgets/editor/generalinfoeditor/phone/phonecomboboxtype.cpp https://invent.kde.org/pim/akonadi-contacts/-/commit/f11e81cebba7956f0b0aca27420ab66d7da2b602 |