Bug 222878

Summary: kontact process does not exit after closing kontact window in every case
Product: [Applications] kontact Reporter: Alexander Stein <alexanders83>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: CONFIRMED ---    
Severity: normal CC: aheinecke, boris.bigott, claudio.barbiero, devel, dschridde+kde, eugene.shalygin+bugzilla.kde, info, james.ellis, jan_braun, johu, kaeslaek, kde-bugs-68795, kdenis, kensington, ksaugustin, Laurent.Rineau__kde, me, mephisto, mike.vaughn.83, piedro.kulman, talmage, till2.schaefer, upscope, vylu
Priority: NOR    
Version: 5.9.2   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: kill -11 of hanging kontact process without kdepim-runtime installed

Description Alexander Stein 2010-01-15 18:32:15 UTC
Version:            (using KDE 4.3.4)
Compiler:          gcc-Version 4.3.4 (Gentoo 4.3.4 p1.0, pie-10.1.5) 
OS:                Linux
Installed from:    Gentoo Packages

Sometimes when I use kontact and want to close it. The kontact process doesn't exit but the window isn't shown anymore. Thus i cannot restart kontact again before killing the process left.
Upon using kontact I usually use kmail, knode and akregator. Nothing special.
I attached via gdb to the left over process and this is it's backtrace:
#0  0x00007fe5d7992896 in poll () from /lib/libc.so.6
#1  0x00007fe5d38c43b9 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#2  0x00007fe5d38c468c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#3  0x00007fe5d8745c5f in QEventDispatcherGlib::processEvents (this=0x14e6b60, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:327
#4  0x00007fe5d955355f in QGuiEventDispatcherGlib::processEvents (this=0x3ac7be0, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:202
#5  0x00007fe5d871d882 in QEventLoop::processEvents (this=<value optimized out>, flags=...) at kernel/qeventloop.cpp:149
#6  0x00007fe5d871da1c in QEventLoop::exec (this=0x7fff65eadb50, flags=...) at kernel/qeventloop.cpp:197
#7  0x00007fe5d8722396 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:888
#8  0x000000000040405a in main (argc=1, argv=0x7fff65eae0f8) at /var/tmp/portage/kde-base/kontact-4.3.4/work/kontact-4.3.4/kontact/src/main.cpp:218
Comment 1 Vytautas 2010-01-27 10:06:08 UTC
Do you have IMAP accounts in kmail? 

