Bug 438275 - mutt (imap) hangs when quitting or changing folders with mutt_socket_write: ERROR: wrote 16384 of 99383 bytes
mutt (imap) hangs when quitting or changing folders with mutt_socket_write: E...
Product: Fedora
Classification: Fedora
Component: mutt (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Miroslav Lichvar
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-03-19 21:05 EDT by Chris Wright
Modified: 2008-04-04 19:08 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-04-04 08:08:55 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
snippet from .muttdebug0 (97.26 KB, text/plain)
2008-03-19 21:05 EDT, Chris Wright
no flags Details

  None (edit)
Description Chris Wright 2008-03-19 21:05:03 EDT
Description of problem:

When quitting or changing imap folders mutt hangs

Version-Release number of selected component (if applicable):
mutt-1.5.17-2 (actually mutt-1.5.17-2d, recompiled locally to add --enable-debug
to configure step so that mutt -d [level] works)

How reproducible:
every time

Steps to Reproduce:
1. start mutt w/ imap connection to large folder, for me that is simply:
$ mutt -d 2
2. quit or change folders
Actual results:

mutt hangs

Expected results:

mutt quits or changes imap folder

Additional info:

This seems to be related with folder size and imap command length.
The debug log ends like this (note I snipped short the UID STORE cmd)

IMAP queue drained
5> a0130 IDLE
5< + idling
mutt_socket_write: ERROR: wrote 16384 of 99383 bytes!
5< a0130 OK Idle completed.

and now mutt is hung (waiting to hear from imap server it appears):

recvfrom(5, "\317", 1, 0, NULL, NULL)   = 1
write(3, "5< a0130 OK Idle completed.\n", 28) = 28
gettimeofday({1205974328, 472287}, NULL) = 0
Comment 1 Chris Wright 2008-03-19 21:05:03 EDT
Created attachment 298615 [details]
snippet from .muttdebug0
Comment 2 Miroslav Lichvar 2008-03-20 08:34:26 EDT
I couldn't reproduce the problem. Which IMAP server is mutt connected to?

With dovecot, I'm getting for large folders "BAD Error in IMAP command UID: Too
long argument.", but it doesn't make mutt hang. When dovecot is configured to
allow larger imap commands, it works fine even with larger commands than the one
in your debug output.
Comment 3 Chris Wright 2008-03-20 14:01:41 EDT
mutt is connecting to dovecot.  i tried increasing cmd line size, but it doesn't

imap_max_line_length: 131072

any other info that would help?

Comment 4 Miroslav Lichvar 2008-04-03 12:09:00 EDT
Ok, I've managed to reproduce the problem with imaps. I was trying only imap before.
Comment 5 Miroslav Lichvar 2008-04-04 08:08:55 EDT
Should be fixed in mutt-1.5.17-4.fc9.
Comment 6 Chris Wright 2008-04-04 18:50:55 EDT
(gdb) bt
#0  0x00000037ff86c155 in __rep_get_limit () from /lib64/libdb-4.5.so
#1  0x0000000000481c7c in hcache_open_db4 (h=0x7a1270, 
"/home/chrisw/.mutt/cache/headers/imap:chrisw@sous-sol.org/INBOX.hcache") at
#2  0x0000000000480b46 in mutt_hcache_open (
    folder=0x21 <Address 0x21 out of bounds>, namer=0x48baf0
<imap_hcache_namer>) at hcache.c:1005
#3  0x000000000048ba58 in imap_hcache_open (idata=<value optimized out>,
path=<value optimized out>) at util.c:101
#4  0x00000000004850d7 in imap_mboxcache_get (idata=0x762da0, mbox=0x7880d0
"INBOX", create=1) at imap.c:1600
#5  0x00000000004878f1 in imap_open_mailbox (ctx=0x75e860) at imap.c:629
#6  0x000000000043f452 in mx_open_mailbox (path=0x7fffd4457730
"imap://sous-sol.org/", flags=0, pctx=0x7a1ae0)
    at mx.c:692
#7  0x0000000000435ca7 in main (argc=1, argv=0x7fffd4457958) at main.c:1002
#8  0x000000380061e074 in __libc_start_main () from /lib64/libc.so.6
#9  0x00000000004060c9 in _start ()
Comment 7 Chris Wright 2008-04-04 19:08:08 EDT
I built on a box with compat-db installed and it picked up libdb-4.5 first
(configure list has 4.5 before just -ldb).  Removed that and it's working well,
thanks for the fix.

Note You need to log in before you can comment on or make changes to this bug.