Commit d4c9ff95 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

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.
parent 9c10b73b
...@@ -29,8 +29,21 @@ ...@@ -29,8 +29,21 @@
struct XTThread; struct XTThread;
#ifdef DEBUG #if (defined DEBUG)
#define DEBUG_MEMORY /*
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 #endif
#ifdef DEBUG_MEMORY #ifdef DEBUG_MEMORY
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment