Re: segfault: d5ab883ef90a breaks header cache
On 03-04-2007 09:46:13 +0200, Thomas Roessler wrote:
> d5ab883ef90a reproducibly leads to segmentation faults in either
> line 999 or 1002 of hcache.c. At that point, h->db is a NULL
> pointer which is dereferenced.
>
> Backing out d5ab883ef90a cures that.
I reverse-patched that particular patch, and on amd64 linux it seems to
work fine, while on Solaris 10 it crashes the hard way. I think I saw
the same on Darwin, but I can't test that now. All use the same
features: berkdb, imap, mbox, nls, smtp, ssl.
When running on Solaris with /var/tmp/.muttcache.hcc not existing:
Selecting INBOX...
Program received signal SIGSEGV, Segmentation fault.
0x080cf2de in mutt_hcache_open (path=0x8104d88 "/var/tmp/.muttcache.hcc",
folder=0x8045c08 "imaps://fabian@imap/INBOX")
at hcache.c:1003
1003 hcache.c: No such file or directory.
in hcache.c
(gdb) l
998 in hcache.c
(gdb) bt
#0 0x080cf2de in mutt_hcache_open (path=0x8104d88 "/var/tmp/.muttcache.hcc",
folder=0x8045c08 "imaps://fabian@imap/INBOX")
at hcache.c:1003
#1 0x080e026d in imap_mboxcache_get (idata=0x8133338, mbox=0x81350c8 "INBOX",
create=1) at imap.c:1611
#2 0x080de01d in imap_open_mailbox (ctx=0x812ffa8) at imap.c:635
#3 0x0808e6cf in mx_open_mailbox (
path=0x8047159 "imaps://fabian@imap/INBOX", flags=0,
pctx=0x0) at mx.c:697
#4 0x080838d3 in main (argc=1, argv=0x80472e4) at main.c:962
(gdb) p h
$1 = (struct header_cache *) 0x814e2e0
(gdb) p h->db
$2 = (DB *) 0x0
(gdb)
code fragment: (1000-1004)
if (stat(path, &sb) != 0 && errno == ENOENT)
{
createflags |= DB_EXCL;
h->db->set_pagesize(h->db, pagesize);
}
% uname -a
SunOS ra 5.10 Generic_118855-33 i86pc i386 i86pc Solaris
--
Fabian Groffen
Gentoo on a different level