Visual C++ Developer Center >
Visual C++ Forums
>
Visual C++ General
>
MFC Application crashes after 24.9 days
MFC Application crashes after 24.9 days
- 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!
Answers
- 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- Proposed As Answer by.Sreedhar Wednesday, November 04, 2009 10:59 AM
- Marked As Answer byNancy ShaoMSFT, ModeratorTuesday, November 10, 2009 9:21 AM
All Replies
- 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 - 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. - 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- Proposed As Answer by.Sreedhar Wednesday, November 04, 2009 10:59 AM
- Marked As Answer byNancy ShaoMSFT, ModeratorTuesday, November 10, 2009 9:21 AM
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


