On Tue, 2009-06-02 at 17:07 +0200, wolfgang.frie...@desy.de wrote:
> This is the first and only crash I could find in the logs
> (approx 500k Lines of postfix/dovecot logs)
> 
> The following information could be extracted from the logfile (no core 
> dump unfortunately)
> 
> May 31 02:07:25 apollo dovecot: deliver(user1): Panic: 
> file istream.c: line 99 (i_stream_read): assertion failed: 
> ((size_t)ret+old_size == _stream->pos - _stream->skip)

I suppose this hasn't happened since? Core dump from this would be
really interesting. I've also attached a patch that could at least show
if my guess it right where it probably crashed..
diff -r ef7c0c3b1976 src/lib/istream-tee.c
--- a/src/lib/istream-tee.c	Mon Jun 15 21:56:22 2009 -0400
+++ b/src/lib/istream-tee.c	Mon Jun 15 22:29:20 2009 -0400
@@ -108,7 +108,7 @@
 	struct tee_child_istream *tstream = (struct tee_child_istream *)stream;
 	struct istream *input = tstream->tee->input;
 	const unsigned char *data;
-	size_t size;
+	size_t size, old_size;
 	uoff_t last_high_offset;
 	ssize_t ret;
 
@@ -116,6 +116,7 @@
 		/* initial read */
 		tee_streams_update_buffer(tstream->tee);
 	}
+	old_size = stream->pos - stream->skip;
 	data = i_stream_get_data(input, &size);
 
 	/* last_high_offset contains how far we have read this child tee stream
@@ -141,6 +142,7 @@
 		}
 		tee_streams_update_buffer(tstream->tee);
 		data = i_stream_get_data(input, &size);
+		i_assert((size_t)(size - stream->pos)+old_size == size - stream->skip);
 	} else {
 		/* there's still some data available from parent */
 		i_assert(last_high_offset < input->v_offset + size);
@@ -152,6 +154,7 @@
 	ret = size - stream->pos;
 	i_assert(ret > 0);
 	stream->pos = size;
+	i_assert((size_t)ret+old_size == stream->pos - stream->skip);
 	return ret;
 }
 

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

Reply via email to