I have the same behavior on debian unstable with kde 4.3.4. I guess, it may be related to bug https://bugs.kde.org/show_bug.cgi?id=186936, because kontact on my system leaves processes after exit only after connection loss.
Comment 2 Alexander Stein 2010-01-27 19:56:25 UTC
(In reply to comment #1)
> Do you have IMAP accounts in kmail? 
> 
> I have the same behavior on debian unstable with kde 4.3.4. I guess, it may be
> related to bug https://bugs.kde.org/show_bug.cgi?id=186936, because kontact on
> my system leaves processes after exit only after connection loss.

Yes, I'm using (2) IMAP accounts. But I can't stay whether I got connection losses or not.
Comment 3 Mike Vaughn 2010-01-31 15:54:42 UTC
I just wanted to chime in and say I've been experiencing this same problem for quite some time on Kubuntu, in both the 4.3 and new 4.4 branch. From what I can tell, it occurs even when there are no lost connections to my IMAP accounts (assuming there would be some error message informing me of such). It'd be great to see this fixed soon; Kontact is one of my favorite applications to show off to new users, but a bug like this presents quite a hurdle for most of them. :-\
Comment 4 KS Augustin 2010-03-23 11:00:07 UTC
Since everyone else is doing it, so shall I! Yep, having this problem on Mandriva 2010 with Kontact on KDE 4.3. It's a pain having to kill the process manually. I have IMAP accounts but no lost connections, no messages still in the queue. I make sure everything is clean before I shut down at the end of the day. This one is really bugging (heh) me.
Comment 5 jamese 2010-04-09 01:57:11 UTC
Me too, Kontact does not close sometimes on exit (Quit) either by selecting Quit from the File menu or right clicking the taskbar icon and selecting Quit.
There seem to be be heap of kio imap process lying around with kontact also in the process list.

I have all IMAP account + one localhost account.

Doing an strace on Kontact reveals it seems to be doing nothing:


$ strace -p6415
Process 6415 attached - interrupt to quit
restart_syscall(<... resuming interrupted call ...>) = 1
read(9, "x\0C\262<\1\0\0\2\0\300\7\1\0\0\0G\267\216\2F\267\216\2\210\310\331\277\0\253\242\210"..., 4096) = 64
read(9, 0x9db8150, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(9, 0x9db8150, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(9, 0x9db8150, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(9, 0x9db8150, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
clock_gettime(CLOCK_MONOTONIC, {42907, 466073884}) = 0
read(9, 0x9db8150, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=10, events=POLLIN}, {fd=9, events=POLLIN}, {fd=5, events=POLLIN}, {fd=12, events=POLLIN}, {fd=13, events=POLLIN}, {fd=71, events=POLLIN}, {fd=106, events=POLLIN}, {fd=41, events=POLLIN}], 9, 28315) = 1 ([{fd=9, revents=POLLIN}])
clock_gettime(CLOCK_MONOTONIC, {42907, 699954333}) = 0
read(9, "\34:C\262<\1\0\0\266\1\0\0001\270\216\2\0\0\0\0\254\310\331\277<\1\0\0\0\0\0@"..., 4096) = 64
read(9, 0x9db8150, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
read(9, 0x9db8150, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
clock_gettime(CLOCK_MONOTONIC, {42907, 700111406}) = 0
read(9, 0x9db8150, 4096)                = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=10, events=POLLIN}, {fd=9, events=POLLIN}, {fd=5, events=POLLIN}, {fd=12, events=POLLIN}, {fd=13, events=POLLIN}, {fd=71, events=POLLIN}, {fd=106, events=POLLIN}, {fd=41, events=POLLIN}], 9, 28081^C <unfinished ...>
Process 6415 detached


It's a royal pain, as to get things working again I have to kill the process or even kill -KILL the process. It's been going on for a few versions now as well.

Using Kubuntu KDE 4.4.2

Thanks!
Comment 6 jamese 2010-05-10 09:03:16 UTC
Any news on this bug? still happening in 4.4.3. It makes kontact nearly unusable, especially if you switch network connections & suspend/wake up a notebook a lot.
Anyone without knowledge of the killall command would give up.
Comment 7 Alessandro Rossini 2010-06-06 18:09:47 UTC
I can confirm the bug.

Version:           4.4.3 (using KDE 4.4.3)
OS:                GNU/Linux
Installed from:    Ubuntu Packages

Best regards.
Comment 8 jamese 2010-06-07 02:39:12 UTC
There is a similar bug reported in Bugzilla but I can't find it right now. One commenter suggested converting IMAP accounts to Disconnected IMAP.

I tried it and it reduces the possibility of Kontact hanging around after quitting (I had to remove my IMAP account and add new dIMAP accounts) but doesn't work so well if you have Gmail account over IMAP.. I don't really want to download my 6GB gmail account or whatever size it is now, which is why IMAP/Gmail is so cool.

If you're not connecting to Gmail over IMAP or have a small Gmail account, then try out Disconnected IMAP and see how it goes.
Comment 9 Peter Mühlenpfordt 2011-03-09 08:04:39 UTC
I can confirm this bug for Kubuntu 10.04 (but as I remember, it happens since Kubuntu switched to KDE 4).
The kontact process hangs any time my dsl router reconnects while kontact is running and I quit it after this reconnect. Before restarting kontact I have to kill the process.
My System: Kubuntu 10.04 / KDE 4.5.1 / Kontact 4.4.6 using IMAP.
Comment 10 Peter Mühlenpfordt 2011-03-09 08:09:06 UTC
*** This bug has been confirmed by popular vote. ***
Comment 11 Christophe Marin 2011-04-06 16:18:11 UTC
*** Bug 252840 has been marked as a duplicate of this bug. ***
Comment 12 David Talmage 2011-06-13 21:49:43 UTC
I experience this bug with Kubuntu 11.04 and Kontact 4.4.10.  I have four e-mail accounts open: POP3 to gmail, two IMAP accounts to my ISP, and one disconnected IMAP to a Kolab server on localhost.
Comment 13 Christophe Marin 2011-07-14 12:43:42 UTC
*** Bug 242308 has been marked as a duplicate of this bug. ***
Comment 14 Mike Vaughn 2011-07-14 14:13:09 UTC
Still happening (although *maybe* slightly less consistently) on KDE SC 4.6.5 with KDE-PIM/KMail 4.6.0.
Comment 15 Alexander Stein 2011-07-14 16:42:33 UTC
I still observed this running Kontact 4.6.1 now. But eventually I get a crash report. Seems to be related to KNode somehow.

Application: Kontact (kontact), signal: Segmentation fault
[Current thread is 1 (Thread 0x7f3dd9684760 (LWP 3862))]

Thread 2 (Thread 0x7f3dc3412700 (LWP 3863)):
#0  0x00007f3dd191c85c in pthread_cond_wait () from /lib64/libpthread.so.0
#1  0x00007f3dd5fa4eac in WTF::TCMalloc_PageHeap::scavengerThread() () from /usr/lib64/qt4/libQtWebKit.so.4
#2  0x00007f3dd5fa4ee9 in WTF::TCMalloc_PageHeap::runScavengerThread(void*) () from /usr/lib64/qt4/libQtWebKit.so.4
#3  0x00007f3dd1917dba in start_thread () from /lib64/libpthread.so.0
#4  0x00007f3dd6a9e02d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f3dd9684760 (LWP 3862)):
[KCrash Handler]
#6  parent (this=0x177c220) at ../../include/QtCore/../../src/corelib/kernel/qobject.h:250
#7  parentWidget (this=0x177c220) at ../../include/QtGui/../../src/gui/kernel/qwidget.h:1022
#8  QWidget::window (this=0x177c220) at kernel/qwidget.cpp:4255
#9  0x00007f3dba9a0fd4 in KNAccountManager::wallet () at /tmp/portage/kde-base/knode-4.6.1/work/knode-4.6.1/knode/knaccountmanager.cpp:250
#10 0x00007f3dba9a4d89 in KNServerInfo::readPassword (this=0x25f5a40) at /tmp/portage/kde-base/knode-4.6.1/work/knode-4.6.1/knode/knserverinfo.cpp:167
#11 0x00007f3dba9a58c8 in KNServerInfo::readConf (this=0x25f5a40, conf=...) at /tmp/portage/kde-base/knode-4.6.1/work/knode-4.6.1/knode/knserverinfo.cpp:66
#12 0x00007f3dba9a66f6 in KNNntpAccount::readInfo (this=0x25f5a10, confPath=...) at /tmp/portage/kde-base/knode-4.6.1/work/knode-4.6.1/knode/knnntpaccount.cpp:110
#13 0x00007f3dba9a2657 in KNAccountManager::loadAccounts (this=<value optimized out>) at /tmp/portage/kde-base/knode-4.6.1/work/knode-4.6.1/knode/knaccountmanager.cpp:73
#14 0x00007f3dba9a2a68 in KNAccountManager::KNAccountManager (this=0x203b440, gm=<value optimized out>, parent=<value optimized out>) at /tmp/portage/kde-base/knode-4.6.1/work/knode-4.6.1/knode/knaccountmanager.cpp:40
#15 0x00007f3dbaa24b8d in KNGlobals::accountManager (this=0x175c0b0) at /tmp/portage/kde-base/knode-4.6.1/work/knode-4.6.1/knode/knglobals.cpp:113
#16 0x00007f3dba9a7e44 in KNGroupManager::checkAll (this=0x133b4f0, id=1, silent=true) at /tmp/portage/kde-base/knode-4.6.1/work/knode-4.6.1/knode/kngroupmanager.cpp:587
#17 0x00007f3dba9a6448 in KNNntpAccountIntervalChecking::qt_metacall (this=0x1a83b20, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=<value optimized out>) at /tmp/portage/kde-base/knode-4.6.1/work/knode-4.6.1_build/knode/knnntpaccount.moc:73
#18 0x00007f3dd71e45ea in QMetaObject::activate (sender=0x14f1770, m=<value optimized out>, local_signal_index=<value optimized out>, argv=0x6) at kernel/qobject.cpp:3278
#19 0x00007f3dd71dc999 in QObject::event (this=0x14f1770, e=0x0) at kernel/qobject.cpp:1181
#20 0x00007f3dd7bcd2fc in QApplicationPrivate::notify_helper (this=0xead4d0, receiver=0x14f1770, e=0x7fffed2a36a0) at kernel/qapplication.cpp:4462
#21 0x00007f3dd7bd5627 in QApplication::notify (this=0x7fffed2a39f0, receiver=0x14f1770, e=0x7fffed2a36a0) at kernel/qapplication.cpp:4341
#22 0x00007f3dd89dc730 in KApplication::notify (this=0x7fffed2a39f0, receiver=0x14f1770, event=0x7fffed2a36a0) at /tmp/portage/kde-base/kdelibs-4.6.5/work/kdelibs-4.6.5/kdeui/kernel/kapplication.cpp:311
#23 0x00007f3dd71c9deb in QCoreApplication::notifyInternal (this=0x7fffed2a39f0, receiver=0x14f1770, event=0x7fffed2a36a0) at kernel/qcoreapplication.cpp:731
#24 0x00007f3dd71fcd1a in sendEvent (this=0xebb380) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#25 QTimerInfoList::activateTimers (this=0xebb380) at kernel/qeventdispatcher_unix.cpp:604
#26 0x00007f3dd71f9a34 in timerSourceDispatch (source=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:184
#27 0x00007f3dd13bdcf9 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#28 0x00007f3dd13c2238 in g_main_context_iterate () from /usr/lib64/libglib-2.0.so.0
#29 0x00007f3dd13c23de in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#30 0x00007f3dd71f971e in QEventDispatcherGlib::processEvents (this=0xeabcf0, flags=<value optimized out>) at kernel/qeventdispatcher_glib.cpp:422
#31 0x00007f3dd7c8bd46 in QGuiEventDispatcherGlib::processEvents (this=0x177c220, flags=<value optimized out>) at kernel/qguieventdispatcher_glib.cpp:204
#32 0x00007f3dd71c89f2 in QEventLoop::processEvents (this=<value optimized out>, flags=) at kernel/qeventloop.cpp:149
#33 0x00007f3dd71c8dbd in QEventLoop::exec (this=0x7fffed2a3960, flags=) at kernel/qeventloop.cpp:201
#34 0x00007f3dd71cb65b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1008
#35 0x0000000000403e6a in main (argc=<value optimized out>, argv=<value optimized out>) at /tmp/portage/kde-base/kontact-4.6.1/work/kontact-4.6.1/kontact/src/main.cpp:218
Comment 16 Andre Heinecke 2011-07-16 11:43:09 UTC
Created attachment 61916 [details]
kill -11 of hanging kontact process without kdepim-runtime installed
Comment 17 Andre Heinecke 2011-07-16 11:43:57 UTC
I do not know if this is related but i've accidentally started kontact without kdepim-runtime installed and then i could reproduce this behavior 100%
You start Kontact, close it and the process is still around.

I've killed it with -11 (sigsev) to get a backtrace but i do not find it paticluary useful maybe someone can see something from it so it's attached. In Comment #16
Comment 18 David Talmage 2011-07-16 12:19:55 UTC
This happens with kdepim-runtime installed, too.
Comment 19 Andre Heinecke 2011-07-17 10:56:58 UTC
*** Bug 276185 has been marked as a duplicate of this bug. ***
Comment 20 Dennis Schridde 2012-03-11 20:38:43 UTC
Still appears with Akonadi (akonadi-server-1.7.1) and Kontact / KDE 4.8.1.
Comment 21 Dennis Schridde 2013-08-20 23:46:46 UTC
Persists with 4.11.0, but it seems only on the first run it will get stuck without a visible window after closing it. When I kill it and then restart it, it can be closed without further problems.
Comment 22 Colin J Thomson 2013-12-04 21:15:45 UTC
I have started to see this since updating to 4.11.95/97 on Fedora 20
Comment 23 kaeslaek 2014-01-02 17:25:06 UTC
Same here on Fedora 20, using 2 IMAP accounts and 2 pop. Have to kill kontakt to start it again
Comment 24 Till Schäfer 2014-02-26 13:18:44 UTC
same here on gentoo with kde 4.12.2

i guess this is a kmail problem, because kmail shows the same symptoms on my system. 

i opened a gentoo bug before: https://bugs.gentoo.org/show_bug.cgi?id=498066

----
~ $ kmail --nofork
Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 14: reading configurations from ~/.fonts.conf is deprecated.
kmail2(8690) KDirWatch::removeDir: doesn't know "/home/till/.kde4/share/apps/messageviewer/themes/" 
kmail2(8690) KDirWatch::removeDir: doesn't know "/usr/share/apps/messageviewer/themes/" 
kmail2(8690): ""lastUpdate" - conversion of "-4713,1,1,0,0,0" to QDateTime failed" 
kmail2(8690): ""lastUpdate" - conversion of "-4713,1,1,0,0,0" to QDateTime failed" 
kmail2(8690)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
kmail2(8690)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:

^C
------

the last two lines are printed after quit. but nothing special pops up. is there a way to get more information?

this bug only affects one off my two machines. however i cant tell the difference. 

--------
strace after process quit:

$ strace -p 4119
Process 4119 attached
restart_syscall(<... resuming interrupted call ...>) = 0
recvfrom(7, 0x1b138b4, 4096, 0, 0, 0)   = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(7, 0x1b138b4, 4096, 0, 0, 0)   = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=7, events=POLLIN}, {fd=5, events=POLLIN}, {fd=12, events=POLLIN}, {fd=15, events=POLLIN}, {fd=16, events=POLLIN}, {fd=27, events=POLLIN}, {fd=22, events=POLLIN}], 9, 1708) = 0 (Timeout)
recvfrom(7, 0x1b138b4, 4096, 0, 0, 0)   = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(7, 0x1b138b4, 4096, 0, 0, 0)   = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=7, events=POLLIN}, {fd=5, events=POLLIN}, {fd=12, events=POLLIN}, {fd=15, events=POLLIN}, {fd=16, events=POLLIN}, {fd=27, events=POLLIN}, {fd=22, events=POLLIN}], 9, 59998) = 1 ([{fd=7, revents=POLLIN}])
recvfrom(7, "\v\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 4096, 0, NULL, NULL) = 32
recvfrom(7, 0x1b138b4, 4096, 0, 0, 0)   = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(7, 0x1b138b4, 4096, 0, 0, 0)   = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(7, 0x1b138b4, 4096, 0, 0, 0)   = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=7, events=POLLIN}, {fd=5, events=POLLIN}, {fd=12, events=POLLIN}, {fd=15, events=POLLIN}, {fd=16, events=POLLIN}, {fd=27, events=POLLIN}, {fd=22, events=POLLIN}], 9, 50960) = 1 ([{fd=7, revents=POLLIN}])
recvfrom(7, "\v\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096, 0, NULL, NULL) = 64
recvfrom(7, 0x1b138b4, 4096, 0, 0, 0)   = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(7, 0x1b138b4, 4096, 0, 0, 0)   = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(7, 0x1b138b4, 4096, 0, 0, 0)   = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=7, events=POLLIN}, {fd=5, events=POLLIN}, {fd=12, events=POLLIN}, {fd=15, events=POLLIN}, {fd=16, events=POLLIN}, {fd=27, events=POLLIN}, {fd=22, events=POLLIN}], 9, 50945) = 1 ([{fd=7, revents=POLLIN}])
recvfrom(7, "\34\0\317\243\234\0\0\0_\1\0\0\6`\273\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 4096, 0, NULL, NULL) = 32
recvfrom(7, "\34\0\317\243\234\0\0\0_\1\0\0\6`\273\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096, 0, NULL, NULL) = 64
recvfrom(7, 0x1b138b4, 4096, 0, 0, 0)   = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(7, 0x1b138b4, 4096, 0, 0, 0)   = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(7, 0x1b138b4, 4096, 0, 0, 0)   = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=7, events=POLLIN}, {fd=5, events=POLLIN}, {fd=12, events=POLLIN}, {fd=15, events=POLLIN}, {fd=16, events=POLLIN}, {fd=27, events=POLLIN}, {fd=22, events=POLLIN}], 9, 50945) = 1 ([{fd=7, revents=POLLIN}])
recvfrom(7, "\34\0\317\243\234\0\0\0\226\1\0\0\7`\273\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096, 0, NULL, NULL) = 64
recvfrom(7, 0x1b138b4, 4096, 0, 0, 0)   = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(7, 0x1b138b4, 4096, 0, 0, 0)   = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(7, 0x1b138b4, 4096, 0, 0, 0)   = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=8, events=POLLIN}, {fd=7, events=POLLIN}, {fd=5, events=POLLIN}, {fd=12, events=POLLIN}, {fd=15, events=POLLIN}, {fd=16, events=POLLIN}, {fd=27, events=POLLIN}, {fd=22, events=POLLIN}], 9, 50944) = 1 ([{fd=7, revents=POLLIN}])
recvfrom(7, "\34\0\317\243\234\0\0\0_\1\0\0\t`\273\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 4096, 0, NULL, NULL) = 32


-----------------
$ ps aux | grep kmail
schaefer  2577  1.3  0.4 2098080 75980 pts/4   Sl   15:07   0:01 kmail

$ ps -eda -o pid,ppid,blocked | grep -v 00000
  PID  PPID          BLOCKED
 1863     1 fffffffe7ffbfeff
 7418     1 fffffffe7ffbbef8
20849 19169 fffffffe7ffb9eff
26898 23398 fffffffe7ffb9eff

 $ ps aux | grep '1863\|7418\|20849\|26898\|23398\|19169'
root      1863  0.0  0.0  38628  1928 ?        Ss   Jan13   0:00 /sbin/udevd --daemon
schaefer  4566  0.0  0.0  12520  1000 pts/3    S+   15:11   0:00 grep --colour=auto 1863\|7418\|20849\|26898\|23398\|19169
root      7418  0.0  0.0  83496  3208 ?        S<s  03:10   0:01 /sbin/dmeventd
schaefer 19169  0.0  0.0  24668  2896 pts/2    Ss   11:59   0:00 /bin/bash
root     20849  0.0  0.0  47596  1604 pts/2    S    12:03   0:00 su -
schaefer 23398  0.0  0.0  24604  2976 pts/1    Ss   12:09   0:00 /bin/bash
root     26898  0.0  0.0  47596  1604 pts/1    S    12:18   0:00 su -
Comment 25 Till Schäfer 2014-02-26 13:20:16 UTC
@alexander stein or any admin: can you please adjust the version affected to 4.12.2
Comment 26 Eugene Shalygin 2014-03-10 16:59:32 UTC
Problem with KMail still exists in 4.12.80
Comment 27 piedro 2014-04-14 08:01:51 UTC
same here on arch and KDE 4.12.4 

p.
Comment 28 Eugene Shalygin 2014-04-14 08:59:04 UTC
The problem seems to be fixed in KDEPim 4.12.97/Akonadi server 1.12
Comment 29 piedro 2014-04-14 09:03:18 UTC
That sounds great, I am using Arch as mentioned, is it save to update yet?
Comment 30 Colin J Thomson 2014-04-14 16:33:39 UTC
Seems fixed now, 4.13 - Fedora20
Comment 31 Till Schäfer 2014-04-17 11:47:37 UTC
this is also fixed for me. no more "killall kontact" ;-)

