Hi Nadav,
"Nadav" <Na***@discussions.microsoft.com> wrote in message
news:EE**********************************@microsof t.com...
Hi,
I am writing a Thread pooled P2P application, I have a constant flow of
actions that produce a certain problem, though I cannot find it's cause.
I get "Free Heap block 356c00 modified at 356c34 after it was freed",
following is a list of actions I have done while trying to find the cause:
1. Usage of compuwares BoundsChecker ? didn't find anything special.
2. using a binary search revealed calling a specific method caused this
problem, surprisingly the method being called is of the following form:
STDMETHODCALL DataNode::MyMethod(void) {
Return E_FAIL;
}
Following is the exact error description as provided by VS2005 debugger:
HEAP: Free Heap block 356c00 modified at 356c34 after it was freed
Windows has triggered a breakpoint in DataNodeLuncher.exe.
This may be due to a corruption of the heap, and indicates a bug in
DataNodeLuncher.exe or any of the DLLs it has loaded.
The output window may have more diagnostic information
I am really desperate about this.
Any help would be appreciated.
--
Nadav
http://www.sophin.com
It seems your problem is not a memory leak, but a synchronization problem. A
thread tries to access an object after it has been accessed by another
thread. I am not sure that the function mentioned you mentioned is the
function that actually causes the poblem. When the breakpoint occurs, it
does not help that much to investigate the call stack, because the detection
of this illegal modification does not happen during the modification of the
deleted object, but at a later time.
Is the poblem always occuring with the same address? If yes, try to use a
data breakpoint to find the illegal modification. If no, I would try to
guess the class whose instance is illegally modified. I would modify that
class to that the constructor logs the this pointer and something
identifying the object to a log file. When you repoduce the error, you can
use the heap block address and the log data to find out what object has
caused the problem. Once you know that you can identify where the object has
been deleted and why that is too early ...