13.0-RELEASE-p5 kde5 installed from "latest" pkg repo Since the kde5 5.23.4.21.08.3 -> 5.23.4.21.12.0 update in mid December last month, korganizer seg faults every time I attempt to edit an existing calendar entry. This happens when run from within kontact as well. The KDE crash handler reports: Executable: kontact PID: 61430 Signal: Segmentation fault (11) Time: 9 Jan 2022 17:31:42 CST This happens 100% of the time. Intermittently, kontact crashes on exit too. Today's kde5 5.23.5.21.12.0 -> 5.23.5.21.12.1 update did not help.
The kf5 update 5.89.0 -> 5.90.0 did not help either. Does no one else run kontact/korganaizer? Or am I the only one seeing this crash?
Moin moin Indeed, there seems to be a segfault in kldap when creating new entries here too. mfg Tobias
* thread #1, name = 'korganizer', stop reason = signal SIGSEGV: invalid address (fault address: 0x20) frame #0: 0x0000000803ad4ad0 libKF5Ldap.so.5`QWeakPointer<QObject>::internalData(this=0x0000000000000020) const at qsharedpointer_impl.h:698:18 695 // a weak pointer's data but the weak pointer itself 696 inline T *internalData() const noexcept 697 { -> 698 return d == nullptr || d->strongref.loadRelaxed() == 0 ? nullptr : value; 699 } 700 701 Data *d;
- start korganizer (I'm not sure I've ever done that before) - click "New Event" ``` [KCrash Handler] #7 0x0000000802fac745 in () at /usr/local/lib/libKF5Ldap.so.5 #8 0x0000000802faaff1 in KLDAP::LdapClient::~LdapClient() () at /usr/local/lib/libKF5Ldap.so.5 #9 0x0000000803a3127b in () at /usr/local/lib/libKF5IncidenceEditor.so.5 #10 0x0000000803a2ae93 in IncidenceEditorNG::ResourceManagement::ResourceManagement(QWidget*) () at /usr/local/lib/libKF5IncidenceEditor.so.5 #11 0x0000000803a13c27 in () at /usr/local/lib/libKF5IncidenceEditor.so.5 #12 0x0000000803a38529 in () at /usr/local/lib/libKF5IncidenceEditor.so.5 #13 0x0000000803a3d899 in IncidenceEditorNG::IncidenceDialog::IncidenceDialog(Akonadi::IncidenceChanger*, QWidget*, QFlags<Qt::WindowType>) () at /usr/local/lib/libKF5IncidenceEditor.so.5 #14 0x0000000803a3791d in IncidenceEditorNG::IncidenceDialogFactory::create(bool, KCalendarCore::IncidenceBase::IncidenceType, Akonadi::IncidenceChanger*, QWidget*, QFlags<Qt::WindowType>) () at /usr/local/lib/libKF5IncidenceEditor.so.5 ``` Since I don't have a clue what kind of backend -- if any -- is even configured for KO, I do wonder why there would be an LDAP connection to deal with. Running this in valgrind gets me a similar BT with no suggestion of memory corruption before the crash.
(In reply to Adriaan de Groot from comment #4) I think the default backend for calendars is either the "iCal Calendar File" or the "iCal Calendar Folder" resource. I'm using the "DAV groupware" CalDav resource, as my calendars are stored on a Nextcloud instance. Apparently the crash occurs with any backend. I too am surprised to see LDAP dependencies for calendars. Additionally, I can confirm that besides editing existing calendar entries, attempting to create a new one by clicking "New Event" also crashes korganizer. I ordinarily create new events using kmail's "Accept" function when I receive calendar invitations in email; new events created that way do not crash korganizer.
I have a fix, but no energy this evening to upstream it and add it to ports. It goes in kldap, not korganizer itself, if you want to try it yourself. --- src/widgets/ldapclient.cpp +++ src/widgets/ldapclient.cpp @@ -31,9 +31,11 @@ public: ~LdapClientPrivate() { - q->cancelQuery(); + cancelQuery(); } + void cancelQuery(); + void startParseLDIF(); void parseLDIF(const QByteArray &data); void endParseLDIF(); @@ -133,12 +135,17 @@ void LdapClient::startQuery(const QString &filter) void LdapClient::cancelQuery() { - if (d->mJob) { - d->mJob->kill(); - d->mJob = nullptr; + d->cancelQuery(); +} + +void LdapClient::LdapClientPrivate::cancelQuery() +{ + if (mJob) { + mJob->kill(); + mJob = nullptr; } - d->mActive = false; + mActive = false; } void LdapClient::LdapClientPrivate::slotData(KIO::Job *, const QByteArray &data)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=acbc052765d87af0a436f10b4c5a35880eaa14d2 commit acbc052765d87af0a436f10b4c5a35880eaa14d2 Author: Adriaan de Groot <adridg@FreeBSD.org> AuthorDate: 2022-01-24 11:02:08 +0000 Commit: Adriaan de Groot <adridg@FreeBSD.org> CommitDate: 2022-01-24 13:12:01 +0000 net/kldap: fix crash because of UB Patch submitted upstream. PR: 261069 net/kldap/Makefile | 1 + net/kldap/files/patch-UB.diff (new) | 68 +++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+)
A commit in branch 2022Q1 references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=017b38ede362a0ce60b109b4756f6924572df820 commit 017b38ede362a0ce60b109b4756f6924572df820 Author: Adriaan de Groot <adridg@FreeBSD.org> AuthorDate: 2022-01-24 11:02:08 +0000 Commit: Adriaan de Groot <adridg@FreeBSD.org> CommitDate: 2022-01-24 13:14:27 +0000 net/kldap: fix crash because of UB Patch submitted upstream. PR: 261069 (cherry picked from commit acbc052765d87af0a436f10b4c5a35880eaa14d2) net/kldap/Makefile | 1 + net/kldap/files/patch-UB.diff (new) | 68 +++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+)
Landed in main and quarterly. I tested it in main, at least: korganizer does not crash when I click the "New Event" button.
After 'pkg[67186]: kldap upgraded: 21.12.1 -> 21.12.1_1' today, I'm happy to report that all is well again. Thanks so much for finding and fixing the problem so quickly.