473,769 Members | 3,872 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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::MyMet hod(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 13632
Hi Nadav,

"Nadav" <Na***@discussi ons.microsoft.c om> wrote in message
news:EE******** *************** ***********@mic rosoft.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::MyMet hod(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::MyMet hod(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
2068
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 start debugger on the web server: Access is Denied" when attempting to start the app with debugging. Now, I have already spent 3 days going through every Knowledge base article and all the included help with .net, have tried about 50 different...
0
3227
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 converted/developed with VB.NET. What I want from debugging is to be able to step into the methods in the DLLs called from ASP scripts using Visual Studio .NET. Background: For typical script debugging issues, you can read and follow the two documents on...
16
4221
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 project in debug mode (by hitting F5) it gives an error message "Error while trying to run project: Unable to start debugging on the web server.
2
3274
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 particular feature to be one of the most useful and (sadly) unreliable/fragile features in VS.NET, it seems the slightest thing will break it.
1
1769
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 try-catch blocks are not trapping these exceptions. Sysinternals' procexp places the two crash addresses in ntdll.dll, offsets 2a84 and 2b6a - both in RtlLogStackBackTrace.
5
3645
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 New System.Diagnostics.Process 'p.Start(MDEPDirStr & "macrun.exe", sPPTOut) p.Start("C:\WINDOWS\SYSTEM32\CALC.EXE") 'p.Start("C:\WINDOWS\SYSTEM32\macrun.exe", sPPTOut)
5
7802
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 app.config file referencing arbitrary versions of the plug-in components they wish to consume. Here's the problem: Assuming I have installed any one of our application software,
0
7335
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 beginning CIS student who is struggling to get their programs working. I work in the computer lab at the college I'm attending and I see many students who don't know how to use the IDE for best results. Visual Studio automatically creates a number of...
2
20850
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 some of the tools provided on the command-line. If you hate the command line tools, get over it since youre bound to be using them at some point in your career. All commands in Linux ARE case sensitive so capital letters are different from lowercase...
3
6628
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 installed on the server I want to debug, the remote debugger tools from the VS 2005 CD. I just install the windows application. I tried from there to debug, without succes. I could connect to the remote machine only when the msvsmon.exe is in the...
0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9422
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10206
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10035
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9984
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9851
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3556
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.