Bug 163695 - kio_sieve eats up 100% CPU when closing kmail
Summary: kio_sieve eats up 100% CPU when closing kmail
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-10 12:06 UTC by Johannes Köster
Modified: 2008-06-16 00:00 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
proposed patch (513 bytes, patch)
2008-06-15 23:49 UTC, Frank Osterfeld
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Köster 2008-06-10 12:06:11 UTC
Version:           SVN (using Devel)
Installed from:    Compiled sources
Compiler:          gcc 4.1.2-Gentoo 
OS:                Linux

I use kmail with imap4 and tls. When I close kmail, the kio_sieve process goes immediately at 100% CPU-Usage and stays there. killing with SIGTERM is not possible, but of course killing with SIGKILL works.
Comment 1 Johannes Köster 2008-06-10 12:07:52 UTC
I should add, that it happens regardless of authentication method.
Comment 2 Frank Osterfeld 2008-06-15 23:38:48 UTC
Seem backtrace below: It busy-loops in operationSuccessful(), which calls receiveData() forever in a while loop, which calls readLine which returns -1 all the time.
The return value isn't checked in receivedData() and true is returned.
Testing a fix now.

#0  KIO::TCPSlaveBase::readLine (this=0xbfffedbc, data=0xbfffe9cf "", len=511) at /source/kde/trunk/KDE/kdelibs/kio/kio/tcpslavebase.cpp:234
#1  0x03fd7ae7 in kio_sieveProtocol::receiveData (this=0xbfffedbc, waitForData=true, reparse=@0xbfffec6c) at /source/workspace/kdepimlibs-enterprise4/kioslave/sieve/sieve.cpp:1113
#2  0x03fd78d7 in kio_sieveProtocol::operationSuccessful (this=0xbfffedbc) at /source/workspace/kdepimlibs-enterprise4/kioslave/sieve/sieve.cpp:1189
#3  0x03fd7980 in kio_sieveProtocol::disconnect (this=0xbfffedbc, forcibly=false) at /source/workspace/kdepimlibs-enterprise4/kioslave/sieve/sieve.cpp:383
#4  0x03fd830b in kio_sieveProtocol::closeConnection (this=0xbfffedbc) at /source/workspace/kdepimlibs-enterprise4/kioslave/sieve/sieve.cpp:374
#5  0x005b0395 in KIO::SlaveBase::dispatchLoop (this=0xbfffedbc) at /source/kde/trunk/KDE/kdelibs/kio/kio/slavebase.cpp:292
#6  0x03fd91d0 in kdemain (argc=4, argv=0x40225d0) at /source/workspace/kdepimlibs-enterprise4/kioslave/sieve/sieve.cpp:81
#7  0x0000c7bb in launch (argc=4, _name=0x4016164 "kio_sieve", args=0x4016235 "", cwd=0x0, envc=0, envs=0x4016239 "", reset_env=false, tty=0x0, avoid_loops=false, startup_id_str=0x10fdc "0") at /source/kde/trunk/KDE/kdelibs/kinit/kinit.cpp:674
#8  0x0000d399 in handle_launcher_request (sock=6) at /source/kde/trunk/KDE/kdelibs/kinit/kinit.cpp:1235
#9  0x0000dc31 in handle_requests (waitForPid=0) at /source/kde/trunk/KDE/kdelibs/kinit/kinit.cpp:1424
#10 0x0000e4ee in main (argc=3, argv=0xbffff4cc, envp=0xbffff4dc) at /source/kde/trunk/KDE/kdelibs/kinit/kinit.cpp:1882
Comment 3 Frank Osterfeld 2008-06-15 23:49:00 UTC
Created attachment 25368 [details]
proposed patch
Comment 4 Frank Osterfeld 2008-06-16 00:00:53 UTC
SVN commit 820965 by osterfeld:

Check readLine's return value and return false on error, thus do not busy-wait forever when shutting down kio_sieve instances

BUG:163695

 M  +3 -1      sieve.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=820965