summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2022-08-13 20:58:29 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2022-08-14 13:52:56 +0100
commit766af058762b2c4e21b69f335adf77265fe9509a (patch)
tree40f918635bc74d31372631d9ab2a01ad129bac29
parent7adf6765592fa6b47c111d0ee247edb223494d69 (diff)
downloadexim4-766af058762b2c4e21b69f335adf77265fe9509a.tar.gz
Dump stack for "bad memory reference". Bug 2904
-rw-r--r--src/src/exim.c2
-rw-r--r--src/src/functions.h1
-rw-r--r--src/src/store.c3
3 files changed, 5 insertions, 1 deletions
diff --git a/src/src/exim.c b/src/src/exim.c
index 23e206d2a..ea4286af3 100644
--- a/src/src/exim.c
+++ b/src/src/exim.c
@@ -232,7 +232,7 @@ exit(1);
***********************************************/
#define STACKDUMP_MAX 24
-static void
+void
stackdump(void)
{
#ifndef NO_EXECINFO
diff --git a/src/src/functions.h b/src/src/functions.h
index e71823410..92a4831e3 100644
--- a/src/src/functions.h
+++ b/src/src/functions.h
@@ -547,6 +547,7 @@ extern int stdin_ferror(void);
extern BOOL stdin_hasc(void);
extern int stdin_ungetc(int);
+extern void stackdump(void);
extern void store_exit(void);
extern void store_init(void);
extern void store_writeprotect(int);
diff --git a/src/src/store.c b/src/src/store.c
index c98fcbf21..d99d2ab69 100644
--- a/src/src/store.c
+++ b/src/src/store.c
@@ -274,6 +274,9 @@ for (pp = paired_pools; pp < paired_pools + N_PAIRED_POOLS; pp++)
for (b = pp->chainbase; b; b = b->next)
if (is_pointer_in_block(b, p)) return pp;
+#ifndef COMPILE_UTILITY
+stackdump();
+#endif
log_write(0, LOG_MAIN|LOG_PANIC_DIE,
"bad memory reference; pool not found, at %s %d", func, linenumber);
return NULL;