My app crash with no apparent reason?
-
Hi to all. When I run my application and start to work with it, after a while it crashes! Call stack:
00000000()
AfxCallWndProc(CWnd * 0x003af188 {CWnd hWnd=0x00020ae4}, HWND__ * 0x00020ae4, unsigned int 0x00000363, unsigned int 0x00000001, long 0x00000000) line 215 + 26 bytes
CWnd::SendMessageToDescendants(HWND__ * 0x00020ac6, unsigned int 0x00000363, unsigned int 0x00000001, long 0x00000000, int 0x00000001, int 0x00000001) line 2309
CWnd::SendMessageToDescendants(HWND__ * 0x00020ac8, unsigned int 0x00000363, unsigned int 0x00000001, long 0x00000000, int 0x00000001, int 0x00000001) line 2320
CWnd::SendMessageToDescendants(HWND__ * 0x000d09fc, unsigned int 0x00000363, unsigned int 0x00000001, long 0x00000000, int 0x00000001, int 0x00000001) line 2320
CWnd::SendMessageToDescendants(HWND__ * 0x0008099e, unsigned int 0x00000363, unsigned int 0x00000001, long 0x00000000, int 0x00000001, int 0x00000001) line 2320
CWnd::SendMessageToDescendants(unsigned int 0x00000363, unsigned int 0x00000001, long 0x00000000, int 0x00000001, int 0x00000001) line 146 + 32 bytes
CServisiApp::OnIdle(long 0x00000000) line 3694
CWinThread::Run() line 472 + 30 bytes
CWinApp::Run() line 400
AfxWinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00151f0b, int 0x00000001) line 49 + 11 bytes
WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00151f0b, int 0x00000001) line 30
WinMainCRTStartup() line 330 + 54 bytes
KERNEL32! 7c817077()The error I get is: "First-chance exception in MyApp.exe: 0xC0000005: Access Violation." Any clue? Win XP, VC 6 Thanks!
-
Hi to all. When I run my application and start to work with it, after a while it crashes! Call stack:
00000000()
AfxCallWndProc(CWnd * 0x003af188 {CWnd hWnd=0x00020ae4}, HWND__ * 0x00020ae4, unsigned int 0x00000363, unsigned int 0x00000001, long 0x00000000) line 215 + 26 bytes
CWnd::SendMessageToDescendants(HWND__ * 0x00020ac6, unsigned int 0x00000363, unsigned int 0x00000001, long 0x00000000, int 0x00000001, int 0x00000001) line 2309
CWnd::SendMessageToDescendants(HWND__ * 0x00020ac8, unsigned int 0x00000363, unsigned int 0x00000001, long 0x00000000, int 0x00000001, int 0x00000001) line 2320
CWnd::SendMessageToDescendants(HWND__ * 0x000d09fc, unsigned int 0x00000363, unsigned int 0x00000001, long 0x00000000, int 0x00000001, int 0x00000001) line 2320
CWnd::SendMessageToDescendants(HWND__ * 0x0008099e, unsigned int 0x00000363, unsigned int 0x00000001, long 0x00000000, int 0x00000001, int 0x00000001) line 2320
CWnd::SendMessageToDescendants(unsigned int 0x00000363, unsigned int 0x00000001, long 0x00000000, int 0x00000001, int 0x00000001) line 146 + 32 bytes
CServisiApp::OnIdle(long 0x00000000) line 3694
CWinThread::Run() line 472 + 30 bytes
CWinApp::Run() line 400
AfxWinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00151f0b, int 0x00000001) line 49 + 11 bytes
WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00151f0b, int 0x00000001) line 30
WinMainCRTStartup() line 330 + 54 bytes
KERNEL32! 7c817077()The error I get is: "First-chance exception in MyApp.exe: 0xC0000005: Access Violation." Any clue? Win XP, VC 6 Thanks!
You should have realized that this is the right time to add some log/traces/Messageboxes at places where you "expect"(blind guess-depends on how much steps in your application have executed already) your application to crash. Also read about the first chance exception handling mechanism here[^] and here[^]
You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
-
You should have realized that this is the right time to add some log/traces/Messageboxes at places where you "expect"(blind guess-depends on how much steps in your application have executed already) your application to crash. Also read about the first chance exception handling mechanism here[^] and here[^]
You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
I'm aware of this. The thing is there's no pattern when my app will crash, some times on this occasion and on second run on that. No relationship between?! That's what bugging me!
-
I'm aware of this. The thing is there's no pattern when my app will crash, some times on this occasion and on second run on that. No relationship between?! That's what bugging me!
josip cagalj wrote:
The thing is there's no pattern when my app will crash, some times on this occasion and on second run on that. No relationship between?!
But you should still add some gratuitous "logging" code to help narrow it down. Try and remove (unnecessary) parts of your code until the crash subsides. There is no "silver bullet" for this. Roll up your sleeves and get dirty.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
josip cagalj wrote:
The thing is there's no pattern when my app will crash, some times on this occasion and on second run on that. No relationship between?!
But you should still add some gratuitous "logging" code to help narrow it down. Try and remove (unnecessary) parts of your code until the crash subsides. There is no "silver bullet" for this. Roll up your sleeves and get dirty.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
Yes so I did. Found out the thing causing the problem. You see I inherited this app from an colleague from work he had slight different control then my own (it's work internal control we use). When overwritten, all worked OK. The thing causing the problem is when called OnIdle message notifies some wnd's of an idle time, and some of those aren't wnd at all!