Bug 466063 - Kalendar crashes when unlocking
Summary: Kalendar crashes when unlocking
Status: REOPENED
Alias: None
Product: Merkuro
Classification: Applications
Component: general (show other bugs)
Version: 23.04.1
Platform: Fedora RPMs Linux
: VHI crash
Target Milestone: ---
Assignee: Claudio Cambra
URL:
Keywords: multiscreen, wayland
: 463145 463262 463300 463513 463616 464083 464347 464358 464877 465375 465667 466692 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-02-19 09:45 UTC by joerg
Modified: 2023-05-16 12:06 UTC (History)
14 users (show)

See Also:
Latest Commit:
Version Fixed In: 23.04.1


Attachments
Crash with Kalendar 23.04.0 (87.03 KB, text/vnd.kde.kcrash-report)
2023-05-02 10:13 UTC, Riccardo Robecchi
Details
Crash with Kalendar 23.04.1 (47.91 KB, text/vnd.kde.kcrash-report)
2023-05-16 12:06 UTC, Riccardo Robecchi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description joerg 2023-02-19 09:45:49 UTC
Application: kalendar (22.12.2)

Qt Version: 5.15.8
Frameworks Version: 5.103.0
Operating System: Linux 6.1.12-alderlake-xanmod1-1 x86_64
Windowing System: Wayland
Distribution: Arch Linux
DrKonqi: 5.27.0 [KCrashBackend]

-- Information about the crash:
Since Kalendar version 22.12.x I encounter unexpected crashes when unlocking the screen. The crash appears after the program was running for a while; it dosen't crash every time when the screen is unlocked. The crashes dosen't occur with version 22.08.x

The crash can be reproduced sometimes.

-- Backtrace:
Application: Kalendar (kalendar), signal: Segmentation fault

[KCrash Handler]
#4  0x00007f64ec3a1300 in QDateTime::operator=(QDateTime const&) () at /usr/lib/libQt5Core.so.5
#5  0x000055fd9e46548d in  ()
#6  0x00007f64ec4bea71 in  () at /usr/lib/libQt5Core.so.5
#7  0x00007f64ec446cd1 in QAbstractItemModel::dataChanged(QModelIndex const&, QModelIndex const&, QVector<int> const&) () at /usr/lib/libQt5Core.so.5
#8  0x00007f64ec46d3a6 in  () at /usr/lib/libQt5Core.so.5
#9  0x00007f64ec4bec20 in  () at /usr/lib/libQt5Core.so.5
#10 0x00007f64ec446cd1 in QAbstractItemModel::dataChanged(QModelIndex const&, QModelIndex const&, QVector<int> const&) () at /usr/lib/libQt5Core.so.5
#11 0x00007f64ec46d3a6 in  () at /usr/lib/libQt5Core.so.5
#12 0x00007f64ec4bec20 in  () at /usr/lib/libQt5Core.so.5
#13 0x00007f64ec446cd1 in QAbstractItemModel::dataChanged(QModelIndex const&, QModelIndex const&, QVector<int> const&) () at /usr/lib/libQt5Core.so.5
#14 0x00007f64ec46d3a6 in  () at /usr/lib/libQt5Core.so.5
#15 0x00007f64ec4bec20 in  () at /usr/lib/libQt5Core.so.5
#16 0x00007f64ec446cd1 in QAbstractItemModel::dataChanged(QModelIndex const&, QModelIndex const&, QVector<int> const&) () at /usr/lib/libQt5Core.so.5
#17 0x00007f64ee6d369b in  () at /usr/lib/libKF5ItemModels.so.5
#18 0x00007f64ec4bea71 in  () at /usr/lib/libQt5Core.so.5
#19 0x00007f64ec446cd1 in QAbstractItemModel::dataChanged(QModelIndex const&, QModelIndex const&, QVector<int> const&) () at /usr/lib/libQt5Core.so.5
#20 0x00007f64eea1562c in  () at /usr/lib/libKF5AkonadiCore.so.5
#21 0x00007f64ee9f69eb in  () at /usr/lib/libKF5AkonadiCore.so.5
#22 0x00007f64ec4bec20 in  () at /usr/lib/libQt5Core.so.5
#23 0x00007f64ee976d6c in Akonadi::Monitor::itemChanged(Akonadi::Item const&, QSet<QByteArray> const&) () at /usr/lib/libKF5AkonadiCore.so.5
#24 0x00007f64ee98b4a1 in Akonadi::MonitorPrivate::emitItemsNotification(Akonadi::Protocol::ItemChangeNotification const&, QVector<Akonadi::Item> const&, Akonadi::Collection const&, Akonadi::Collection const&) () at /usr/lib/libKF5AkonadiCore.so.5
#25 0x00007f64ee985b74 in Akonadi::MonitorPrivate::emitNotification(QSharedPointer<Akonadi::Protocol::ChangeNotification> const&) () at /usr/lib/libKF5AkonadiCore.so.5
#26 0x00007f64ee984ca5 in Akonadi::MonitorPrivate::flushPipeline() () at /usr/lib/libKF5AkonadiCore.so.5
#27 0x00007f64ee98565e in Akonadi::MonitorPrivate::dataAvailable() () at /usr/lib/libKF5AkonadiCore.so.5
#28 0x00007f64ec4bea71 in  () at /usr/lib/libQt5Core.so.5
#29 0x00007f64ec4bec20 in  () at /usr/lib/libQt5Core.so.5
#30 0x00007f64edd5943a in KJob::result(KJob*, KJob::QPrivateSignal) () at /usr/lib/libKF5CoreAddons.so.5
#31 0x00007f64edd5f54c in KJob::finishJob(bool) () at /usr/lib/libKF5CoreAddons.so.5
#32 0x00007f64ec4b1bb0 in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#33 0x00007f64ed178b5c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#34 0x00007f64ec48df48 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#35 0x00007f64ec48ea53 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/libQt5Core.so.5
#36 0x00007f64ec4d4e88 in  () at /usr/lib/libQt5Core.so.5
#37 0x00007f64ea31682b in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#38 0x00007f64ea36dcc9 in  () at /usr/lib/libglib-2.0.so.0
#39 0x00007f64ea3150e2 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#40 0x00007f64ec4d8c6c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#41 0x00007f64ec4866ec in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#42 0x00007f64ec491219 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#43 0x000055fd9e439ee4 in  ()
#44 0x00007f64ebc3c790 in  () at /usr/lib/libc.so.6
#45 0x00007f64ebc3c84a in __libc_start_main () at /usr/lib/libc.so.6
#46 0x000055fd9e43af45 in  ()
[Inferior 1 (process 3669) detached]

