ctl_cyrusdb buglet

Bron Gondwana brong at fastmail.fm
Sun Dec 30 07:38:36 EST 2007


I have much bigger fish to fry here, mailboxes.db corruptions again
indeed.  I've seen a couple of them over the past few days, with
behaviour that looks remarkably like it might be a Linux kernel bug
with mmap, seek and file ends.  Arrgh.

Anyway, here's a little minnow that got caught in the crossfire.
Don't bother reading on unless you want gory details of tracking
it down.  Patch is trivial and attached - opens the quota database
during ctl_cyrusdb just in case there are half-created mailboxes
that need deleting.

Bron.




root at test1:/work/cyrus-imapd-2.3.11# cyr storet1 dbtool show | grep '2 default'
fastmailtest.com!user.testuser.au29262  2 default testuser at fastmailtest.com     lrswipkxtecda   admin   lrswipkxtecda anyone      p
fastmailtest.com!user.testuser.oa29262  2 default testuser at fastmailtest.com     lrswipkxtecda   admin   lrswipkxtecda anyone      p


syslog:

Dec 30 06:33:40 test1 slott02/master[29941]: process started
Dec 30 06:33:40 test1 slott02/ctl_cyrusdb[29942]: recovering cyrus databases
Dec 30 06:33:40 test1 slott02/ctl_cyrusdb[29942]: skiplist: recovered /slot2/conf/mailboxes.db (1580 records, 237920 bytes) in 0 seconds
Dec 30 06:33:40 test1 slott02/ctl_cyrusdb[29942]: skiplist: recovered /slot2/conf/annotations.db (0 records, 144 bytes) in 0 seconds
Dec 30 06:33:40 test1 slott02/master[29941]: process 29942 exited, signaled to death by 11

(let's not talk about how the replica one has many more records than
this just yet - 2798 records, 462472 bytes)

Ok - so we get a signal 11 during ctl_cyrusdb:

(gdb) bt
#0  0x08076aab in fetch (db=0x0, key=0x81135c0 "fastmailtest.com!user.testuser", keylen=30, data=0xbfab7f48,
    datalen=0xbfab7f44, tid=0xbfab7f88) at cyrusdb_quotalegacy.c:447
#1  0x0805c23c in quota_read (quota=0xbfab8294, tid=0xbfab7f88, wrlock=1) at quota_db.c:88
#2  0x080600c0 in mailbox_delete (mailbox=0xbfab7fd4, delete_quota_root=0) at mailbox.c:2886
#3  0x08050a96 in mboxlist_deletemailbox (name=0xbfab833d "fastmailtest.com!user.testuser.as29265", isadmin=1, userid=0x0,
    auth_state=0x0, checkacl=0, local_only=0, force=1) at mboxlist.c:1141
#4  0x0804bef2 in fixmbox (name=0xbfab833d "fastmailtest.com!user.testuser.as29265", matchlen=38, maycreate=1, rock=0x0)
    at ctl_cyrusdb.c:138
#5  0x08053258 in find_cb (rockp=0xbfab89bc, key=0xb5f71d1c <Address 0xb5f71d1c out of bounds>, keylen=38,
    data=0xb5f71d48 <Address 0xb5f71d48 out of bounds>, datalen=79) at mboxlist.c:2152
#6  0x08075855 in myforeach (db=0x81134d0, prefix=0xbfab85e6 "*", prefixlen=0, goodp=0x804cbc0 <find_p>,
    cb=0x8053100 <find_cb>, rock=0xbfab89bc, tid=0x0) at cyrusdb_skiplist.c:998
#7  0x0804ec42 in mboxlist_findall (namespace=0x0, pattern=0xbfab8a46 "*", isadmin=1, userid=0x0, auth_state=0x0,
    proc=0x804be70 <fixmbox>, rock=0x0) at mboxlist.c:2344
#8  0x0804b7a1 in recover_reserved () at ctl_cyrusdb.c:166
#9  0x0804be3e in main (argc=1953718630, argv=0x6c69616d) at ctl_cyrusdb.c:339
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cyrus-ctlcyrusdb-quota-2.3.11.diff
Type: text/x-diff
Size: 930 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/cyrus-devel/attachments/20071230/0465963c/attachment.bin 


More information about the Cyrus-devel mailing list