Summary: | Akonadi IMAP resource crash after attempted offline/online | ||
---|---|---|---|
Product: | [Frameworks and Libraries] Akonadi | Reporter: | Erik Quaeghebeur <bugs.kde.org> |
Component: | IMAP resource | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | REOPENED --- | ||
Severity: | crash | CC: | a.samirh78, bugs.kde.org, davispuh, giecrilj, heri+kde, john4deidre2013, kde, kollix |
Priority: | HI | Keywords: | drkonqi |
Version: | 5.12.3 | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=428459 | ||
Latest Commit: | https://invent.kde.org/pim/akonadi/commit/66d1135d127331fb3a2a7e047b0577d7e67d3dc2 | Version Fixed In: | 20.08.2 |
Sentry Crash Report: | |||
Attachments: |
New crash information added by DrKonqi
New crash information added by DrKonqi New crash information added by DrKonqi New crash information added by DrKonqi |
Description
Erik Quaeghebeur
2020-03-14 10:46:40 UTC
*** Bug 418595 has been marked as a duplicate of this bug. *** In this report we get to Akonadi::AgentBase::setOnline via a dbus call and the QSettings member is null, hence the crash; the backtrace from bug 418595 comment0 is a bit different code path, but the end result is the same: Thread 1 (Thread 0x7f83d0b28d80 (LWP 266490)): [KCrash Handler] #6 0x00007f83e3a2d5b9 in qGetPtrHelper<QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> > >(QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >&) (ptr=...) at io/qsettings.cpp:3277 #7 QSettings::d_func() (this=<optimized out>) at io/qsettings.h:72 #8 QSettings::setValue(QString const&, QVariant const&) (this=this@entry=0x0, key=..., value=...) at io/qsettings.cpp:3278 #9 0x00007f83e561097e in Akonadi::AgentBase::setOnline(bool) (this=0x7ffc21fe7850, state=state@entry=true) at /tmp/portage/kde-apps/akonadi-19.12.3/work/akonadi-19.12.3/src/agentbase/agentbase.cpp:1032 #10 0x0000564e8a389b84 in ImapResourceBase::onConnectDone(int, QString const&) (this=0x7ffc21fe7850, errorCode=<optimized out>, errorString=...) at /tmp/portage/kde-apps/kdepim-runtime-19.12.3/work/kdepim-runtime-19.12.3/resources/imap/imapresourcebase.cpp:290 #11 0x00007f83e3acf585 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffc21fe6e80, r=0x7ffc21fe7850, this=0x564e8a8212b0) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:394 #12 doActivate<false>(QObject*, int, void**) (sender=0x564e8a8209e0, signal_index=7, argv=0x7ffc21fe6e80) at kernel/qobject.cpp:3870 #13 0x00007f83e3ac9d47 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (sender=sender@entry=0x564e8a8209e0, m=m@entry=0x564e8a400200 <SessionPool::staticMetaObject>, local_signal_index=local_signal_index@entry=4, argv=argv@entry=0x7ffc21fe6e80) at kernel/qobject.cpp:3930 #14 0x0000564e8a368d26 in SessionPool::connectDone(int, QString const&) (this=this@entry=0x564e8a8209e0, _t1=<optimized out>, _t1@entry=0, _t2=...) at resources/imap/imapresource_autogen/EWIEGA46WW/moc_sessionpool.cpp:302 #15 0x0000564e8a3bb16e in SessionPool::declareSessionReady(KIMAP::Session*) (this=0x564e8a8209e0, session=<optimized out>) at /usr/include/qt5/QtCore/qarraydata.h:257 #16 0x0000564e8a3bc1c4 in SessionPool::onIdDone(KJob*) (this=0x564e8a8209e0, job=<optimized out>) at /tmp/portage/kde-apps/kdepim-runtime-19.12.3/work/kdepim-runtime-19.12.3/resources/imap/sessionpool.cpp:548 #17 0x00007f83e3acf585 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffc21fe7060, r=0x564e8a8209e0, this=0x564e8ad49d10) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:394 #18 doActivate<false>(QObject*, int, void**) (sender=0x7f8364012430, signal_index=6, argv=0x7ffc21fe7060) at kernel/qobject.cpp:3870 #19 0x00007f83e4f55b2c in KJob::result(KJob*, KJob::QPrivateSignal) () at /usr/lib64/libKF5CoreAddons.so.5 #20 0x00007f83e4f5662b in KJob::finishJob(bool) () at /usr/lib64/libKF5CoreAddons.so.5 #21 0x00007f83e57a677c in KIMAP::Job::handleErrorReplies(KIMAP::Response const&) () at /usr/lib64/libKF5IMAP.so.5 #22 0x00007f83e57c5d6b in KIMAP::SessionPrivate::responseReceived(KIMAP::Response const&) () at /usr/lib64/libKF5IMAP.so.5 #23 0x00007f83e3ac7a0c in QObject::event(QEvent*) (this=0x564e8ad5fc60, e=0x7f8364042e80) at kernel/qobject.cpp:1339 #24 0x00007f83e46c2eb3 in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=this@entry=0x564e8a59dba0, receiver=receiver@entry=0x564e8ad5fc60, e=e@entry=0x7f8364042e80) at kernel/qapplication.cpp:3684 #25 0x00007f83e46cc3c0 in QApplication::notify(QObject*, QEvent*) (this=0x7ffc21fe7840, receiver=0x564e8ad5fc60, e=0x7f8364042e80) at kernel/qapplication.cpp:3430 #26 0x00007f83e3a9b1ce in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x564e8ad5fc60, event=0x7f8364042e80) at kernel/qcoreapplication.cpp:1092 #27 0x00007f83e3a9ddc7 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=0x0, event_type=0, data=0x564e8a57b490) at kernel/qcoreapplication.cpp:1832 #28 0x00007f83e3af1ad3 in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x564e8a605740) at kernel/qeventdispatcher_glib.cpp:277 #29 0x00007f83e1ba180f in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0 #30 0x00007f83e1ba1bb8 in () at /usr/lib64/libglib-2.0.so.0 #31 0x00007f83e1ba1c4f in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0 #32 0x00007f83e3af1880 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x564e8a613d00, flags=...) at kernel/qeventdispatcher_glib.cpp:423 #33 0x00007f83e3a9a01b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffc21fe7790, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:136 #34 0x00007f83e3aa212f in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:118 #35 0x00007f83e40638ec in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1866 #36 0x00007f83e46c2e25 in QApplication::exec() () at kernel/qapplication.cpp:2824 #37 0x00007f83e562034e in Akonadi::ResourceBase::init(Akonadi::ResourceBase&) (r=...) at /usr/include/qt5/QtCore/qcoreapplication.h:116 #38 0x0000564e8a355351 in Akonadi::ResourceBase::init<ImapResource>(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/include/KF5/AkonadiAgentBase/resourcebase.h:181 #39 0x00007f83e33bce9b in __libc_start_main () at /usr/lib64/libc.so.6 #40 0x0000564e8a352fda in _start () at /tmp/portage/kde-apps/kdepim-runtime-19.12.3/work/kdepim-runtime-19.12.3/resources/imap/main.cpp:22 *** Bug 411089 has been marked as a duplicate of this bug. *** A possibly relevant merge request was started @ https://invent.kde.org/pim/akonadi/-/merge_requests/24 *** Bug 426090 has been marked as a duplicate of this bug. *** *** Bug 423557 has been marked as a duplicate of this bug. *** *** Bug 414404 has been marked as a duplicate of this bug. *** *** Bug 411378 has been marked as a duplicate of this bug. *** Git commit 53574eb6fccc8f6a03dcea6c1ca1aa02dd895209 by Ahmad Samir. Committed on 02/09/2020 at 10:20. Pushed by ahmadsamir into branch 'master'. AgentBase: Fix crash in setOnline When setOnline tries to access the mSettings member after the latter has been deleted we get a crash; mSettings is deleted in quit() or cleanup(), therefore it looks like a race condition: the Agent is about to quit, but some other code calls setOnline leading to a crash. It looks like this can happen in more than one way, e.g. via a dbus call (from AgentInstance), or via a sub-class of AgentBase calling setOnline directly. Use a bool member var, modelled after how AgentInstance uses a similar logic. M +8 -0 src/agentbase/agentbase.cpp M +2 -0 src/agentbase/agentbase_p.h https://invent.kde.org/pim/akonadi/commit/53574eb6fccc8f6a03dcea6c1ca1aa02dd895209 (In reply to Ahmad Samir from comment #9) > Git commit 53574eb6fccc8f6a03dcea6c1ca1aa02dd895209 by Ahmad Samir. > Committed on 02/09/2020 at 10:20. > Pushed by ahmadsamir into branch 'master'. > > AgentBase: Fix crash in setOnline Can/will this this be backported to 20.04 and 20.08? Git commit 66d1135d127331fb3a2a7e047b0577d7e67d3dc2 by Ahmad Samir. Committed on 02/09/2020 at 10:58. Pushed by ahmadsamir into branch 'release/20.08'. AgentBase: Fix crash in setOnline When setOnline tries to access the mSettings member after the latter has been deleted we get a crash; mSettings is deleted in quit() or cleanup(), therefore it looks like a race condition: the Agent is about to quit, but some other code calls setOnline leading to a crash. It looks like this can happen in more than one way, e.g. via a dbus call (from AgentInstance), or via a sub-class of AgentBase calling setOnline directly. Use a bool member var, modelled after how AgentInstance uses a similar logic. (cherry picked from commit 53574eb6fccc8f6a03dcea6c1ca1aa02dd895209) M +8 -0 src/agentbase/agentbase.cpp M +2 -0 src/agentbase/agentbase_p.h https://invent.kde.org/pim/akonadi/commit/66d1135d127331fb3a2a7e047b0577d7e67d3dc2 I asked and I was told that release/20.04 is closed since 20.08 was released. So we don't push commits to the old stable branch. (Of course you can file a bug report in your distro bugzilla and a package maintainer can backport the fix manually, I think it should apply cleanly). Thanks for the reminder about pushing to release/20.08 o/ Still crashes. Application: akonadi_imap_resource (5.15.2 (20.08.2)) Qt Version: 5.15.1 Frameworks Version: 5.75.0 Operating System: Linux 5.8.14-1-default x86_64 Windowing system: X11 Distribution: openSUSE Tumbleweed Thread 1 (Thread 0x7eff3da35080 (LWP 1847)): [KCrash Handler] #4 0x00007eff4e21a8ca in QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::operator-> (this=<optimized out>) at io/qsettings.cpp:3270 #5 qGetPtrHelper<QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> > > (ptr=...) at ../../include/QtCore/../../src/corelib/global/qglobal.h:1135 #6 QSettings::d_func (this=<optimized out>) at io/qsettings.h:72 #7 QSettings::setValue (this=this@entry=0x0, key=..., value=...) at io/qsettings.cpp:3271 #8 0x00007eff4fcc41bd in Akonadi::AgentBase::setOnline (this=0x7ffed6d18a10, state=false) at /usr/include/qt5/QtCore/qstring.h:962 As of today, 2020-12-09, the issue is no longer reproducible on my Fedora 33 system with: * kf5-akonadi-server-20.08.3-1.fc33 * kf5-pimcommon-akonadi-20.08.3-1.fc33 *** Bug 442157 has been marked as a duplicate of this bug. *** Created attachment 141376 [details]
New crash information added by DrKonqi
akonadi_imap_resource (5.18.0 (21.08.0)) using Qt 5.15.2
I have all the same issues on akonadi 21.08.0 (Well, I have it for years already, and it happens time to time, I just decided to report it only now).
I also redy to bet that it will keep happening on .1 too
-- Backtrace (Reduced):
#4 0x00007fe085898069 in QSettings::setValue(QString const&, QVariant const&) () at /usr/lib64/libQt5Core.so.5
#5 0x00007fe0872206fd in Akonadi::AgentBase::setOnline(bool) () at /usr/lib64/libKF5AkonadiAgentBase.so.5
#6 0x000055e0b6ff2252 in ImapResourceBase::configure(unsigned long long) ()
#7 0x00007fe08724af43 in Akonadi__ControlAdaptor::qt_metacall(QMetaObject::Call, int, void**) () at /usr/lib64/libKF5AkonadiAgentBase.so.5
#8 0x00007fe085bdd669 in QDBusConnectionPrivate::deliverCall(QObject*, int, QDBusMessage const&, QVector<int> const&, int) () at /usr/lib64/libQt5DBus.so.5
Created attachment 147620 [details]
New crash information added by DrKonqi
akonadi_imap_resource (5.18.3 (21.08.3)) using Qt 5.15.2
- What I was doing when the application crashed:
Trying to toggle online/offline from unclear online/offline state (empty info in akonadiconsole)
-- Backtrace (Reduced):
#4 0x00007b0237569399 in QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::operator->() const (this=<optimized out>) at ../../include/QtCore/../../../qtbase-f4ac0b55c37f2b594ffbe639db43dac365825c7c/src/corelib/tools/qscopedpointer.h:118
[...]
#7 QSettings::setValue(QString const&, QVariant const&) (this=this@entry=0x0, key=..., value=...) at /var/tmp/portage/dev-qt/qtcore-5.15.2-r14/work/qtbase-f4ac0b55c37f2b594ffbe639db43dac365825c7c/src/corelib/io/qsettings.cpp:3271
#8 0x00007b0238ff955d in Akonadi::AgentBase::setOnline(bool) (this=0x7ffef3c29750, state=false) at /var/tmp/portage/kde-apps/akonadi-21.08.3/work/akonadi-21.08.3/src/agentbase/agentbase.cpp:1003
#9 0x00007b023902598d in Akonadi__StatusAdaptor::setOnline(bool) (state=<optimized out>, this=<optimized out>) at /var/tmp/portage/kde-apps/akonadi-21.08.3/work/akonadi-21.08.3_build/src/agentbase/statusadaptor.cpp:51
#10 0x00007b0239025c43 in Akonadi__StatusAdaptor::qt_metacall(QMetaObject::Call, int, void**) (this=0x5f49ac78b510, _c=QMetaObject::InvokeMetaMethod, _id=8, _a=0x7ffef3c29110) at /var/tmp/portage/kde-apps/akonadi-21.08.3/work/akonadi-21.08.3_build/src/agentbase/statusadaptor.moc:238
Created attachment 151247 [details]
New crash information added by DrKonqi
akonadi_imap_resource (5.20.3 (22.04.3)) using Qt 5.15.5
- What I was doing when the application crashed:
Trying to restart an IMAP instance that had not visible state (empty instead of ‘Ready’ or something like that)
-- Backtrace (Reduced):
#4 0x00007322192f4c99 in QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::operator->() const (this=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.15.5-r2/work/qtbase-everywhere-src-5.15.5/include/QtCore/../../src/corelib/tools/qscopedpointer.h:118
[...]
#7 QSettings::setValue(QString const&, QVariant const&) (this=this@entry=0x0, key=..., value=...) at /var/tmp/portage/dev-qt/qtcore-5.15.5-r2/work/qtbase-everywhere-src-5.15.5/src/corelib/io/qsettings.cpp:3271
#8 0x000073221ac3f4dd in Akonadi::AgentBase::setOnline(bool) (this=0x7ffc706bf100, state=true) at /var/tmp/portage/kde-apps/akonadi-22.04.3/work/akonadi-22.04.3/src/agentbase/agentbase.cpp:1000
#9 0x00005e0fec677404 in ImapResourceBase::onConnectDone(int, QString const&) (this=0x7ffc706bf100, errorCode=<optimized out>, errorString=<optimized out>) at /var/tmp/portage/kde-apps/kdepim-runtime-22.04.3/work/kdepim-runtime-22.04.3/resources/imap/imapresourcebase.cpp:271
#10 0x0000732219394e86 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffc706be990, r=0x7ffc706bf100, this=0x5e0fed94c350) at /var/tmp/portage/dev-qt/qtcore-5.15.5-r2/work/qtbase-everywhere-src-5.15.5/include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
Created attachment 153106 [details]
New crash information added by DrKonqi
akonadi_imap_resource (5.21.2 (22.08.2)) using Qt 5.15.6
i was changing settings within kontact settings and it seemed to crash unexpectedly
-- Backtrace (Reduced):
#4 0x00007fac6dbc671a in QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::operator->() const (this=<optimized out>) at ../../include/QtCore/../../src/corelib/tools/qscopedpointer.h:118
[...]
#7 QSettings::setValue(QString const&, QVariant const&) (this=0x0, key=..., value=...) at io/qsettings.cpp:3271
#8 0x00007fac6f66fb75 in Akonadi::AgentBase::setOnline(bool) () at /lib64/libKF5AkonadiAgentBase.so.5
#9 0x0000560d5d32f34c in ImapResourceBase::onConnectDone(int, QString const&) (this=0x7ffe14ad2860, errorCode=<optimized out>, errorString=<optimized out>) at /usr/src/debug/kdepim-runtime-22.08.2-1.1.x86_64/resources/imap/imapresourcebase.cpp:271
#10 0x00007fac6dc8205d in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffe14ad2070, r=0x7ffe14ad2860, this=0x560d5eac1b30) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
|