dovecot-2.2: lib: add markers to data-stack debug prints

dovecot at dovecot.org dovecot at dovecot.org
Mon Jul 28 13:54:26 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/9251b51dda54
changeset: 17636:9251b51dda54
user:      Phil Carmody <phil at dovecot.fi>
date:      Mon Jul 28 16:45:33 2014 +0300
description:
lib: add markers to data-stack debug prints
Only the DEBUG code will have access to the frame's marker.

diffstat:

 src/lib/data-stack.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r 6ea0584e3861 -r 9251b51dda54 src/lib/data-stack.c
--- a/src/lib/data-stack.c	Mon Jul 28 16:45:33 2014 +0300
+++ b/src/lib/data-stack.c	Mon Jul 28 16:45:33 2014 +0300
@@ -223,14 +223,16 @@
 		while (pos < used_size) {
 			alloc_size = *(size_t *)(p + pos);
 			if (used_size - pos < alloc_size)
-				i_panic("data stack: saved alloc size broken");
+				i_panic("data stack[%s]: saved alloc size broken",
+					current_frame_block->marker[frame_pos]);
 			pos += MEM_ALIGN(sizeof(alloc_size));
 			max_pos = pos + MEM_ALIGN(alloc_size + SENTRY_COUNT);
 			pos += alloc_size;
 
 			for (; pos < max_pos; pos++) {
 				if (p[pos] != CLEAR_CHR)
-					i_panic("data stack: buffer overflow");
+					i_panic("data stack[%s]: buffer overflow",
+						current_frame_block->marker[frame_pos]);
 			}
 		}
 
@@ -402,7 +404,8 @@
 		if (warn && getenv("DEBUG_SILENT") == NULL) {
 			/* warn after allocation, so if i_warning() wants to
 			   allocate more memory we don't go to infinite loop */
-			i_warning("Growing data stack with: %"PRIuSIZE_T,
+			i_warning("Growing data stack[%s] with: %"PRIuSIZE_T,
+				  current_frame_block->marker[frame_pos],
 				  block->size);
 		}
 #endif


More information about the dovecot-cvs mailing list