summaryrefslogtreecommitdiff
path: root/storage/pbxt/src
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2011-02-25 17:05:17 +0100
committerVladislav Vaintroub <wlad@montyprogram.com>2011-02-25 17:05:17 +0100
commitd4c9ff957b2e7a484accc65d49a80ae4638deb9d (patch)
treedf60b31bc1dab1d77c8702e724a5b7961b9091d4 /storage/pbxt/src
parent9c10b73b76434907ad7fb1e9a05ecab8b2473e30 (diff)
downloadmariadb-git-d4c9ff957b2e7a484accc65d49a80ae4638deb9d.tar.gz
MBUG#688404 : Fix pbxt crashes on Windows 64 in debug build
The reason for the crash is misalignment on SSE instruciton in setjmp(). The root cause is PBXT debug malloc(), which unlike OS malloc does not guarantee 16 bytes alignment. So the fix for now is disable PBXT debug malloc on Windows. It was obsolete anyway, as it does not provide additional benefits to C runtime debug routines (always used in debug compilation) or to pageheap, available at runtime.
Diffstat (limited to 'storage/pbxt/src')
-rw-r--r--storage/pbxt/src/memory_xt.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/storage/pbxt/src/memory_xt.h b/storage/pbxt/src/memory_xt.h
index 1785cd0bd51..bfc7990f914 100644
--- a/storage/pbxt/src/memory_xt.h
+++ b/storage/pbxt/src/memory_xt.h
@@ -29,8 +29,21 @@
struct XTThread;
-#ifdef DEBUG
-#define DEBUG_MEMORY
+#if (defined DEBUG)
+/*
+ Disable PBXT debug malloc on Windows, as it is not properly aligned.
+ malloc() alignment requiremebt on x64 is documented as 16 bytes. PBXT debug
+ malloc is only 8 bytes aligned. Improper alignment will lead to a crash if
+ e.g SSE instructions access heap memory.
+
+ This might be general problem , however crashes were seen so far only
+ on Windows (crash during setjmp() on memory allocated with pbxt debug malloc).
+
+ Besides, on Windows there is already a debug malloc by C runtime.
+*/
+#ifndef _WIN32
+ #define DEBUG_MEMORY
+#endif
#endif
#ifdef DEBUG_MEMORY