gentoo linux + kmail 4.13.0 + akonadi server 1.12.1
Comment 32 Laurent RINEAU 2014-04-17 11:51:37 UTC
I use 4.13 - Fedora20, and I still have the DrKonqi popup, about a crash of Kontact, when I quit my KDE session. I do not know if that is the same bug. The issue is that, when I quit the session, the DrKonqi is killed before I have time to get the stack trace and fill a bug report. Do you see a way to debug my issue?
Comment 33 Alexander Stein 2014-04-30 20:25:25 UTC
Unfortunately this hasn't gone yet :(
Here I have the backtraces of all this existing threads of kontact after closing it:
(gdb) info threads
  Id   Target Id         Frame 
  4    Thread 0x7f4f92048700 (LWP 12365) "kontact" 0x00007f4fa1583fdc in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
  3    Thread 0x7f4f91747700 (LWP 12370) "QThread" 0x00007f4fa6d6213d in poll () from /lib64/libc.so.6
  2    Thread 0x7f4f42601700 (LWP 22120) "QInotifyFileSys" 0x00007f4fa6d6213d in poll () from /lib64/libc.so.6
* 1    Thread 0x7f4fa99db780 (LWP 11840) "kontact" 0x00007f4fa6d6213d in poll () from /lib64/libc.so.6
(gdb) bt
#0  0x00007f4fa6d6213d in poll () from /lib64/libc.so.6
#1  0x00007f4fa05366bc in g_main_context_poll (n_fds=11, fds=0x56d72d0, timeout=15012, context=0x22430b0, priority=<optimized out>) at /var/tmp/portage/dev-libs/glib-2.38.2-r1/work/glib-2.38.2/glib/gmain.c:4007
#2  g_main_context_iterate (context=context@entry=0x22430b0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at /var/tmp/portage/dev-libs/glib-2.38.2-r1/work/glib-2.38.2/glib/gmain.c:3708
#3  0x00007f4fa05367ec in g_main_context_iteration (context=0x22430b0, may_block=1) at /var/tmp/portage/dev-libs/glib-2.38.2-r1/work/glib-2.38.2/glib/gmain.c:3774
#4  0x00007f4fa828e10e in QEventDispatcherGlib::processEvents (this=0x223e680, flags=...) at kernel/qeventdispatcher_glib.cpp:427
#5  0x00007f4fa75c5126 in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#6  0x00007f4fa825ba2f in QEventLoop::processEvents (this=this@entry=0x7fff27fd22c0, flags=...) at kernel/qeventloop.cpp:149
#7  0x00007f4fa825bd0d in QEventLoop::exec (this=this@entry=0x7fff27fd22c0, flags=...) at kernel/qeventloop.cpp:204
#8  0x00007f4fa8261d2b in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1221
#9  0x00007f4fa75158bc in QApplication::exec () at kernel/qapplication.cpp:3823
#10 0x00000000004039d9 in main (argc=3, argv=0x7fff27fd25a8) at /var/tmp/portage/kde-base/kontact-4.13.0/work/kontact-4.13.0/kontact/src/main.cpp:219
(gdb) thread 2
[Switching to thread 2 (Thread 0x7f4f42601700 (LWP 22120))]
#0  0x00007f4fa6d6213d in poll () from /lib64/libc.so.6
(gdb) bt
#0  0x00007f4fa6d6213d in poll () from /lib64/libc.so.6
#1  0x00007f4fa05366bc in g_main_context_poll (n_fds=2, fds=0x7f4f3c0029b0, timeout=-1, context=0x7f4f3c0009a0, priority=<optimized out>)
    at /var/tmp/portage/dev-libs/glib-2.38.2-r1/work/glib-2.38.2/glib/gmain.c:4007
