473,805 Members | 1,910 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Runtime crash in a destructor

Hi,
We are migrating a product from vc6 to vs.net 2003, when we run the app
it crashes pointing to a c++ class destructor, we didnot make any code
changes during the migration. Can anybody help me giving some pointers
on what could be the possible reason?

Thanks in advance,
--sarath.

May 29 '06 #1
6 1579
> We are migrating a product from vc6 to vs.net 2003, when we run the app
it crashes pointing to a c++ class destructor, we didnot make any code
changes during the migration. Can anybody help me giving some pointers
on what could be the possible reason?


Hi Sarah,
Could you perhaps post the code inside the destructor,
with an indication of which line triggers the crash?

--

Kind regards,
Bruno van Dooren
br************* *********@hotma il.com
Remove only "_nos_pam"
May 29 '06 #2
On Mon, 29 May 2006 03:12:37 -0700, ns*****@gmail.c om wrote:
Hi,
We are migrating a product from vc6 to vs.net 2003, when we run the app
it crashes pointing to a c++ class destructor, we didnot make any code
changes during the migration. Can anybody help me giving some pointers
on what could be the possible reason?

Thanks in advance,
--sarath.


Well...what about the debugger?

Ciao, Andreas
May 29 '06 #3
Hi guys,
Thanks for showing intrest in my question.

regards,
--sarath.

Pls find the debugging comments inline with the code:

dlsDownloadXref File::dlsDownlo adXrefFile(CMai nFrame* p) : dlsmState(p)
{
init = false;
pSearchFirmware Dlg = NULL;
m_user = "";
m_password = "";
pAbortRequested = new bool(false); //crashes here and goes

//to the ~dlsmState
}

dlsDownloadXref File::~dlsDownl oadXrefFile()
{
stopSearchDlg() ; //safety code - kill any existing
if ( pAbortRequested )
delete pAbortRequested ;
}

where,
dlsmState::dlsm State(CMainFram e* p) : pMainFrame(p)
{
bInit = false;
}

dlsmState::~dls mState()
{//After the "break, continue" exception
//dialog box the debbugger jumps to this destructor
//the stack trace shows all msvcr71d.dll:fu nction_names
// before this ~dlsmState
}

May 30 '06 #4
dlsDownloadXref File::dlsDownlo adXrefFile(CMai nFrame* p) : dlsmState(p)
{
init = false;
pSearchFirmware Dlg = NULL;
m_user = "";
m_password = "";
pAbortRequested = new bool(false); //crashes here


What kind of exception is raised?
What is on the call stack at this moment?

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


May 31 '06 #5
Hi,
Here I am pasting the stack trace.
--sarath.
ntdll.dll!_DbgB reakPoint@0()
ntdll.dll!_Rtlp BreakPointHeap@ 4() + 0x28
ntdll.dll!_Rtlp CheckBusyBlockT ail@4() + 0x76
ntdll.dll!_Rtlp ValidateHeapEnt ry@12() + 0xa4
ntdll.dll!_RtlV alidateHeap@12( ) + 0xe0
kernel32.dll!_H eapValidate@12( ) + 0x14
msvcr71d.dll!_C rtIsValidHeapPo inter(const void * pUserData=0x00e bda88) Line 1807 C

msvcr71d.dll!_f ree_dbg_lk(void * pUserData=0x00e bda88, int
nBlockUse=1) Line 1132 + 0x9 C
msvcr71d.dll!_f ree_dbg(void * pUserData=0x00e bda88, int nBlockUse=1)
Line 1070 + 0xd C
mfc71d.dll!oper ator delete(void * p=0x00ebda88) Line 369 + 0xc C++
mfc71d.dll!oper ator delete(void * pData=0x00ebda8 8, const char *
__formal=0x004d 3688, const char * __formal=0x004d 3688) Line 78 +
0x9 C++
dwnld.exe!AfxGe tModuleState() + 0x2038 C++

May 31 '06 #6
ntdll.dll!_DbgB reakPoint@0()
ntdll.dll!_Rtlp BreakPointHeap@ 4() + 0x28
ntdll.dll!_Rtlp CheckBusyBlockT ail@4() + 0x76
ntdll.dll!_Rtlp ValidateHeapEnt ry@12() + 0xa4
ntdll.dll!_RtlV alidateHeap@12( ) + 0xe0
kernel32.dll!_H eapValidate@12( ) + 0x14
msvcr71d.dll!_C rtIsValidHeapPo inter(const void * pUserData=0x00e bda88) Line 1807 C

msvcr71d.dll!_f ree_dbg_lk(void * pUserData=0x00e bda88, int
nBlockUse=1) Line 1132 + 0x9 C
msvcr71d.dll!_f ree_dbg(void * pUserData=0x00e bda88, int nBlockUse=1)
Line 1070 + 0xd C
mfc71d.dll!oper ator delete(void * p=0x00ebda88) Line 369 + 0xc C++
mfc71d.dll!oper ator delete(void * pData=0x00ebda8 8, const char *
__formal=0x004d 3688, const char * __formal=0x004d 3688) Line 78 +
0x9 C++
dwnld.exe!AfxGe tModuleState() + 0x2038 C++


The heap is corrupted, and heap manager notifies you about it.
Here is how you can find the reason of the problem:
http://www.debuginfo.com/tips/userbpntdll.html

Oleg


Jun 1 '06 #7

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

Similar topics

8
2282
by: Tahir Hashmi | last post by:
Consider this piece of code: #include <iostream> using namespace std; class y { public: void draw()
18
2568
by: Active8 | last post by:
I put the bare essentials in a console app. http://home.earthlink.net/~mcolasono/tmp/degub.zip Opening output.fft and loading it into a vector<float> screws up, but input1.dat doesn't. It does load the vector, too. It just craps out when you return to the console, or in a Windows app, the message loop. I think it has something to do with the vector<float> going out of scope and trying to free memory, but don't know why it would do...
3
1422
by: Tal Shachar | last post by:
Hi All, I posted this request on ...dotnet.framework.interop newsgroup, but I thought to try also here, and ask to get your inputs for the following issue: I have an application written in C++, and now I'm going to add another module to it, which I'm going to write in C#, and wrap it as a COM. The new module is going to interact with the existing application during runtime (call the application's methods and run some BL according to the...
3
2055
by: Antti Keskinen | last post by:
Hello ppl ! Since this newsgroup is a place where Microsoft MVPs or related visit somewhat often, could someone give me an advice with possible causes of this error. Note that it does not happen with the programs I write, but with Visual Studio .NET 2003 itself. It seems to appear only when I have the Visual Assist add-in installed. Removing the add-in fixes this error, but using VA is pretty much a necessity due to the bad functionality...
24
2066
by: ekz | last post by:
Hi guys I have a very weird bug and will welcome gracefully any help We developed ASP.Net application that run on production server, Net Framework 1.1 , IIS 6.0, the application is huge, having hundreds of user controls and worked under massive requests load : 200-1000 connected sessions and millions of page views per day The application is stable; the only and urgent problem is that: About 10 times per day, more frequently at pick...
4
5316
by: ashish_chap | last post by:
Hi, I am using _bstr_t class in a function. This is used in an application that is used in an multi-threaded environment. The function is implemented as follows: int Function(wchar_t *sqlCmd) { _bstr_t cmd ;
3
2292
by: Lyndsey.Ferguson | last post by:
Hello Everyone, I am investigating a crash within our application that has me stumped. I am developing for Mac OS X, but I believe that this may be a regular gcc c++ type question. Here is the stack crawl of where the application is crashing: Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_INVALID_ADDRESS (0x0001) at 0x0c3968c0
1
3766
by: johnxhc | last post by:
I have the big application, it has C#, VB.NET, VB6 & VC++ components, those components calling each other, passing the objects between the managed & unmanaged layer. The application crashes in one operation scenario, the crash is caused by the following: 1) A COM (ComComp1 ,written with VB6.0) component is marshaled to .NET (NetComp1) 2) NetComp1 create a instance of another Comp Component (ComComp2,
0
2320
by: =?Utf-8?B?VGhvbWFzIFR1dGtv?= | last post by:
An ASP.NET web project has recently began crashing WebDev.WebServer.exe with a System.Runtime.InteropServices.SEHException. The EventLog for the crash looks like this: Application ID: WebDev.WebServer.EXE Process ID: 1552 Exception: System.Runtime.InteropServices.SEHException
0
9596
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
10607
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
9182
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5541
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4317
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
3843
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.