My App crashes in Windows 7 and Windows Vista
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: My App crashes in Windows 7 and Windows Vista

  1. #1
    Join Date
    May 2006
    Posts
    29

    My App crashes in Windows 7 and Windows Vista

    I have developed an application using Visual Studio 2005. The application runs fine on Windows XP but crashes on Windows 7 and Windows Vista.

    I checked the event logs and saw this:
    Code:
    Log Name:      Application
    Source:        Application Error
    Date:          6/3/2011 3:08:06 PM
    Event ID:      1000
    Task Category: (100)
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      PC-101
    Description:
    Faulting application name: MyApplication.exe, version: 4.4.3.0, time stamp: 0x4de87adf
    Faulting module name: ntdll.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdadb
    Exception code: 0xc0000005
    Fault offset: 0x00055f95
    Faulting process id: 0xed8
    Faulting application start time: 0x01cc21bcf1fcbb33
    Faulting application path: C:\Program Files\MyApplication\MyApplication.exe
    Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
    Report Id: 3aae04b8-8db0-11e0-abfb-002215c57d9a
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Application Error" />
        <EventID Qualifiers="0">1000</EventID>
        <Level>2</Level>
        <Task>100</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2011-06-03T07:08:06.000000000Z" />
        <EventRecordID>3387</EventRecordID>
        <Channel>Application</Channel>
        <Computer>PC-101</Computer>
        <Security />
      </System>
      <EventData>
        <Data>MyApplication.exe</Data>
        <Data>4.4.3.0</Data>
        <Data>4de87adf</Data>
        <Data>ntdll.dll</Data>
        <Data>6.1.7600.16385</Data>
        <Data>4a5bdadb</Data>
        <Data>c0000005</Data>
        <Data>00055f95</Data>
        <Data>ed8</Data>
        <Data>01cc21bcf1fcbb33</Data>
        <Data>C:\Program Files\MyApplication\MyApplication.exe</Data>
        <Data>C:\Windows\SYSTEM32\ntdll.dll</Data>
        <Data>3aae04b8-8db0-11e0-abfb-002215c57d9a</Data>
      </EventData>
    </Event>
    Is compiling the project on Windows 7 and Windows Vista a possible solution? I could try but if its not a solution I would not spend time setting up Vista and W7 development machine.

  2. #2
    Join Date
    Aug 2008
    Posts
    902

    Re: My App crashes in Windows 7 and Windows Vista

    That event report tells you (or us) nothing about why your program crashed.

    No, you shouldn't have to re-compile on Vista or 7 to get it to work properly.

    It's a bug in your application that needs to be fixed. You could try using the MSVC debugger from inside Vista or 7 to see whats going on at the time of the crash.

    If it's a small program, you could also try posting the source.

  3. #3
    Join Date
    Apr 1999
    Posts
    27,427

    Re: My App crashes in Windows 7 and Windows Vista

    Quote Originally Posted by webdev View Post
    I have developed an application using Visual Studio 2005. The application runs fine on Windows XP but crashes on Windows 7 and Windows Vista.
    To add to what ChrisF stated:

    If you're going to support multiple OS'es with your program, it is imperative that you're prepared to debug your program on all of your supported platforms.

    Secondly, just because it seems to run fine on XP doesn't mean the program is really OK. The other operating system's could have exposed a bug that isn't exposed when run on XP.

    Regards,

    Paul McKenzie

  4. #4
    Join Date
    Feb 2009
    Location
    Portland, OR
    Posts
    1,488

    Re: My App crashes in Windows 7 and Windows Vista

    I dealt with a similar situation before. In case your app doesn't provide any internal output of debugging information, and if you cannot run it through a debugger in Windows Vista/7 you can use the following approach I described in a previous thread:
    http://www.codeguru.com/forum/showpo...51&postcount=5
    (None that the post above is taken out of a context of the aforementioned thread.)

  5. #5
    Join Date
    Apr 1999
    Posts
    3,585

    Re: My App crashes in Windows 7 and Windows Vista

    You may also want to try Microsoft's Application Verifier. It's not the best way to debug, but, it can spot things that are missed by other means.
    Gort...Klaatu, Barada Nikto!

  6. #6
    Join Date
    May 2006
    Posts
    29

    Re: My App crashes in Windows 7 and Windows Vista

    ahmd, you're post is such a huge help. Was able to acquire the .mdmp and .hdmp along with other files.

    Doing exactly as you mentioned, I was able to trace the crash at free.c in the following lines of codes
    Code:
    retval = HeapFree(_crtheap, 0, pBlock);
    if (retval == 0)
    Could the reason be because of a code that calls free() on a memory that wasn't really allocated? I am to trace the code tomorrow.. this post is some sort of update on this topic

    ahmd, thank you very much!

  7. #7
    Join Date
    Apr 1999
    Posts
    27,427

    Re: My App crashes in Windows 7 and Windows Vista

    Quote Originally Posted by webdev View Post
    ahmd, you're post is such a huge help. Was able to acquire the .mdmp and .hdmp along with other files.

    Doing exactly as you mentioned, I was able to trace the crash at free.c in the following lines of codes
    Code:
    retval = HeapFree(_crtheap, 0, pBlock);
    if (retval == 0)
    You need to see what your code called to get to that point. You should inspect the call stack, not just where the crash is reported. The call stack will show you the series of functions that ultimately called the one that you are showing.
    Could the reason be because of a code that calls free() on a memory that wasn't really allocated?
    It means you more than likely are mismanaging pointers and dynamically allocated memory. That could have occurred anywhere in your program where you're doing this.

    So it looks like the issue, if this info you're giving us is correct, is exactly as I stated -- your program always had a lurking bug, it just wasn't exposed when running under XP.

    A C++ program need not crash when you make a mistake -- the behavior of a program that has memory related bugs is undefined. The program could work, crash, work sometimes and crash other times, work on one machine and crash on another, etc.

    Regards,

    Paul McKenzie

  8. #8
    Join Date
    Feb 2009
    Location
    Portland, OR
    Posts
    1,488

    Re: My App crashes in Windows 7 and Windows Vista

    Paul is absolutely correct, the fact that your program didn't crash under Windows XP simply means that XP manages memory differently but the bug was always there. I've seen this a million times. So look through the call stack to trace it back to a function/method in your own code that causes the crash. Although judging by your previous post, most certainly you have some sort of a buffer overrun, or use a pointed to a memory block that was previously released. There are a million of possibilities here without seeing the code... I agree with one though -- it is quite a b**ch to deal with if it wasn't caught immediately during development. Good luck.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center