<<< Date Index >>>     <<< Thread Index >>>

Re: [Mutt] #3359: mutt-1.5.20: segfault when entering an imap folder using db4 and hcache



#3359: mutt-1.5.20: segfault when entering an imap folder using db4 and hcache
--------------------------------------------------+-------------------------
  Reporter:  Pedro Fortuny <pfortuny@â>           |       Owner:  mutt-dev
      Type:  defect                               |      Status:  new     
  Priority:  major                                |   Milestone:          
 Component:  mutt                                 |     Version:          
Resolution:  fixed                                |    Keywords:          
--------------------------------------------------+-------------------------
Changes (by prlw1):

 * cc: prlw1@â (added)
  * status:  infoneeded_new => new


Comment:

 As in #3357 I am seeing IMAP communication trouble but am not using the
 header cache, which may put me in a minority, I just, for the first time
 compiled mutt with hcache and db4.1.25, and get a core dump on the very
 first start up:

 #0  0x080b5978 in hcache_open_db4 (h=0xbb71d4a0,
     path=0x80dc600
 "/home/prlw1/.mutt.cache/imap:prlw1@localhost/INBOX.hcache")
     at hcache.c:1063
 1063      h->env->close (h->env, 0);
 (gdb) bt
 #0  0x080b5978 in hcache_open_db4 (h=0xbb71d4a0,
     path=0x80dc600
 "/home/prlw1/.mutt.cache/imap:prlw1@localhost/INBOX.hcache")
     at hcache.c:1063
 #1  0x080b5539 in mutt_hcache_open (
     path=0x80dc600
 "/home/prlw1/.mutt.cache/imap:prlw1@localhost/INBOX.hcache",
 folder=0xbfbfca5c "imap:prlw1@localhost/INBOX",
     namer=0x80c0f00 <imap_hcache_namer>) at hcache.c:1135
 #2  0x080c1c76 in imap_hcache_open (idata=0xbb78a0c0, path=0xbb722e00
 "INBOX")
     at util.c:104
 #3  0x080ba4b0 in imap_mboxcache_get (idata=0xbb78a0c0,
     mbox=0xbb722e00 "INBOX", create=1) at imap.c:1628
 #4  0x080bcbaf in imap_open_mailbox (ctx=0xbb719680) at imap.c:638
 #5  0x08083dcb in mx_open_mailbox (path=0xbfbfe7f4 "imap://localhost/",
     flags=<value optimized out>, pctx=0x0) at mx.c:661
 #6  0x080792b5 in main (argc=Cannot access memory at address 0xd
 ) at main.c:1017
 (gdb) print *h
 $2 = {env = 0xbb770800, db = 0x0,
   folder = 0xbb7b9520 "imap:prlw1@localhost/INBOX", crc = 2257027612, fd =
 4,
   lockfile = "/home/prlw1/.mutt.cache/imap:prlw1@localhost/INBOX.hcache-
 lock-hack", '\0' <repeats 188 times>}
 (gdb) print *h->env
 $3 = {db_errfile = 0xdbdbdbdb,
   db_errpfx = 0xdbdbdbdb <Address 0xdbdbdbdb out of bounds>,
   db_errcall = 0xdbdbdbdb, db_feedback = 0xdbdbdbdb,
 ... more dbdbdb

 So h->db is NULL, and h->env doesn't seem to be initialised.

 This is from mercurial tip of just now, so

 changeset:   6074:889aa698cc49
 branch:      HEAD
 tag:         tip
 user:        Michael Elkins <me@xxxxxxxx>
 date:        Tue Apr 06 09:47:15 2010 -0700
 summary:     fix for compiling Mutt with clang: check for wchar_h prior to
 wctyp
 e_h in check for wc funcs

 was the last commit.

 [... time passes ...]

 Just rebuilt mutt so that ret isn't "optimized out", so the failure
 happens at

 (gdb) n
 1038      ret = (*h->env->open)(h->env, NULL, DB_INIT_MPOOL | DB_CREATE |
 DB_PRIVATE,
 (gdb) print ret
 $7 = 22
 (gdb) print *h
 $4 = {env = 0xbb770800, db = 0x0,
   folder = 0xbb7b9520 "imap:prlw1@localhost/INBOX", crc = 2257027612, fd =
 4,
   lockfile = "/home/prlw1/.mutt.cache/imap:prlw1@localhost/INBOX.hcache-
 lock-hack", '\0' <repeats 188 times>}
 (gdb) print h->env->open
 $8 = (int (*)(DB_ENV *, const char *, u_int32_t, int)) 0xdbdbdbdb

 That doesn't look very promising for a function address...

 Another run... after db_env_create()
 (gdb) print *h->env->open
 $14 = {int (DB_ENV *, const char *, u_int32_t,
     int)} 0xbb97ee20 <__dbenv_remove>                   <-- that doesn't
 look like open?
 after (*h->env->open)
 (gdb) print *h->env->open
 Cannot access memory at address 0xdbdbdbdb

-- 
Ticket URL: <http://dev.mutt.org/trac/ticket/3359#comment:6>
Mutt <http://www.mutt.org/>
The Mutt mail user agent