#2  g_main_context_iterate (context=context@entry=0x7f4f3c0009a0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at /var/tmp/portage/dev-libs/glib-2.38.2-r1/work/glib-2.38.2/glib/gmain.c:3708
#3  0x00007f4fa05367ec in g_main_context_iteration (context=0x7f4f3c0009a0, may_block=1) at /var/tmp/portage/dev-libs/glib-2.38.2-r1/work/glib-2.38.2/glib/gmain.c:3774
#4  0x00007f4fa828e10e in QEventDispatcherGlib::processEvents (this=0x7f4f3c0008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:427
#5  0x00007f4fa825ba2f in QEventLoop::processEvents (this=this@entry=0x7f4f42600e20, flags=...) at kernel/qeventloop.cpp:149
#6  0x00007f4fa825bd0d in QEventLoop::exec (this=this@entry=0x7f4f42600e20, flags=...) at kernel/qeventloop.cpp:204
#7  0x00007f4fa8149f96 in QThread::exec (this=this@entry=0x2d8d280) at thread/qthread.cpp:536
#8  0x00007f4fa823b1f8 in QInotifyFileSystemWatcherEngine::run (this=0x2d8d280) at io/qfilesystemwatcher_inotify.cpp:256
#9  0x00007f4fa814c4dc in QThreadPrivate::start (arg=0x2d8d280) at thread/qthread_unix.cpp:338
#10 0x00007f4fa1580033 in start_thread () from /lib64/libpthread.so.0
#11 0x00007f4fa6d6bf0d in clone () from /lib64/libc.so.6
(gdb) thread 3
[Switching to thread 3 (Thread 0x7f4f91747700 (LWP 12370))]
#0  0x00007f4fa6d6213d in poll () from /lib64/libc.so.6
(gdb) bt
#0  0x00007f4fa6d6213d in poll () from /lib64/libc.so.6
#1  0x00007f4fa05366bc in g_main_context_poll (n_fds=1, fds=0x7f4f8c0029c0, timeout=-1, context=0x7f4f8c0009a0, priority=<optimized out>)
    at /var/tmp/portage/dev-libs/glib-2.38.2-r1/work/glib-2.38.2/glib/gmain.c:4007
