未验证 提交 000175a6 编写于 作者: I Ian Craggs 提交者: GitHub

Merge pull request #1305 from axelsommerfeldt/fix_eyecatcher_check

checkEyecatchers() used to crash if a heap problem was detected
......@@ -39,6 +39,7 @@ char* Broker_recordFFDC(char* symptoms);
#include <string.h>
#include <stdio.h>
#include <stddef.h>
#include <inttypes.h>
#include "Heap.h"
......@@ -57,8 +58,9 @@ static mutex_type heap_mutex = &heap_mutex_store;
static heap_info state = {0, 0}; /**< global heap state information */
typedef double eyecatcherType;
typedef uint64_t eyecatcherType;
static eyecatcherType eyecatcher = (eyecatcherType)0x8888888888888888;
#define PRIeyecatcher PRIx64 /**< print eyecatcher in HEX notation */
/*#define HEAP_STACK 1 */
......@@ -224,7 +226,7 @@ static void checkEyecatchers(char* file, int line, void* p, size_t size)
eyecatcherType *sp = (eyecatcherType*)p;
char *cp = (char*)p;
eyecatcherType us;
static const char *msg = "Invalid %s eyecatcher %d in heap item at file %s line %d";
static const char *msg = "Invalid %s eyecatcher %" PRIeyecatcher " in heap item at file %s line %d";
if ((us = *--sp) != eyecatcher)
Log(LOG_ERROR, 13, msg, "start", us, file, line);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册