Bug 378831 - crash on mail check
Summary: crash on mail check
Status: RESOLVED NOT A BUG
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: POP3 Resource (show other bugs)
Version: GIT (master)
Platform: Other Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-16 08:48 UTC by Martin Koller
Modified: 2017-04-16 10:17 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Koller 2017-04-16 08:48:06 UTC
Now and then the pop3 resource crashes.
Currently it seems to happen always reproducible

Application: akonadi_pop3_resource (akonadi_pop3_resource), signal: Aborted
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f5cfb6c58c0 (LWP 25414))]

Thread 5 (Thread 0x7f5cd9131700 (LWP 25504)):
#0  0x00007f5cf0ccc7d4 in g_mutex_unlock () from /usr/lib64/libglib-2.0.so.0
#1  0x00007f5cf0c8b309 in ?? () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f5cf0c8b42c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f5cf692d8ab in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#4  0x00007f5cf68dd6ab in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#5  0x00007f5cf67259aa in QThread::exec() () from /usr/lib64/libQt5Core.so.5
#6  0x00007f5cf672a019 in QThreadPrivate::start(void*) () from /usr/lib64/libQt5Core.so.5
#7  0x00007f5cf2b03744 in start_thread () from /lib64/libpthread.so.0
#8  0x00007f5cf5b22d3d in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7f5cd9932700 (LWP 25455)):
#0  0x00007f5cf692bcc2 in QTimerInfoList::updateCurrentTime() () from /usr/lib64/libQt5Core.so.5
#1  0x00007f5cf692c235 in QTimerInfoList::timerWait(timespec&) () from /usr/lib64/libQt5Core.so.5
#2  0x00007f5cf692d67e in timerSourcePrepare(_GSource*, int*) () from /usr/lib64/libQt5Core.so.5
#3  0x00007f5cf0c8a95d in g_main_context_prepare () from /usr/lib64/libglib-2.0.so.0
#4  0x00007f5cf0c8b230 in ?? () from /usr/lib64/libglib-2.0.so.0
#5  0x00007f5cf0c8b42c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#6  0x00007f5cf692d8ab in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#7  0x00007f5cf68dd6ab in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#8  0x00007f5cf67259aa in QThread::exec() () from /usr/lib64/libQt5Core.so.5
#9  0x00007f5cf672a019 in QThreadPrivate::start(void*) () from /usr/lib64/libQt5Core.so.5
#10 0x00007f5cf2b03744 in start_thread () from /lib64/libpthread.so.0
#11 0x00007f5cf5b22d3d in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7f5cda353700 (LWP 25450)):
#0  0x00007f5cf0ccc7b9 in g_mutex_lock () from /usr/lib64/libglib-2.0.so.0
#1  0x00007f5cf0c8a969 in g_main_context_prepare () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f5cf0c8b230 in ?? () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f5cf0c8b42c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#4  0x00007f5cf692d8ab in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#5  0x00007f5cf68dd6ab in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#6  0x00007f5cf67259aa in QThread::exec() () from /usr/lib64/libQt5Core.so.5
#7  0x00007f5cf8185d15 in ?? () from /usr/lib64/libQt5DBus.so.5
#8  0x00007f5cf672a019 in QThreadPrivate::start(void*) () from /usr/lib64/libQt5Core.so.5
#9  0x00007f5cf2b03744 in start_thread () from /lib64/libpthread.so.0
#10 0x00007f5cf5b22d3d in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7f5ce6288700 (LWP 25434)):
#0  0x00007f5cf5b1a49d in poll () from /lib64/libc.so.6
#1  0x00007f5cf2f283c2 in _xcb_conn_wait () from /usr/lib64/libxcb.so.1
#2  0x00007f5cf2f2a10f in xcb_wait_for_event () from /usr/lib64/libxcb.so.1
#3  0x00007f5ce87eac29 in ?? () from /usr/lib64/libQt5XcbQpa.so.5
#4  0x00007f5cf672a019 in QThreadPrivate::start(void*) () from /usr/lib64/libQt5Core.so.5
#5  0x00007f5cf2b03744 in start_thread () from /lib64/libpthread.so.0
#6  0x00007f5cf5b22d3d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f5cfb6c58c0 (LWP 25414)):
[KCrash Handler]
#6  0x00007f5cf5a6d8d7 in raise () from /lib64/libc.so.6
#7  0x00007f5cf5a6ecaa in abort () from /lib64/libc.so.6
#8  0x00007f5cf67156fe in QMessageLogger::fatal(char const*, ...) const () from /usr/lib64/libQt5Core.so.5
#9  0x00007f5cf6710fae in qt_assert(char const*, char const*, int) () from /usr/lib64/libQt5Core.so.5
#10 0x0000000000418148 in POP3Resource::saveSeenUIDList (this=0xf16040) at /home/KDE5/source/kde/kdepim-runtime/resources/pop3/pop3resource.cpp:903
#11 0x0000000000418a5d in POP3Resource::cancelSync (this=0xf16040, errorMessage=..., error=true) at /home/KDE5/source/kde/kdepim-runtime/resources/pop3/pop3resource.cpp:958
#12 0x0000000000414ec5 in POP3Resource::loginJobResult (this=0xf16040, job=0xf7d6f0) at /home/KDE5/source/kde/kdepim-runtime/resources/pop3/pop3resource.cpp:514
#13 0x0000000000422d99 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<KJob*>, void, void (POP3Resource::*)(KJob*)>::call (f=(void (POP3Resource::*)(POP3Resource * const, KJob *)) 0x414cbc <POP3Resource::loginJobResult(KJob*)>, o=0xf16040, arg=0x7ffd436d3d00) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:143
#14 0x0000000000422337 in QtPrivate::FunctionPointer<void (POP3Resource::*)(KJob*)>::call<QtPrivate::List<KJob*>, void> (f=(void (POP3Resource::*)(POP3Resource * const, KJob *)) 0x414cbc <POP3Resource::loginJobResult(KJob*)>, o=0xf16040, arg=0x7ffd436d3d00) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:162
#15 0x0000000000420fd3 in QtPrivate::QSlotObject<void (POP3Resource::*)(KJob*), QtPrivate::List<KJob*>, void>::impl (which=1, this_=0xf25d50, r=0xf16040, a=0x7ffd436d3d00, ret=0x0) at /usr/include/qt5/QtCore/qobject_impl.h:120
#16 0x00007f5cf690771c in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib64/libQt5Core.so.5
#17 0x00007f5cf7f15a92 in KJob::result (this=this@entry=0xf7d6f0, _t1=_t1@entry=0xf7d6f0) at /usr/src/debug/kcoreaddons-5.33.0/build/src/lib/moc_kjob.cpp:570
#18 0x00007f5cf7f167bf in KJob::finishJob (this=0xf7d6f0, emitResult=<optimized out>) at /usr/src/debug/kcoreaddons-5.33.0/src/lib/jobs/kjob.cpp:109
#19 0x00000000004383c1 in LoginJob::slaveError (this=0xf7d6f0, errorCode=149, errorMessage=...) at /home/KDE5/source/kde/kdepim-runtime/resources/pop3/jobs.cpp:301
#20 0x0000000000436c71 in POPSession::slotSlaveError (this=0xf133c0, slave=0xf528c0, errorCode=149, errorMessage=...) at /home/KDE5/source/kde/kdepim-runtime/resources/pop3/jobs.cpp:67
#21 0x00000000004425f7 in POPSession::qt_static_metacall (_o=0xf133c0, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7ffd436d3fb0) at /home/KDE5/source/build/kde/kdepim-runtime/resources/pop3/moc_jobs.cpp:85
#22 0x00007f5cf69070d5 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib64/libQt5Core.so.5
#23 0x00007f5cf9ee2915 in KIO::Scheduler::slaveError (this=<optimized out>, _t1=_t1@entry=0xf528c0, _t2=_t2@entry=149, _t3=...) at /usr/src/debug/kio-5.32.0/build/src/core/moc_scheduler.cpp:217
#24 0x00007f5cf9ee5eef in KIO::SchedulerPrivate::slotSlaveError (this=0xea86f0, errorNr=149, errorMsg=...) at /usr/src/debug/kio-5.32.0/src/core/scheduler.cpp:1258
#25 0x00007f5cf69070d5 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib64/libQt5Core.so.5
#26 0x00007f5cf9eba106 in KIO::SlaveInterface::error (this=this@entry=0xf528c0, _t1=149, _t2=...) at /usr/src/debug/kio-5.32.0/build/src/core/moc_slaveinterface.cpp:414
#27 0x00007f5cf9ebce47 in KIO::SlaveInterface::dispatch (this=0xf528c0, _cmd=<optimized out>, rawdata=...) at /usr/src/debug/kio-5.32.0/src/core/slaveinterface.cpp:192
#28 0x00007f5cf9eba518 in KIO::SlaveInterface::dispatch (this=0xf528c0) at /usr/src/debug/kio-5.32.0/src/core/slaveinterface.cpp:89
#29 0x00007f5cf9ebe84e in KIO::Slave::gotInput (this=0xf528c0) at /usr/src/debug/kio-5.32.0/src/core/slave.cpp:399
#30 0x00007f5cf9f3d865 in KIO::Slave::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at /usr/src/debug/kio-5.32.0/build/src/core/KF5KIOCore_automoc.dir/moc_slave_HJU3JQIV4SC6KR.cpp:89
#31 0x00007f5cf69070d5 in QMetaObject::activate(QObject*, int, int, void**) () from /usr/lib64/libQt5Core.so.5
#32 0x00007f5cf9e6b177 in KIO::Connection::readyRead (this=<optimized out>) at /usr/src/debug/kio-5.32.0/build/src/core/moc_connection_p.cpp:144
#33 KIO::ConnectionPrivate::dequeue (this=0xf7c090) at /usr/src/debug/kio-5.32.0/src/core/connection.cpp:46
#34 0x00007f5cf6908886 in QObject::event(QEvent*) () from /usr/lib64/libQt5Core.so.5
#35 0x00007f5cf77ee1bc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#36 0x00007f5cf77f50f0 in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/libQt5Widgets.so.5
#37 0x00007f5cf68df245 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib64/libQt5Core.so.5
#38 0x00007f5cf68e12a3 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib64/libQt5Core.so.5
#39 0x00007f5cf692e043 in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /usr/lib64/libQt5Core.so.5
#40 0x00007f5cf0c8b134 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#41 0x00007f5cf0c8b388 in ?? () from /usr/lib64/libglib-2.0.so.0
#42 0x00007f5cf0c8b42c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#43 0x00007f5cf692d88c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#44 0x00007f5cf68dd6ab in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/libQt5Core.so.5
#45 0x00007f5cf68e5344 in QCoreApplication::exec() () from /usr/lib64/libQt5Core.so.5
#46 0x00007f5cfab930fc in Akonadi::ResourceBase::init (r=0xf16040) at /home/KDE5/source/kde/pim/akonadi/src/agentbase/resourcebase.cpp:607
#47 0x000000000041e283 in Akonadi::ResourceBase::init<POP3Resource> (argc=3, argv=0x7ffd436d4d28) at /home/KDE5/include/KF5/AkonadiAgentBase/resourcebase.h:196
#48 0x0000000000419237 in main (argc=3, argv=0x7ffd436d4d28) at /home/KDE5/source/kde/kdepim-runtime/resources/pop3/pop3resource.cpp:1046
Comment 1 Albert Astals Cid 2017-04-16 10:07:36 UTC
This is a weird crash.

It means somehow your settings broke.

It's "good" it happens all the time, but i can't see how it would happen.

Looking at the code there's two places where seenUIDs and timeOfSeenUids get modified, POP3Resource::deleteJobResult and POP3Resource::saveSeenUIDList


In POP3Resource::saveSeenUIDList we do
  Q_ASSERT(seenUIDs.size() == timeOfSeenUIDs.size());
and then either
            seenUIDs.append(uid);
            timeOfSeenUIDs.append(time(nullptr));
or
                uidIt = seenUIDs.erase(uidIt);
                timeIt = timeOfSeenUIDs.erase(timeIt);
so the sizes should be the same always



In POP3Resource::deleteJobResult we do
    Q_ASSERT(seenUIDs.size() == timeOfSeenUids.size());
and then either
                seenUIDs.removeAt(index);
                timeOfSeenUids.removeAt(index);

So they "should" be as big always.

Can you have a look at your config file and see if how different seenUIDs and timeOfSeenUids are? Maybe we're hitting some limit in KConfig?
Comment 2 Martin Koller 2017-04-16 10:17:05 UTC
I checked the config file and found indeed that the two stored lists differed in length (one was 10, the other 9).

I manually removed these lists, restarted and the crash is gone.
I'll close this for now