#2  g_main_context_iterate (context=context@entry=0x7f4f8c0009a0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at /var/tmp/portage/dev-libs/glib-2.38.2-r1/work/glib-2.38.2/glib/gmain.c:3708
#3  0x00007f4fa05367ec in g_main_context_iteration (context=0x7f4f8c0009a0, may_block=1) at /var/tmp/portage/dev-libs/glib-2.38.2-r1/work/glib-2.38.2/glib/gmain.c:3774
#4  0x00007f4fa828e0e3 in QEventDispatcherGlib::processEvents (this=0x7f4f8c0008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:425
#5  0x00007f4fa825ba2f in QEventLoop::processEvents (this=this@entry=0x7f4f91746e60, flags=...) at kernel/qeventloop.cpp:149
#6  0x00007f4fa825bd0d in QEventLoop::exec (this=this@entry=0x7f4f91746e60, flags=...) at kernel/qeventloop.cpp:204
#7  0x00007f4fa8149f96 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:536
#8  0x00007f4fa814c4dc in QThreadPrivate::start (arg=0x2464b70) at thread/qthread_unix.cpp:338
#9  0x00007f4fa1580033 in start_thread () from /lib64/libpthread.so.0
#10 0x00007f4fa6d6bf0d in clone () from /lib64/libc.so.6
(gdb) thread 4
[Switching to thread 4 (Thread 0x7f4f92048700 (LWP 12365))]
#0  0x00007f4fa1583fdc in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
(gdb) bt
#0  0x00007f4fa1583fdc in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f4fa45aa167 in ?? () from /usr/lib64/qt4/libQtWebKit.so.4
#2  0x00007f4fa45aa1a9 in ?? () from /usr/lib64/qt4/libQtWebKit.so.4
#3  0x00007f4fa1580033 in start_thread () from /lib64/libpthread.so.0
#4  0x00007f4fa6d6bf0d in clone () from /lib64/libc.so.6
(gdb) info thread
  Id   Target Id         Frame 
* 4    Thread 0x7f4f92048700 (LWP 12365) "kontact" 0x00007f4fa1583fdc in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
  3    Thread 0x7f4f91747700 (LWP 12370) "QThread" 0x00007f4fa6d6213d in poll () from /lib64/libc.so.6
  2    Thread 0x7f4f42601700 (LWP 22120) "QInotifyFileSys" 0x00007f4fa6d6213d in poll () from /lib64/libc.so.6
  1    Thread 0x7f4fa99db780 (LWP 11840) "kontact" 0x00007f4fa6d6213d in poll () from /lib64/libc.so.6
Comment 34 Denis Kurz 2016-09-24 19:19:05 UTC
This bug has only been reported for versions before 4.14, which have been unsupported for at least two years now. Can anyone tell if this bug still present?

If noone confirms this bug for a Framework-based version of kontact (version 5.0 or later, as part of KDE Applications 15.08 or later), it gets closed in about three months.
Comment 35 Till Schäfer 2016-09-25 17:12:00 UTC
still valid for 5.3.1
Comment 36 Denis Kurz 2016-09-27 06:32:36 UTC
I run into this at least once per day, too. PIM 5.3.1, Framworks 5.26. Backtrace of zombie kontact:

[New LWP 16622]
[New LWP 16583]
[New LWP 16580]
[New LWP 16573]
[New LWP 16559]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
0x0000003344e0868d in pthread_join (threadid=139922306430720, thread_return=0x0) at pthread_join.c:90
90      pthread_join.c: Datei oder Verzeichnis nicht gefunden.

