I am investigating a crash due to heap corruption. As this issue is non-trivial and involves analyzing the stack and dump results, I have decided to do a code review of file
These are the HeapAlloc fuction syntax.
LPVOID WINAPI HeapAlloc(
_In_ HANDLE hHeap,
_In_ DWORD dwFlags,
_In_ SIZE_T dwBytes
);
Here dwFlags
paramater can have either HEAP_GENERATE_EXCEPTIONS
or HEAP_NO_SERIALIZE
or HEAP_ZERO_MEMORY
.
In our file we have to check the flags which we have set.
If we have set the flag value as HEAP_NO_SERIALIZE
then there will be no serialization which means multiple thread will access the resources which may cause memory corruption.
"Setting the HEAP_NO_SERIALIZE
value eliminates mutual exclusion on the heap. Without serialization,
two or more threads that use the same heap handle might attempt to allocate or free memory simultaneously,
likely causing corruption in the heap."
so I think due to the memory corruption in the heap, the node got crashed.