Bug 262839 - imap ioslave crashes while fetching mail (backtrace included)
Summary: imap ioslave crashes while fetching mail (backtrace included)
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: imap (show other bugs)
Version: 4.5
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-11 10:23 UTC by Roy Dragseth
Modified: 2011-05-09 15:11 UTC (History)
0 users

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 Roy Dragseth 2011-01-11 10:23:22 UTC
Version:           1.13.5 (using KDE 4.5.4) 
OS:                Linux

the imap_ioslave sometimes crashes or just ignore mails in my inbox hosted on a courier imap server.  I was able to capture the following backtrace by attaching gdb to the imap ioslave, see the additional comments section.


o  I'm able to reproduce the same error on a clean user account so I do not think it is a personal config issue.  
o Evolution works fine against the same server so I do not think it is a server side issue either.
o Kmail works fine from my laptop, the only difference is that it runs 32bit Fedora, while this problem is on my desktop that runs 64bit Fedora (a clue?).



Please let me know if I can provide any further info.  (I've been using kmail for many years, but is forced over to evolution until this is fixed, arrgghhh, it is so cumbersome)

Best regards,
Roy.

Reproducible: Sometimes

Steps to Reproduce:
Connect to an imap server and load a folder.  

Actual Results:  
A message box appears telling me that the imap ioslave had terminated.

Sometimes the ioslave crash, other times it ignores mail and sometimes mails are listen with(No subject), Unknown sender and Unknown date.

Expected Results:  
Should get new mail.

OS: Linux (x86_64) release 2.6.35.10-74.fc14.x86_64
Compiler: gcc 4.5.1 20100924 (Red Hat 4.5.1-4)
kdepim-4.4.8-1.fc14.x86_64

Backtrace:

(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
IMAP4Protocol::get (this=0x27825d0, _url=<value optimized out>) at /usr/src/debug/kdepimlibs-4.5.4/kioslave/imap4/imap4.cpp:2653
2653    }
(gdb) bt
#0  IMAP4Protocol::get (this=0x27825d0, _url=<value optimized out>) at /usr/src/debug/kdepimlibs-4.5.4/kioslave/imap4/imap4.cpp:2653
#1  0x00000037109928a5 in KIO::SlaveBase::dispatch (this=0x27825d0, command=67, data=...) at /usr/src/debug/kdelibs-4.5.4/kio/kio/slavebase.cpp:1013
#2  0x00007fcde344e844 in IMAP4Protocol::dispatch (this=0x27825d0, command=67, data=...) at /usr/src/debug/kdepimlibs-4.5.4/kioslave/imap4/imap4.cpp:1828
#3  0x000000371098cbc3 in KIO::SlaveBase::dispatchLoop (this=0x27825d0) at /usr/src/debug/kdelibs-4.5.4/kio/kio/slavebase.cpp:282
#4  0x00007fcde344f558 in kdemain (argc=<value optimized out>, argv=<value optimized out>) at /usr/src/debug/kdepimlibs-4.5.4/kioslave/imap4/imap4.cpp:131
#5  0x0000000000406bf9 in launch (argc=4, _name=0x276aae8 "kio_imap4", args=<value optimized out>, cwd=0x0, envc=<value optimized out>, 
    envs=<value optimized out>, reset_env=false, tty=0x0, avoid_loops=false, startup_id_str=0x40ac76 "0") at /usr/src/debug/kdelibs-4.5.4/kinit/kinit.cpp:723
#6  0x00000000004077a0 in handle_launcher_request (sock=<value optimized out>, who=<value optimized out>)
    at /usr/src/debug/kdelibs-4.5.4/kinit/kinit.cpp:1215
#7  0x0000000000407ec5 in handle_requests (waitForPid=<value optimized out>) at /usr/src/debug/kdelibs-4.5.4/kinit/kinit.cpp:1408
#8  0x0000000000408b10 in main (argc=4, argv=0x7fff0c465f18, envp=0x7fff0c465f40) at /usr/src/debug/kdelibs-4.5.4/kinit/kinit.cpp:1892
(gdb)
Comment 1 Roy Dragseth 2011-01-17 10:23:13 UTC
Just wanted to report that the problem is exactly the same under kde 4.5.5:

(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
IMAP4Protocol::get (this=0x128f970, _url=<value optimized out>) at /usr/src/debug/kdepimlibs-4.5.5/kioslave/imap4/imap4.cpp:2653
2653    }
(gdb) bt
#0  IMAP4Protocol::get (this=0x128f970, _url=<value optimized out>) at /usr/src/debug/kdepimlibs-4.5.5/kioslave/imap4/imap4.cpp:2653
#1  0x00007f6fe74648a5 in KIO::SlaveBase::dispatch (this=0x128f970, command=67, data=...) at /usr/src/debug/kdelibs-4.5.5/kio/kio/slavebase.cpp:1013
#2  0x00007f6fe7c7f844 in IMAP4Protocol::dispatch (this=0x128f970, command=67, data=...) at /usr/src/debug/kdepimlibs-4.5.5/kioslave/imap4/imap4.cpp:1828
#3  0x00007f6fe745ebc3 in KIO::SlaveBase::dispatchLoop (this=0x128f970) at /usr/src/debug/kdelibs-4.5.5/kio/kio/slavebase.cpp:282
#4  0x00007f6fe7c80558 in kdemain (argc=<value optimized out>, argv=<value optimized out>) at /usr/src/debug/kdepimlibs-4.5.5/kioslave/imap4/imap4.cpp:131
#5  0x0000000000406bf9 in launch (argc=4, _name=0x1250a08 "kio_imap4", args=<value optimized out>, cwd=0x0, envc=<value optimized out>, 
    envs=<value optimized out>, reset_env=false, tty=0x0, avoid_loops=false, startup_id_str=0x40ac76 "0") at /usr/src/debug/kdelibs-4.5.5/kinit/kinit.cpp:723
#6  0x00000000004077a0 in handle_launcher_request (sock=<value optimized out>, who=<value optimized out>)
    at /usr/src/debug/kdelibs-4.5.5/kinit/kinit.cpp:1215
#7  0x0000000000407ec5 in handle_requests (waitForPid=<value optimized out>) at /usr/src/debug/kdelibs-4.5.5/kinit/kinit.cpp:1408
#8  0x0000000000408b10 in main (argc=4, argv=0x7fff43c76608, envp=0x7fff43c76630) at /usr/src/debug/kdelibs-4.5.5/kinit/kinit.cpp:1892
(gdb) list
2648        error(KIO::ERR_CANNOT_OPEN_FOR_WRITING, aBox);
2649        return false;
2650      }
2651
2652      return true;
2653    }
Comment 2 Roy Dragseth 2011-01-19 10:30:21 UTC
(I might be talking to myself here, but I'm just continuing to report progress in the hope for it to be useful for others)

To try to further debug the problem I hooked valgrind up on the imap ioslave to see if I could spot any memory leaks and suddenly the problem disappears!!!  The speed of getting email is painfully slow, but kmail is suddenly usable again...

To me this indicates that there is a race condition in the imap ioslave.  My office desktop sits more or less on the same gigabit LAN as the imap server so the speed of the communication is very high.  This might also explain why everything works fine from my laptop that I use to read email from my home network which has a much higher latency that the office LAN.

Hmm, running valgrind continuously on the ioslave seems to be a bit overkill. Should maybe write a wrapper that adds a millisecond or two to the network latency...
Comment 3 Roy Dragseth 2011-05-09 15:11:42 UTC
The bug seems to be gone now.  I'm currently running kmail 1.13.7 and can fetch my mail without the imap ioslave crashing any more.

Some update since my last report and now seems to have magically solved my problems.