Package: mutt Version: 1.5.11+cvs20060403-1 Severity: normal Tags: patch
Hi, When IMAP header cache is enabled, mutt sometimes segfaults when trying to open or close a mailbox. The segfault is repeatable and persists until the mailbox changes (either by starting mutt with the header cache disabled and deleting some messages, or by the delivery of a new message into the affected mailbox). I now did a debug build of mutt and got this: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1208592704 (LWP 3924)] 0x080e6885 in cmd_parse_fetch (idata=0x81e0fc0, s=0x81e1aba "4092 FETCH (FLAGS (\\Answered \\Deleted \\Seen) UID 9260 INTERNALDATE \" 9-May-2006 17:31:42 +0200\" RFC822.SIZE 6986 BODY[HEADER.FIELDS (DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-"...) at ../../imap/command.c:536 536 if (h->active && h->index+1 == msgno) (gdb) p *h Cannot access memory at address 0x0 (gdb) bt #0 0x080e6885 in cmd_parse_fetch (idata=0x81e0fc0, s=0x81e1aba "4092 FETCH (FLAGS (\\Answered \\Deleted \\Seen) UID 9260 INTERNALDATE \" 9-May-2006 17:31:42 +0200\" RFC822.SIZE 6986 BODY[HEADER.FIELDS (DATE FROM SUBJECT TO CC MESSAGE-ID REFERENCES CONTENT-TYPE CONTENT-"...) at ../../imap/command.c:536 #1 0x080e635d in cmd_handle_untagged (idata=0x81e0fc0) at ../../imap/command.c:415 #2 0x080e5aae in imap_cmd_step (idata=0x81e0fc0) at ../../imap/command.c:170 #3 0x080ec5c5 in imap_read_headers (idata=0x81e0fc0, msgbegin=4091, msgend=4099) at ../../imap/message.c:248 #4 0x080e8e2a in imap_open_mailbox (ctx=0x818b268) at ../../imap/imap.c:737 #5 0x08093630 in mx_open_mailbox (path=0xbf980300 "imap://foo.bar.com/INBOX.IN-foo", flags=0, pctx=0x0) at ../mx.c:718 #6 0x08068fa1 in mutt_index_menu () at ../curs_main.c:1154 #7 0x08087f6d in main (argc=1, argv=0xbf980f04) at ../main.c:966 (gdb) p *idata->ctx $1 = {path = 0x820b328 "imap://foo.bar.com/INBOX.IN-foo", fp = 0x0, mtime = 0, mtime_cur = 0, size = 0, vsize = 0, pattern = 0x0, limit_pattern = 0x0, hdrs = 0x8271938, last_tag = 0x0, tree = 0x0, id_hash = 0x0, subj_hash = 0x0, thread_hash = 0x0, v2r = 0x823e7a8, hdrmax = 4100, msgcount = 4097, vcount = 0, tagged = 0, new = 0, unread = 0, deleted = 0, flagged = 0, msgnotreadyet = -1, data = 0x81e0fc0, compressinfo = 0x0, realpath = 0x0, magic = 5, locked = 0, changed = 0, readonly = 0, dontwrite = 0, append = 0, quiet = 0, collapsed = 0, closing = 0} (gdb) p cur $2 = 4091 (gdb) The following patch makes the problem go away, but I'm not sure how correct it is (it may just hide some other bug): --- imap/command.c.orig 2006-04-04 05:56:39.000000000 +0200 +++ imap/command.c 2006-05-10 15:07:43.000000000 +0200 @@ -533,7 +533,7 @@ { h = idata->ctx->hdrs[cur]; - if (h->active && h->index+1 == msgno) + if (h && h->active && h->index+1 == msgno) { dprint (2, (debugfile, "Message UID %d updated\n", HEADER_DATA(h)->uid)); break; Gabor -- System Information: Debian Release: testing/unstable APT prefers unstable APT policy: (990, 'unstable'), (101, 'experimental') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.16libata Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Versions of packages mutt depends on: ii libc6 2.3.6-7 GNU C Library: Shared libraries ii libdb4.4 4.4.20-4 Berkeley v4.4 Database Libraries [ ii libgnutls12 1.2.9-2.1 the GNU TLS library - runtime libr ii libidn11 0.5.18-2 GNU libidn library, implementation ii libncursesw5 5.5-2 Shared libraries for terminal hand ii libsasl2 2.1.19.dfsg1-0.2 Authentication abstraction library ii postfix [mail-transport 2.2.10-1 A high-performance mail transport Versions of packages mutt recommends: ii locales 2.3.6-7 GNU C Library: National Language ( ii mime-support 3.36-1 MIME files 'mime.types' & 'mailcap -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]