Bug 491810

Summary: Crash when fething calendar
Product: [Frameworks and Libraries] Akonadi Reporter: Johan Erlands <johan.erlands>
Component: EWS ResourceAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: crash CC: carl, johan.erlands, krissn
Priority: NOR    
Version: 5.24.3   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Johan Erlands 2024-08-17 09:09:08 UTC
SUMMARY
I have suffered from kmail not sending mail to crashes in ews. What I can see is that ews starts fetching calendar items, 0 of 14 (0% done). It doesn't change until it crashes or I force restart of akonadi.


STEPS TO REPRODUCE
1. Configure kmail
2. Subscriptions
3. Check Calendar
4. Press ok and wait for problem to start. I takes some time for the problem to begin.

I realise that this might not fail for all since it could be something in my outlook calendar that not all have.

OBSERVED RESULT
The resource waits for download of Calendar items. After a while it stops fetching mail, sending is impossible and then it crashes.

EXPECTED RESULT
Calendar items is fetched. Rest of kmail is working like fetching mail and sending.

SOFTWARE/OS VERSIONS
Operating System: Kubuntu 24.04
KDE Plasma Version: 5.27.11
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.13
Kernel Version: 6.8.0-40-generic (64-bit)
Graphics Platform: offscreen
Processors: 20 × 12th Gen Intel® Core™ i7-12700H
Memory: 31.0 GiB of RAM
Graphics Processor: Mesa Intel® Graphics
ADDITIONAL INFORMATION

Backtrace (I hope this can give a hint of why it crashes)
#0  __GI___pthread_sigmask (how=1, newmask=<optimized out>, oldmask=0x0) at ./nptl/pthread_sigmask.c:43
#1  0x000075a63d2454fd in __GI___sigprocmask (how=<optimized out>, set=<optimized out>, oset=<optimized out>) at ../sysdeps/unix/sysv/linux/sigprocmask.c:25
#2  0x000075a63df800d4 in KCrash::setCrashHandler (handler=handler@entry=0x0) at ./src/kcrash.cpp:419
#3  0x000075a63df826b7 in KCrash::defaultCrashHandler (sig=11) at ./src/kcrash.cpp:630
#4  <signal handler called>
#5  std::__atomic_base<int>::operator++ (this=0x18) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qbasicatomic.h:118
#6  QAtomicOps<int>::ref<int> (_q_value=<error reading variable: Cannot access memory at address 0x18>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qatomic_cxx11.h:283
#7  QBasicAtomicInteger<int>::ref (this=0x18) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qbasicatomic.h:118
#8  QSharedPointer<KCalendarCore::Incidence>::ref (this=0x7ffc8de67310) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:509
#9  QSharedPointer<KCalendarCore::Incidence>::QSharedPointer<KCalendarCore::Event, true> (other=..., this=0x7ffc8de67310) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qsharedpointer_impl.h:371
#10 EwsFetchCalendarDetailJob::exceptionItemsFetched (this=<optimized out>, job=<optimized out>) at /usr/src/kdepim-runtime-4:23.08.5-0ubuntu3/resources/ews/calendar/ewsfetchcalendardetailjob.cpp:179
#11 0x000075a63dd12e16 in QtPrivate::QSlotObjectBase::call (a=0x7ffc8de674a0, r=0x5c4cd251aa60, this=0x5c4cd231dc10) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#12 doActivate<false> (sender=0x5c4cd2a56ff0, signal_index=6, argv=0x7ffc8de674a0) at kernel/qobject.cpp:3925
#13 0x000075a63dd0b697 in QMetaObject::activate (sender=sender@entry=0x5c4cd2a56ff0, m=<optimized out>, local_signal_index=local_signal_index@entry=3, argv=argv@entry=0x7ffc8de674a0)
    at kernel/qobject.cpp:3985
#14 0x000075a647782266 in KJob::result (this=this@entry=0x5c4cd2a56ff0, _t1=<optimized out>, _t1@entry=0x5c4cd2a56ff0, _t2=...)
    at /usr/src/kcoreaddons-5.115.0-0ubuntu5/obj-x86_64-linux-gnu/src/lib/KF5CoreAddons_autogen/include/moc_kjob.cpp:633