Thread 6 (Thread 0x7f423c4f8700 (LWP 16559)):
#0  0x00000033446e046d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x000000384580c8f2 in poll (__timeout=-1, __nfds=1, __fds=0x7f423c4f7d00) at /usr/include/bits/poll2.h:46
#2  _xcb_conn_wait (c=c@entry=0x1f61840, cond=cond@entry=0x1f61880, vector=vector@entry=0x0, count=count@entry=0x0) at /var/tmp/portage/x11-libs/libxcb-1.12/work/libxcb-1.12/src/xcb_conn.c:479
#3  0x000000384580e6df in xcb_wait_for_event (c=0x1f61840) at /var/tmp/portage/x11-libs/libxcb-1.12/work/libxcb-1.12/src/xcb_in.c:693
#4  0x00007f423d789009 in QXcbEventReader::run (this=0x1f6bef0) at qxcbconnection.cpp:1325
#5  0x0000003402ea8cfc in QThreadPrivate::start (arg=0x1f6bef0) at thread/qthread_unix.cpp:341
#6  0x0000003344e07444 in start_thread (arg=0x7f423c4f8700) at pthread_create.c:334
#7  0x00000033446e94cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 5 (Thread 0x7f423917b700 (LWP 16573)):
#0  0x00000033446e046d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x0000003346649f1c in g_main_context_poll (priority=2147483647, n_fds=2, fds=0x7f422c003020, timeout=-1, context=0x7f422c000990) at /var/tmp/portage/dev-libs/glib-2.46.2-r3/work/glib-2.46.2/glib/gmain.c:4135
#2  g_main_context_iterate (context=context@entry=0x7f422c000990, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at /var/tmp/portage/dev-libs/glib-2.46.2-r3/work/glib-2.46.2/glib/gmain.c:3835
#3  0x000000334664a02c in g_main_context_iteration (context=0x7f422c000990, may_block=1) at /var/tmp/portage/dev-libs/glib-2.46.2-r3/work/glib-2.46.2/glib/gmain.c:3901
#4  0x0000003403099b07 in QEventDispatcherGlib::processEvents (this=0x7f422c0008c0, flags=...) at kernel/qeventdispatcher_glib.cpp:417
#5  0x000000340304b88a in QEventLoop::exec (this=this@entry=0x7f423917add0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#6  0x0000003402ea4544 in QThread::exec (this=this@entry=0x3404282240 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread.cpp:500
#7  0x0000003404215235 in QDBusConnectionManager::run (this=0x3404282240 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at qdbusconnection.cpp:189
#8  0x0000003402ea8cfc in QThreadPrivate::start (arg=0x3404282240 <(anonymous namespace)::Q_QGS__q_manager::innerFunction()::holder>) at thread/qthread_unix.cpp:341
#9  0x0000003344e07444 in start_thread (arg=0x7f423917b700) at pthread_create.c:334
#10 0x00000033446e94cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 4 (Thread 0x7f42335ef700 (LWP 16580)):
#0  0x00000033446e046d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x0000003572895e5a in content::SandboxIPCHandler::Run() () from /usr/lib64/libQt5WebEngineCore.so.5
#2  0x000000357307d61e in base::DelegateSimpleThread::Run() () from /usr/lib64/libQt5WebEngineCore.so.5
#3  0x000000357307d730 in base::SimpleThread::ThreadMain() () from /usr/lib64/libQt5WebEngineCore.so.5
#4  0x000000357307a38f in base::(anonymous namespace)::ThreadFunc(void*) () from /usr/lib64/libQt5WebEngineCore.so.5
#5  0x0000003344e07444 in start_thread (arg=0x7f42335ef700) at pthread_create.c:334
#6  0x00000033446e94cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 3 (Thread 0x7f42323e1700 (LWP 16583)):
#0  0x00000033446e2163 in select () at ../sysdeps/unix/syscall-template.S:84
#1  0x0000003573042894 in base::(anonymous namespace)::InotifyReaderCallback(base::(anonymous namespace)::InotifyReader*, int, int) () from /usr/lib64/libQt5WebEngineCore.so.5
#2  0x00000035730a36b1 in base::debug::TaskAnnotator::RunTask(char const*, char const*, base::PendingTask const&) () from /usr/lib64/libQt5WebEngineCore.so.5
#3  0x00000035730523d1 in base::MessageLoop::RunTask(base::PendingTask const&) () from /usr/lib64/libQt5WebEngineCore.so.5
#4  0x00000035730526b1 in base::MessageLoop::DeferOrRunPendingTask(base::PendingTask const&) () from /usr/lib64/libQt5WebEngineCore.so.5
#5  0x00000035730530ab in base::MessageLoop::DoWork() () from /usr/lib64/libQt5WebEngineCore.so.5
#6  0x0000003573055579 in base::MessagePumpDefault::Run(base::MessagePump::Delegate*) () from /usr/lib64/libQt5WebEngineCore.so.5
#7  0x0000003573065df8 in base::RunLoop::Run() () from /usr/lib64/libQt5WebEngineCore.so.5
#8  0x0000003573051895 in base::MessageLoop::Run() () from /usr/lib64/libQt5WebEngineCore.so.5
#9  0x000000357307dabd in base::Thread::ThreadMain() () from /usr/lib64/libQt5WebEngineCore.so.5
#10 0x000000357307a38f in base::(anonymous namespace)::ThreadFunc(void*) () from /usr/lib64/libQt5WebEngineCore.so.5
#11 0x0000003344e07444 in start_thread (arg=0x7f42323e1700) at pthread_create.c:334
#12 0x00000033446e94cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 2 (Thread 0x7f41f97fa700 (LWP 16622)):
#0  pthread_cond_wait () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x0000003410b7ca04 in QTWTF::TCMalloc_PageHeap::scavengerThread (this=0x3410c6ae40 <QTWTF::pageheap_memory>) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:2359
#2  0x0000003410b7ca49 in QTWTF::TCMalloc_PageHeap::runScavengerThread (context=<optimized out>) at ../3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.cpp:1464
#3  0x0000003344e07444 in start_thread (arg=0x7f41f97fa700) at pthread_create.c:334
#4  0x00000033446e94cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7f423dc4b7c0 (LWP 16538)):
#0  0x0000003344e0868d in pthread_join (threadid=139922306430720, thread_return=0x0) at pthread_join.c:90
#1  0x000000357307a23f in base::PlatformThread::Join(base::PlatformThreadHandle) () from /usr/lib64/libQt5WebEngineCore.so.5
#2  0x000000357307d681 in base::SimpleThread::Join() () from /usr/lib64/libQt5WebEngineCore.so.5
#3  0x000000357289462c in content::RenderSandboxHostLinux::~RenderSandboxHostLinux() () from /usr/lib64/libQt5WebEngineCore.so.5
#4  0x00000035728946e5 in Singleton<content::RenderSandboxHostLinux, DefaultSingletonTraits<content::RenderSandboxHostLinux>, content::RenderSandboxHostLinux>::OnExit(void*) () from /usr/lib64/libQt5WebEngineCore.so.5
#5  0x0000003573035139 in base::AtExitManager::ProcessCallbacksNow() () from /usr/lib64/libQt5WebEngineCore.so.5
#6  0x00000035730351e4 in base::AtExitManager::~AtExitManager() () from /usr/lib64/libQt5WebEngineCore.so.5
#7  0x0000003572ba8c1f in content::ContentMainRunnerImpl::~ContentMainRunnerImpl() () from /usr/lib64/libQt5WebEngineCore.so.5
#8  0x0000003571bf765f in WebEngineContext::~WebEngineContext() () from /usr/lib64/libQt5WebEngineCore.so.5
#9  0x0000003571bf7711 in (anonymous namespace)::destroyContext() () from /usr/lib64/libQt5WebEngineCore.so.5
#10 0x000000340304c3c8 in qt_call_post_routines () at kernel/qcoreapplication.cpp:298
#11 0x000000384d159b26 in QApplication::~QApplication (this=0x7fff80ffc020, __in_chrg=<optimized out>) at kernel/qapplication.cpp:825
#12 0x00000000004045b6 in KontactApp::~KontactApp (this=0x7fff80ffc020, __in_chrg=<optimized out>) at /var/tmp/portage/kde-apps/kontact-16.08.1/work/kdepim-16.08.1/kontact/src/main.cpp:61
#13 main (argc=1, argv=0x7fff80ffc178) at /var/tmp/portage/kde-apps/kontact-16.08.1/work/kdepim-16.08.1/kontact/src/main.cpp:226
Comment 37 Jan-Matthias Braun 2017-01-09 08:32:58 UTC
And another (rather short) one for kontact 16.12.0

