Re: Another cache bug!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Feb 08, 2009 at 09:01:47PM -0400, Patrick Boutilier wrote:
> Feb  8 13:33:59 student2 cyr_expire[29242]: IOERROR: reading cache  
> record for user.wooddm: got bogus offset 0 for 68/3; try reconstruct
> Feb  8 13:33:59 student2 cyr_expire[29242]: failure expiring  
> user.wooddm: System I/O error

OK - so apart from the "you need to reconstruct" bit, this message
actually sucks.

The attached patch will make things much more useful! (but the core
message of "things are messed up in those there index files, just
reconstruct the sucker already) is the same.

Bron ( going to commit this to CVS too )
diff --git a/imap/mailbox.c b/imap/mailbox.c
index fc1b9ca..1e28b1a 100644
--- a/imap/mailbox.c
+++ b/imap/mailbox.c
@@ -1938,7 +1938,7 @@ static int process_records(struct mailbox *mailbox, FILE *newindex,
     time_t now = time(NULL);
     unsigned n;
 
-    /* Copy over records for nondeleted messages */
+    /* Copy over records for all messages */
     for (msgno = 1; msgno <= exists; msgno++) {
 	/* Copy index record for this message */
 	memcpy(buf,
@@ -2007,10 +2007,11 @@ static int process_records(struct mailbox *mailbox, FILE *newindex,
             if (cache_offset >= mailbox->cache_size) {
 		syslog(LOG_ERR,
 		       "IOERROR: reading cache record for %s:"
-		       " got bogus offset %d for %u/%lu; try reconstruct",
+		       " initial bogus offset %d of %d for %u/%lu; mailbox needs a reconstruct",
 		       mailbox->name,
-		       (int) (cacheitem - (mailbox->cache_base + cache_offset)),
-		       msgno, mailbox->exists);
+		       (int) (cacheitem - mailbox->cache_base),
+		       (int) mailbox->cache_size,
+		       msgno, exists);
 		return IMAP_IOERROR;
             }
 	    for (cache_ent = 0; cache_ent < NUM_CACHE_FIELDS; cache_ent++) {
@@ -2019,10 +2020,12 @@ static int process_records(struct mailbox *mailbox, FILE *newindex,
 		    (cacheitem > (mailbox->cache_base + mailbox->cache_size))) {
 		    syslog(LOG_ERR,
 			   "IOERROR: reading cache record for %s:"
-			   " got bogus offset %d for %u/%lu; try reconstruct",
+			   " item %d has bogus offset %d of %d for %u/%lu; mailbox needs a reconstruct",
 			   mailbox->name,
-			   (int) (cacheitem - (mailbox->cache_base + cache_offset)),
-			   msgno, mailbox->exists);
+			   cache_ent+1,
+			   (int) (cacheitem - mailbox->cache_base),
+			   (int) mailbox->cache_size,
+			   msgno, exists);
 		    return IMAP_IOERROR;
 		}
 	    }
----
Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux