473,406 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

C++ Debugging problem

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
Apr 30 '06 #1
5 13610
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 ...

May 1 '06 #2
You could try printing your "this" pointers from your constructors and
destructors to see if any of your instantiated objects corresponds
directly to the addresses in the error message. If that turns out to be
the case, and if the offset of the modification is always 0x34 bytes
from the start, you could figure out what member data that offset
refers to, which would point you to the code doing the modification.

-Chris

Qualnetics Corporation
cedgington at qualnetics.com

May 1 '06 #3
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


Try to run the application under WinDbg with PageHeap enabled, and it should
raise an access violation when something attempts to access the freed block.
Then do '!heap -p -a <address>' to see the call stack at the moment when
the heap block was freed (<address> is the address of the heap block).
This should give you more info about the reasons of the race condition.

Here is how to enable PageHeap (and related links):
http://www.debuginfo.com/tips/userbpntdll.html

Regards,
Oleg
[VC++ MVP http://www.debuginfo.com/]

May 2 '06 #4
Since this forum is "dotnet" - I assumed, maybe incorrectly, that his
app is a .NET app.

Nadav, is this a managed app or not?

-Chris

Qualnetics Corporation
cedgington at qualnetics.com

May 2 '06 #5
Since this forum is "dotnet" - I assumed, maybe incorrectly, that his
app is a .NET app.


The app is at least mixed, since it uses COM, and the error comes from
the native Win32 heap manager.

Oleg

May 2 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Don Hans | last post by:
Gents, Have .Net2003 Enterprise architect installed on a Win2k Server with IIS. Even logged in as administrator, I cannot run any ASP.NET app with debugging. I always get the error "Unable to...
0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
16
by: Serdar Kalayc | last post by:
Hi everybody, My problem seems a bit clich but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
2
by: Alex Clark | last post by:
Hi All, My system: WinXP Pro, VS.NET 2003, SQL Server Personal Edition. I'm having problems with my old favourite demon, SQL Debugging from within VS.NET. I have to say I've found this...
1
by: Jason Smith | last post by:
I'm rather new with vb.net and I'm having problems debugging a large vb.net application. The application is randomly crashing at two locations with "referenced memory at 0x0" violations. My...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
5
by: phnimx | last post by:
Hi , We have developed a number of plug-in .NET Library Components that we typically deploy with our various applications by installing them into the GAC. Each of the applications contains an...
0
jwwicks
by: jwwicks | last post by:
Introduction This tutorial describes how to use Visual Studio to create a new C++ program, compile/run a program, resume work on an existing program and debug a program. It is aimed at the...
2
jwwicks
by: jwwicks | last post by:
C/C++ Programs and Debugging in Linux This tutorial will give you a basic idea how to debug a program in Linux using GDB. As you are aware Visual Studio doesnt run on Linux so you have to use...
3
by: Yves Gagnon | last post by:
Hi, I try to debug a WCF hosted in a windows services on a serveur that is on an other domaine then my developpement machine. I tried many things without succes. Here is what I tried: First I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.