Reported using DrKonqi
Comment 1 Carl Schwan 2023-02-19 12:02:52 UTC
*** Bug 463616 has been marked as a duplicate of this bug. ***
Comment 2 Carl Schwan 2023-02-19 12:03:22 UTC
*** Bug 463513 has been marked as a duplicate of this bug. ***
Comment 3 Carl Schwan 2023-02-19 12:03:33 UTC
*** Bug 463300 has been marked as a duplicate of this bug. ***
Comment 4 Carl Schwan 2023-02-19 12:04:25 UTC
*** Bug 464083 has been marked as a duplicate of this bug. ***
Comment 5 Carl Schwan 2023-02-19 12:04:58 UTC
*** Bug 464347 has been marked as a duplicate of this bug. ***
Comment 6 Carl Schwan 2023-02-19 12:05:16 UTC
*** Bug 464358 has been marked as a duplicate of this bug. ***
Comment 7 Carl Schwan 2023-02-19 12:05:50 UTC
*** Bug 465375 has been marked as a duplicate of this bug. ***
Comment 8 Carl Schwan 2023-02-19 12:06:23 UTC
*** Bug 465667 has been marked as a duplicate of this bug. ***
Comment 9 Carl Schwan 2023-02-19 12:18:07 UTC
*** Bug 464877 has been marked as a duplicate of this bug. ***
Comment 10 Carl Schwan 2023-02-19 12:37:39 UTC
*** Bug 463145 has been marked as a duplicate of this bug. ***
Comment 11 Carl Schwan 2023-02-20 12:21:56 UTC
*** Bug 463262 has been marked as a duplicate of this bug. ***
Comment 12 Claudio Cambra 2023-03-06 19:18:23 UTC
*** Bug 466692 has been marked as a duplicate of this bug. ***
Comment 13 satya 2023-03-11 18:50:35 UTC
in the contact view when i  create contact after filling the information when i click on the add buttonsuddenly app crashes
QML debugging is enabled. Only use this in a safe environment.
Hspell: can't open /usr/share/hspell/hebrew.wgz.sizes.
44 -- exe=/home/satya/kalendar/build/bin/kalendar
13 -- platform=xcb
11 -- display=:0
17 -- appname=kalendar
39 -- apppath=/home/satya/kalendar/build/bin
9 -- signal=6
9 -- pid=8036
20 -- appversion=23.03.70
21 -- programname=Kalendar
31 -- bugaddress=submit@bugs.kde.org
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = kalendar path = /home/satya/kalendar/build/bin pid = 8036
KCrash: Arguments: /home/satya/kalendar/build/bin/kalendar
Comment 14 Bug Janitor Service 2023-04-22 10:31:09 UTC
A possibly relevant merge request was started @ https://invent.kde.org/pim/kalendar/-/merge_requests/359
Comment 15 Carl Schwan 2023-04-23 21:09:47 UTC
Git commit c925a526ceb89d78514ead777576987b620cc516 by Carl Schwan.
Committed on 23/04/2023 at 14:43.
Pushed by carlschwan into branch 'master'.

