Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / June 2006

Tip: Looking for answers? Try searching our database.

Runtime crash in a destructor

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nscbabu@gmail.com - 29 May 2006 11:12 GMT
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.
Bruno van Dooren - 29 May 2006 14:51 GMT
> 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?

Signature

Kind regards,
   Bruno van Dooren
   bruno_nos_pam_van_dooren@hotmail.com
   Remove only "_nos_pam"

Andreas Masur - 29 May 2006 20:25 GMT
> Hi,
> We are migrating a product from vc6 to vs.net 2003, when we run the app
[quoted text clipped - 4 lines]
> Thanks in advance,
> --sarath.

Well...what about the debugger?

Ciao, Andreas
nscbabu@gmail.com - 30 May 2006 14:44 GMT
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
}
Oleg Starodumov - 31 May 2006 13:12 GMT
> dlsDownloadXrefFile::dlsDownloadXrefFile(CMainFrame* p) : dlsmState(p)
> {
[quoted text clipped - 3 lines]
> 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/]
nscbabu@gmail.com - 31 May 2006 15:51 GMT
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++
Oleg Starodumov - 01 Jun 2006 08:16 GMT
>   ntdll.dll!_DbgBreakPoint@0()
>   ntdll.dll!_RtlpBreakPointHeap@4()  + 0x28
[quoted text clipped - 12 lines]
> 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

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.