Bug 403035 - Crash when saving the addressbook after deleting a record while searching
Summary: Crash when saving the addressbook after deleting a record while searching
Status: RESOLVED UNMAINTAINED
Alias: None
Product: trojita
Classification: Applications
Component: Core (other bugs)
Version First Reported In: 0.7
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Trojita default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-09 13:09 UTC by Jonáš Vidra
Modified: 2024-09-23 18:51 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Backtrace generated by the KCrash handler after the segfault (18.72 KB, text/plain)
2019-01-09 13:09 UTC, Jonáš Vidra
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonáš Vidra 2019-01-09 13:09:03 UTC
Created attachment 117356 [details]
Backtrace generated by the KCrash handler after the segfault

SUMMARY

When I open the address book, search for a record and try to delete it, Trojitá crashes.

STEPS TO REPRODUCE
1. Open the address book.
2. Type something into the search box.
3. Delete a record from the result set.
4. Close the window.
5. Confirm saving the changes.

OBSERVED RESULT

Trojitá segfaults. After launching it again, the record was not deleted.


EXPECTED RESULT

The record is deleted and the software continues running.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma:
KDE Plasma Version: 5.14.3
KDE Frameworks Version: 5.52.0
Qt Version: 5.11.1

ADDITIONAL INFORMATION

It may be related to https://bugs.kde.org/show_bug.cgi?id=384761
Backtrace after the crash is in the attachment.
Comment 1 Jan Kundrát 2019-01-09 13:25:14 UTC
Indeed, I can reproduce it here:

Thread 1 "trojita" received signal SIGSEGV, Segmentation fault.
0x000055555568aec7 in AbookAddressbook::saveContacts() () at /home/jkt/work/prog/trojita/src/Plugins/AbookAddressbook/AbookAddressbook.cpp:312
312                 if (it->first == Mail)
(gdb) bt
#0  0x000055555568aec7 in AbookAddressbook::saveContacts() () at /home/jkt/work/prog/trojita/src/Plugins/AbookAddressbook/AbookAddressbook.cpp:312
#1  0x00005555556933bb in BE::Contacts::saveContacts (this=0x555555fca580) at /home/jkt/work/prog/trojita/src/Plugins/AbookAddressbook/be-contacts.cpp:173
#2  BE::Contacts::closeEvent(QCloseEvent*) () at /home/jkt/work/prog/trojita/src/Plugins/AbookAddressbook/be-contacts.cpp:163
#3  0x00007ffff3334c48 in QWidget::event (this=0x555555fca580, event=0x7fffffffcd50) at /var/tmp/portage/dev-qt/qtwidgets-5.11.9999/work/qtwidgets-5.11.9999/src/widgets/kernel/qwidget.cpp:8916

Also, the list of matching items gets empty right after that deletion attempt even though there are some more matching items. That appears quite relevant. A first thing to be checked is proper QModelIndex invalidation, but I haven't checked the code. Patches welcome, of course.
Comment 2 Christoph Cullmann 2024-09-23 18:51:08 UTC
Trojitá is no longer maintained, please switch to a maintained alternative like https://apps.kde.org/kmail2/

Sorry for the inconveniences.