Fix crashes in incidenceoccurrencemodel

The cause for these crashes is that the QPersistentModelIndex get
invalided at some point and then the row is -1 which is invalid.
This is probably caused by bugs somewhere in ETMCalendar.

The previous code which tried to only update part of the model,
which in theory should be faster was wrong since a dataChanged on the
source model could result in less or more entry due to the recurrence
rules changing or in a different hash due to the start or end date
changing.

M  +5    -132  src/models/incidenceoccurrencemodel.cpp
M  +0    -6    src/models/incidenceoccurrencemodel.h

https://invent.kde.org/pim/kalendar/commit/c925a526ceb89d78514ead777576987b620cc516
Comment 16 Carl Schwan 2023-04-23 21:10:39 UTC
Git commit a5264b1cf752ac5cc7ec641b09b586db1d070f0b by Carl Schwan.
Committed on 23/04/2023 at 21:10.
Pushed by carlschwan into branch 'release/23.04'.

Fix crashes in incidenceoccurrencemodel

The cause for these crashes is that the QPersistentModelIndex get
invalided at some point and then the row is -1 which is invalid.
This is probably caused by bugs somewhere in ETMCalendar.

The previous code which tried to only update part of the model,
which in theory should be faster was wrong since a dataChanged on the
source model could result in less or more entry due to the recurrence
rules changing or in a different hash due to the start or end date
changing.


(cherry picked from commit c925a526ceb89d78514ead777576987b620cc516)

M  +5    -132  src/models/incidenceoccurrencemodel.cpp
M  +0    -6    src/models/incidenceoccurrencemodel.h

https://invent.kde.org/pim/kalendar/commit/a5264b1cf752ac5cc7ec641b09b586db1d070f0b
Comment 17 Riccardo Robecchi 2023-05-02 10:13:03 UTC
Created attachment 158619 [details]
Crash with Kalendar 23.04.0

Kalendar 23.04.0 is still crashing, so the issue seems not to have been fixed unfortunately.
Comment 18 pedrud 2023-05-15 19:31:58 UTC
Of the various Kalendar bugs with seg faults, this one is closest to my issues. If the devs think this warrants a new bug, I am happy to delete this and start a new one. 

Kalendar crashes multiple times a day for me. Often when I log back in, but also at random moments whilst I am working. 

Kalendar version: 23.04.0
Frameworks: 5.105.0
Qt: 5.15.9
Wayland

Application: Kalendar (kalendar), signal: Segmentation fault

