On Wed, 2009-11-18 at 10:04 +0200, Nikita Koshikov wrote:

> #10 0x080d03d2 in buffer_write (_buf=0xb7e1a670, pos=67100436, 
> data=0xbb53ae0, data_size=32824) at buffer.c:63
> No locals.
> #11 0x080d04f6 in buffer_append (buf=0xb7e1a670, data=0xbb53ae0, 
> data_size=32824) at buffer.c:168
> No locals.
> #12 0x080b54cc in mail_transaction_log_append (t=0xb205218, 
> log_file_seq_r=0xbf8541f0, log_file_offset_r=0xbf8541e0) at 
> mail-transaction-log-append.c:333

Interesting. If you still have the core and do:

fr 12
p *hdr
p offset
p hdrs[ext_id]

What does it print? Also could you try what it logs with the attached patch?

diff -r 96b5d6d8dd2c src/lib-index/mail-index-transaction.c
--- a/src/lib-index/mail-index-transaction.c	Thu Nov 12 12:43:13 2009 -0500
+++ b/src/lib-index/mail-index-transaction.c	Wed Nov 18 11:54:45 2009 -0500
@@ -1241,6 +1241,10 @@
 	i_assert(offset <= (uint16_t)-1 && size <= (uint16_t)-1 &&
 		 offset + size <= (uint16_t)-1);
 
+	if (offset + size > 1000)
+		i_warning("mail_index_update_header_ext: ext_id=%u offset=%u size=%u",
+			  ext_id, (int)offset, (int)size);
+
 	if (!array_is_created(&t->ext_hdr_updates))
 		i_array_init(&t->ext_hdr_updates, ext_id + 2);
 
diff -r 96b5d6d8dd2c src/lib-index/mail-transaction-log-append.c
--- a/src/lib-index/mail-transaction-log-append.c	Thu Nov 12 12:43:13 2009 -0500
+++ b/src/lib-index/mail-transaction-log-append.c	Wed Nov 18 11:54:45 2009 -0500
@@ -319,6 +319,10 @@
 	data = hdr->data;
 	mask = hdr->mask;
 
+	if (hdr->alloc_size > 1000)
+		i_warning("log_append_ext_hdr_update: size=%u",
+			  (int)hdr->alloc_size);
+
 	buf = buffer_create_dynamic(pool_datastack_create(), 256);
 	for (offset = 0; offset <= hdr->alloc_size; offset++) {
 		if (offset < hdr->alloc_size && mask[offset] != 0) {
diff -r 96b5d6d8dd2c src/plugins/virtual/virtual-sync.c
--- a/src/plugins/virtual/virtual-sync.c	Thu Nov 12 12:43:13 2009 -0500
+++ b/src/plugins/virtual/virtual-sync.c	Wed Nov 18 11:54:45 2009 -0500
@@ -311,6 +311,7 @@
 				      sizeof(struct virtual_mail_index_record),
 				      sizeof(uint32_t));
 	}
+	i_warning("header rewrite: size=%u", name_pos);
 	mail_index_update_header_ext(ctx->trans, ctx->mbox->virtual_ext_id,
 				     0, buf->data, name_pos);
 }
@@ -1007,6 +1008,10 @@
 
 	mailbox_offset = sizeof(struct virtual_mail_index_header) +
 		bbox->sync_mailbox_idx * sizeof(mailbox);
+	i_warning("header update: offset=%u size=%u, sync_mailbox_idx=%u",
+		  (int)(mailbox_offset + uidval_pos),
+		  (int)(sizeof(mailbox) - uidval_pos),
+		  bbox->sync_mailbox_idx);
 	mail_index_update_header_ext(ctx->trans, ctx->mbox->virtual_ext_id,
 				     mailbox_offset + uidval_pos,
 				     CONST_PTR_OFFSET(&mailbox, uidval_pos),

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to