Runtime crash in a destructor

  • Thread starter Thread starter nscbabu
  • Start date Start date
N

nscbabu

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.
 
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
(e-mail address removed)
Remove only "_nos_pam"
 
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
 
Hi guys,
Thanks for showing intrest in my question.

regards,
--sarath.

Pls find the debugging comments inline with the code:

dlsDownloadXrefFile::dlsDownloadXrefFile(CMainFrame* p) : dlsmState(p)
{
init = false;
pSearchFirmwareDlg = NULL;
m_user = "";
m_password = "";
pAbortRequested = new bool(false); //crashes here and goes

//to the ~dlsmState
}

dlsDownloadXrefFile::~dlsDownloadXrefFile()
{
stopSearchDlg(); //safety code - kill any existing
if ( pAbortRequested )
delete pAbortRequested;
}

where,
dlsmState::dlsmState(CMainFrame* p) : pMainFrame(p)
{
bInit = false;
}

dlsmState::~dlsmState()
{//After the "break, continue" exception
//dialog box the debbugger jumps to this destructor
//the stack trace shows all msvcr71d.dll:function_names
// before this ~dlsmState
}
 
dlsDownloadXrefFile::dlsDownloadXrefFile(CMainFrame* p) : dlsmState(p)
{
init = false;
pSearchFirmwareDlg = 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/]
 
Hi,
Here I am pasting the stack trace.
--sarath.
ntdll.dll!_DbgBreakPoint@0()
ntdll.dll!_RtlpBreakPointHeap@4() + 0x28
ntdll.dll!_RtlpCheckBusyBlockTail@4() + 0x76
ntdll.dll!_RtlpValidateHeapEntry@12() + 0xa4
ntdll.dll!_RtlValidateHeap@12() + 0xe0
kernel32.dll!_HeapValidate@12() + 0x14
msvcr71d.dll!_CrtIsValidHeapPointer(const void * pUserData=0x00ebda88) Line 1807 C
msvcr71d.dll!_free_dbg_lk(void * pUserData=0x00ebda88, int
nBlockUse=1) Line 1132 + 0x9 C
msvcr71d.dll!_free_dbg(void * pUserData=0x00ebda88, int nBlockUse=1)
Line 1070 + 0xd C
mfc71d.dll!operator delete(void * p=0x00ebda88) Line 369 + 0xc C++
mfc71d.dll!operator delete(void * pData=0x00ebda88, const char *
__formal=0x004d3688, const char * __formal=0x004d3688) Line 78 +
0x9 C++
dwnld.exe!AfxGetModuleState() + 0x2038 C++
 
ntdll.dll!_DbgBreakPoint@0()
ntdll.dll!_RtlpBreakPointHeap@4() + 0x28
ntdll.dll!_RtlpCheckBusyBlockTail@4() + 0x76
ntdll.dll!_RtlpValidateHeapEntry@12() + 0xa4
ntdll.dll!_RtlValidateHeap@12() + 0xe0
kernel32.dll!_HeapValidate@12() + 0x14
msvcr71d.dll!_free_dbg_lk(void * pUserData=0x00ebda88, int
nBlockUse=1) Line 1132 + 0x9 C
msvcr71d.dll!_free_dbg(void * pUserData=0x00ebda88, int nBlockUse=1)
Line 1070 + 0xd C
mfc71d.dll!operator delete(void * p=0x00ebda88) Line 369 + 0xc C++
mfc71d.dll!operator delete(void * pData=0x00ebda88, const char *
__formal=0x004d3688, const char * __formal=0x004d3688) Line 78 +
0x9 C++
dwnld.exe!AfxGetModuleState() + 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
 
Back
Top