December 28th, 2010, 01:32 AM
Boost invalid block while overloading global new/delete
I have a problem which appears to a be an invalid memory block that happens during a Boost call to Boost:runtime:cla:arser::~parser. When that global delete is called on that object, C++ asserts on the memory block as an invalid:
/* verify block type */
An investigation I did revealed that the problem happened because of a global overloading of the new/delete operators. Those overloadings are placed in a separate DLL. I discovered that the problem happens only when that DLL is compiled in RELEASE while the main application is compiled in DEBUG.
So I thought that the Release/Debug build flavors might have created a problem like this in Boost/CRT when overloading new/delete operators. So I then tried to explicitly call to _malloc_dbg and _free_dbg withing the overloading functions even in release mode, but it didn't solve the invalid heap block problem.
Any idea what the root cause of the problem is? is that situation solvable?
I should stress that the problem began only when I started to use Boost. Before that CRT never complained about any invalid memory block. So could it be an internal Boost bug?
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!