#15 0x000075a6477880eb in KJob::finishJob (this=0x5c4cd2a56ff0, emitResult=<optimized out>) at /usr/src/kcoreaddons-5.115.0-0ubuntu5/src/lib/jobs/kjob.cpp:98
#16 0x000075a63dd12e16 in QtPrivate::QSlotObjectBase::call (a=0x7ffc8de675d0, r=0x5c4cd2a56ff0, this=0x5c4cd2551df0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#17 doActivate<false> (sender=0x5c4cd271f3e0, signal_index=6, argv=0x7ffc8de675d0) at kernel/qobject.cpp:3925
#18 0x000075a63dd0b697 in QMetaObject::activate (sender=sender@entry=0x5c4cd271f3e0, m=<optimized out>, local_signal_index=local_signal_index@entry=3, argv=argv@entry=0x7ffc8de675d0)
    at kernel/qobject.cpp:3985
#19 0x000075a647782266 in KJob::result (this=this@entry=0x5c4cd271f3e0, _t1=<optimized out>, _t1@entry=0x5c4cd271f3e0, _t2=...)
    at /usr/src/kcoreaddons-5.115.0-0ubuntu5/obj-x86_64-linux-gnu/src/lib/KF5CoreAddons_autogen/include/moc_kjob.cpp:633
#20 0x000075a6477880eb in KJob::finishJob (this=0x5c4cd271f3e0, emitResult=<optimized out>) at /usr/src/kcoreaddons-5.115.0-0ubuntu5/src/lib/jobs/kjob.cpp:98
#21 0x000075a63dd12e16 in QtPrivate::QSlotObjectBase::call (a=0x7ffc8de676a0, r=0x5c4cd271f3e0, this=0x5c4cd26a4660) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#22 doActivate<false> (sender=0x5c4cd24df650, signal_index=7, argv=0x7ffc8de676a0) at kernel/qobject.cpp:3925
#23 0x000075a63dd0b697 in QMetaObject::activate (sender=sender@entry=0x5c4cd24df650, m=m@entry=0x75a647a22ba0 <KIO::SlaveInterface::staticMetaObject>, local_signal_index=local_signal_index@entry=4, 
    argv=argv@entry=0x0) at kernel/qobject.cpp:3985
#24 0x000075a647934fe7 in KIO::SlaveInterface::finished (this=this@entry=0x5c4cd24df650) at /usr/src/kio-5.115.0-0ubuntu6/obj-x86_64-linux-gnu/src/core/KF5KIOCore_autogen/include/moc_slaveinterface.cpp:464
#25 0x000075a6479372cb in KIO::SlaveInterface::dispatch (this=0x5c4cd24df650, _cmd=<optimized out>, rawdata=...) at /usr/src/kio-5.115.0-0ubuntu6/src/core/slaveinterface.cpp:149
#26 0x000075a64793586b in KIO::SlaveInterface::dispatch (this=0x5c4cd24df650) at /usr/src/kio-5.115.0-0ubuntu6/src/core/slaveinterface.cpp:78
#27 0x000075a64793ab11 in KIO::Slave::gotInput (this=0x5c4cd24df650) at /usr/src/kio-5.115.0-0ubuntu6/src/core/slave.cpp:354
#28 0x000075a63dd12e16 in QtPrivate::QSlotObjectBase::call (a=0x7ffc8de67930, r=0x5c4cd24df650, this=0x5c4cd2661080) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#29 doActivate<false> (sender=0x5c4cd256b3a0, signal_index=3, argv=0x7ffc8de67930) at kernel/qobject.cpp:3925
#30 0x000075a63dd06343 in QObject::event (this=0x5c4cd256b3a0, e=0x5c4cd25bbb40) at kernel/qobject.cpp:1347
#31 0x000075a63e96bd45 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x5c4cd256b3a0, e=0x5c4cd25bbb40) at kernel/qapplication.cpp:3640
#32 0x000075a63dcd8118 in QCoreApplication::notifyInternal2 (receiver=0x5c4cd256b3a0, event=0x5c4cd25bbb40) at kernel/qcoreapplication.cpp:1064
#33 0x000075a63dcd8332 in QCoreApplication::sendEvent (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1462
#34 0x000075a63dcdb94b in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x5c4cd1fe7580) at kernel/qcoreapplication.cpp:1821
#35 0x000075a63dcdbebd in QCoreApplication::sendPostedEvents (receiver=<optimized out>, event_type=<optimized out>) at kernel/qcoreapplication.cpp:1680
#36 0x000075a63dd35c0f in postEventSourceDispatch (s=s@entry=0x5c4cd212d7b0) at kernel/qeventdispatcher_glib.cpp:277
#37 0x000075a63b1445b5 in g_main_dispatch (context=0x75a630000ed0) at ../../../glib/gmain.c:3344
#38 0x000075a63b1a3717 in g_main_context_dispatch_unlocked (context=0x75a630000ed0) at ../../../glib/gmain.c:4152
#39 g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x75a630000ed0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../../../glib/gmain.c:4217
#40 0x000075a63b143a53 in g_main_context_iteration (context=0x75a630000ed0, may_block=1) at ../../../glib/gmain.c:4282
#41 0x000075a63dd35279 in QEventDispatcherGlib::processEvents (this=0x5c4cd21332f0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#42 0x000075a63dcd6a7b in QEventLoop::exec (this=this@entry=0x7ffc8de67d60, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#43 0x000075a63dcdf3e8 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#44 0x000075a63e138ecd in QGuiApplication::exec () at kernel/qguiapplication.cpp:1863
#45 0x000075a63e96bcb9 in QApplication::exec () at kernel/qapplication.cpp:2832
#46 0x000075a64810ed1c in Akonadi::ResourceBase::init (r=...) at /usr/src/akonadi-4:23.08.5-0ubuntu3/src/agentbase/resourcebase.cpp:555
#47 0x00005c4cd13bb87d in Akonadi::ResourceBase::init<EwsResource> (argc=<optimized out>, argv=<optimized out>) at /usr/include/KPim5/AkonadiAgentBase/akonadi/resourcebase.h:184
#48 0x000075a63d22a1ca in __libc_start_call_main (main=main@entry=0x5c4cd13662f0 <main(int, char**)>, argc=argc@entry=3, argv=argv@entry=0x7ffc8de68138) at ../sysdeps/nptl/libc_start_call_main.h:58
#49 0x000075a63d22a28b in __libc_start_main_impl (main=0x5c4cd13662f0 <main(int, char**)>, argc=3, argv=0x7ffc8de68138, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
    stack_end=0x7ffc8de68128) at ../csu/libc-start.c:360
#50 0x00005c4cd136c7e5 in _start ()

I found this issue https://bugs.kde.org/show_bug.cgi?id=491296 that this might be a duplicate of. I send this because It in on other version and distribution.
Comment 1 Johan Erlands 2024-08-19 06:24:10 UTC
I don't think subscriptions is involved in this issue. I have deselected calendar from subscriptions and still it fetches (tries to) calendar items.

It always get stuck at 0% of calendar items and it crashes when I press `Check mail`.
Comment 2 Bug Janitor Service 2024-08-19 08:19:02 UTC
A possibly relevant merge request was started @ https://invent.kde.org/pim/kdepim-runtime/-/merge_requests/180
Comment 3 Carl Schwan 2024-08-21 08:11:50 UTC
Git commit 522ff9b508e13d1d1167f4a6fe71a23fbc0661f7 by Carl Schwan.
Committed on 21/08/2024 at 08:02.
Pushed by carlschwan into branch 'master'.

ews: Bound check calendar events

M  +4    -0    resources/ews/calendar/ewsfetchcalendardetailjob.cpp

https://invent.kde.org/pim/kdepim-runtime/-/commit/522ff9b508e13d1d1167f4a6fe71a23fbc0661f7
Comment 4 Johan Erlands 2024-08-23 06:43:49 UTC
Thank you, that was quick.