Microsoft 开发人员网络 > 论坛主页 > Visual C++ General > MFC Application crashes after 24.9 days
提出问题提出问题
 

已答复MFC Application crashes after 24.9 days

  • 2009年11月4日 6:40Christian Dudzik 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Hello,

    i have a problem concerning a MFC application developed with Visual Studio 2003 .NET.
    After 24.9 days of runtime the whole application crashes.

    Unfortunately, i havent seen a crash on my debug-environment yet and it seemsthat i am not able
    to reproduce the problem at all.

    According to our customer, the problem occurs on different operating systems (winXP, win2000, win2003 server)
    and different computer hardware (1gb ram, 2gb ram etc).

    Any ideas how to reproduce this problem?
    I wrote a small application that maniuplates the current system time
    (24.9 days in ~1 minute) but im not able to crash the application

    thanks!

答案

  • 2009年11月4日 10:37WayneAKing 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     已答复
    Can they not kill the application from the Task Manager?

    From looking at the Task Manager, is the application dead (0% CPU use)
    or in a tight loop (99%)?

    What does the memory used/available look like when the app hangs?

    It's unlikely that faking an elapsed time interval will be of much help.
    You're more than likely experiencing a problem which develops (gradually)
    as the program runs. e.g. - memory leaks, other resource leaks, corruption
    of the heap, overwriting critical areas of the program's memory, etc.

    Loss of program control can also occur when a numeric overflow occurs.
    e.g. - A numeric variable being used to control program logic flow
    exceeds its capacity causing an unexpected comparison result.

    You have some debugging to do. Use all the tools at your disposal.

    - Wayne

全部回复

  • 2009年11月4日 6:56WayneAKing 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    The terms "crash", "crashes", "crashed", "crashing" etc. are ambiguous,
    non-technical, and simply mean "something bad happened". They offer no
    clues as to the nature of the malfunction. You are unlikely to get much
    useful advice with such a lack of specificity.

    Obtain from your users a more meaningful description of what happens.
    Does the program hang? Does the OS? Does it display an error message?
    If so, what *exactly* does it say? (No paraphrasing!)

    - Wayne
  • 2009年11月4日 7:42Christian Dudzik 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    sorry of course you are right.

    some users reported that only the program hangs, and they were able to restart the computer manually
    by clicking START->RESTART, others reported that the whole OS hangs and they could only do a hard reset.
    An error message is not displayed.
  • 2009年11月4日 10:37WayneAKing 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     已答复
    Can they not kill the application from the Task Manager?

    From looking at the Task Manager, is the application dead (0% CPU use)
    or in a tight loop (99%)?

    What does the memory used/available look like when the app hangs?

    It's unlikely that faking an elapsed time interval will be of much help.
    You're more than likely experiencing a problem which develops (gradually)
    as the program runs. e.g. - memory leaks, other resource leaks, corruption
    of the heap, overwriting critical areas of the program's memory, etc.

    Loss of program control can also occur when a numeric overflow occurs.
    e.g. - A numeric variable being used to control program logic flow
    exceeds its capacity causing an unexpected comparison result.

    You have some debugging to do. Use all the tools at your disposal.

    - Wayne
  • 2009年11月4日 12:40.Sreedhar 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     

    As  Wayne said, its because of memory leaks or head corruptions, gdi leaks etc.

    As you said its is difficult to reporduce the situation by waiting for 24 days, And you may not get the error by changing the system time (I think it is not related with the time)

    so do proper code review to check memory leaks and gdi leaks.

    add asserts to your code and use some tools like debug view and observe the logs




    Knowledge is like light; It spreads only when you have clear and transparent mind. - Sreedhar Dv