[KCrash Handler]
#4  0x00007f7fca1ba680 in QDateTime::operator=(QDateTime const&) () from /lib64/libQt5Core.so.5
#5  0x0000555618f78c42 in IncidenceOccurrenceModel::slotSourceDataChanged(QModelIndex const&, QModelIndex const&) ()
#6  0x00007f7fca2e8651 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#7  0x00007f7fca262101 in QAbstractItemModel::dataChanged(QModelIndex const&, QModelIndex const&, QVector<int> const&) () from /lib64/libQt5Core.so.5
#8  0x00007f7fca295320 in QSortFilterProxyModelPrivate::_q_sourceDataChanged(QModelIndex const&, QModelIndex const&, QVector<int> const&) () from /lib64/libQt5Core.so.5
#9  0x00007f7fca2e87d8 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#10 0x00007f7fca262101 in QAbstractItemModel::dataChanged(QModelIndex const&, QModelIndex const&, QVector<int> const&) () from /lib64/libQt5Core.so.5
#11 0x00007f7fca295320 in QSortFilterProxyModelPrivate::_q_sourceDataChanged(QModelIndex const&, QModelIndex const&, QVector<int> const&) () from /lib64/libQt5Core.so.5
#12 0x00007f7fca2e87d8 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#13 0x00007f7fca262101 in QAbstractItemModel::dataChanged(QModelIndex const&, QModelIndex const&, QVector<int> const&) () from /lib64/libQt5Core.so.5
#14 0x00007f7fca295320 in QSortFilterProxyModelPrivate::_q_sourceDataChanged(QModelIndex const&, QModelIndex const&, QVector<int> const&) () from /lib64/libQt5Core.so.5
#15 0x00007f7fca2e87d8 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#16 0x00007f7fca262101 in QAbstractItemModel::dataChanged(QModelIndex const&, QModelIndex const&, QVector<int> const&) () from /lib64/libQt5Core.so.5
#17 0x00007f7fcc75c14d in KSelectionProxyModelPrivate::sourceDataChanged(QModelIndex const&, QModelIndex const&) () from /lib64/libKF5ItemModels.so.5
#18 0x00007f7fca2e8651 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#19 0x00007f7fca262101 in QAbstractItemModel::dataChanged(QModelIndex const&, QModelIndex const&, QVector<int> const&) () from /lib64/libQt5Core.so.5
#20 0x00007f7fcc91bee5 in Akonadi::EntityTreeModelPrivate::dataChanged(QModelIndex const&, QModelIndex const&) () from /lib64/libKPim5AkonadiCore.so.5
#21 0x00007f7fcc921dc9 in Akonadi::EntityTreeModelPrivate::monitoredItemChanged(Akonadi::Item const&, QSet<QByteArray> const&) () from /lib64/libKPim5AkonadiCore.so.5
#22 0x00007f7fca2e87d8 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#23 0x00007f7fcc89946d in Akonadi::Monitor::itemChanged(Akonadi::Item const&, QSet<QByteArray> const&) () from /lib64/libKPim5AkonadiCore.so.5
#24 0x00007f7fcc8adfde in Akonadi::MonitorPrivate::emitItemsNotification(Akonadi::Protocol::ItemChangeNotification const&, QVector<Akonadi::Item> const&, Akonadi::Collection const&, Akonadi::Collection const&) () from /lib64/libKPim5AkonadiCore.so.5
#25 0x00007f7fcc8a842a in Akonadi::MonitorPrivate::emitNotification(QSharedPointer<Akonadi::Protocol::ChangeNotification> const&) () from /lib64/libKPim5AkonadiCore.so.5
#26 0x00007f7fcc8a713d in Akonadi::MonitorPrivate::flushPipeline() () from /lib64/libKPim5AkonadiCore.so.5
#27 0x00007f7fcc8a7a95 in Akonadi::MonitorPrivate::dataAvailable() () from /lib64/libKPim5AkonadiCore.so.5
#28 0x00007f7fca2e8651 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#29 0x00007f7fca2e87d8 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#30 0x00007f7fcb789f06 in KJob::result(KJob*, KJob::QPrivateSignal) () from /lib64/libKF5CoreAddons.so.5
#31 0x00007f7fcb78faeb in KJob::finishJob(bool) () from /lib64/libKF5CoreAddons.so.5
#32 0x00007f7fca2df73b in QObject::event(QEvent*) () from /lib64/libQt5Core.so.5
#33 0x00007f7fcafaeb75 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#34 0x00007f7fca2b3d48 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
#35 0x00007f7fca2b71f5 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /lib64/libQt5Core.so.5
#36 0x00007f7fca306e2f in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQt5Core.so.5
#37 0x00007f7fc7f1339c in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#38 0x00007f7fc7f71438 in g_main_context_iterate.isra () from /lib64/libglib-2.0.so.0
#39 0x00007f7fc7f10a23 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#40 0x00007f7fca306919 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#41 0x00007f7fca2b270b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#42 0x00007f7fca2ba99b in QCoreApplication::exec() () from /lib64/libQt5Core.so.5
#43 0x0000555618f4cdd0 in main ()
[Inferior 1 (process 74366) detached]
Comment 19 Carl Schwan 2023-05-16 12:00:37 UTC
> Kalendar version: 23.04.0

You need kalendar 23.04.1 which contains the fix. It's released so hopefully it reach your distro soon
Comment 20 Riccardo Robecchi 2023-05-16 12:06:29 UTC
Created attachment 158996 [details]
Crash with Kalendar 23.04.1

Just had a crash with Kalendar 23.04.1.