Microsoft Developer Network > 포럼 홈 > 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