(gdb) bt
#0  0x00007f15af07199d in poll () from /lib64/libc.so.6
#1  0x00007f15a8041266 in g_main_context_iterate.isra.42.lto_priv () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f15a7fc8a3c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f15acd8e7af in QEventDispatcherGlib::processEvents (this=0x1236fd0, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#4  0x00007f15acd3a7ba in QEventLoop::exec (this=this@entry=0x7fffa171af30, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#5  0x00007f15acd42bfd in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1261
#6  0x0000000000404203 in main (argc=<optimized out>, argv=<optimized out>) at /var/tmp/portage/kde-apps/kontact-16.12.0/work/kontact-16.12.0/src/main.cpp:227

Cheers,

Jan
Comment 38 Frank van Zuetphen 2018-01-05 10:59:00 UTC
Yes, this bug is still present.


Debian 8
kontact 4.14.1
akonadi-server 1.13.0

Cheers,

Frank
Comment 39 Till Schäfer 2018-10-31 18:15:48 UTC
still valid on 5.9.2 with frameworks 5.51.0 and qt 5.11.2

in the meanwhile for everybody frustrated to type killall kontact every few hours: here is a script to detect and kill hanging kmail instances. I have just added it to my kontact.desktop file, such that kontact just starts and does not wait for the hanging instance. 


#!/bin/bash

pid=$(pidof kontact)

if [[ $pid != "" ]]; then 
        echo "Running KMail instance found: $pid"
        windowsofpid=$(xdotool search --pid $pid)
        if [[ $windowsofpid == "" ]]; then
                echo "Hanging KMail instance found. Killing..."
                kdialog --passivepopup "Hanging KMail instance found: $pid. Killing ..." 5 --title "Kill Hanging Kontact Script"
                kill $pid
        fi
fi
Comment 40 Boris Bigott 2019-02-26 20:44:39 UTC
Still happens with kontact 5.10.2 using kde frameworks 5.55.0.