-
November 21st, 2014, 03:18 PM
#1
Application has stopped working error - program randomly hangs
Hello,
I am running into some problems with a program that I've written and I need some help. It is a C# .NET 2.0 Winforms application. It is being executed from a network drive, and runs under Windows XP
and Windows 7. The platform target is x86. It does some SQL queries, reading and writing to a file stored on a network using SQLite. There are certain operations, which are not repeatable, in which the
user will click and the program will simply stall, going into the hourglass (or spinning circle). Usually when this happens, the program will crash with "The application has stopped working" error. I have an
exception handler, but apparently it is not catching the problem.
What measures can I take to find out the problematic code? Or to correct the errors? The users of the program get frustrated when the crashes occur as it slows down their work.
Thanks
Mike
-
November 29th, 2014, 03:16 PM
#2
Re: Application has stopped working error - program randomly hangs
Is it possible that it is getting into an endless loop?
Always use [code][/code] tags when posting code.
-
November 29th, 2014, 07:40 PM
#3
Re: Application has stopped working error - program randomly hangs
You need to log trace statements to a log file so you can determine where the app is getting stuck. Btw, do several instances of the app write to the same network file? If so, is there a file locking issue?
-
November 29th, 2014, 08:07 PM
#4
Re: Application has stopped working error - program randomly hangs
make sure you are flushing and closing a reading or writing stream
if you are not wrapping the file writing operation with a using statement
or setting flags to write and read from to individually
if that is your intention you must have permissions as well as
setting the streams and file and read write flags appropriately
that can often cause a very late exception
a infinant loop can be detected breakpoint wise with a cheap trick i sometimes use
by placing a dummy method
thru-out the area of suspect code
with a break point on a dummy if line within that method
int n = 1;
DummyMethod(int amount)
{
n ++;
if(n > amount)
{
// breakpoint me then place method thru out suspect areas
string s = "holy moly im being called more then i should be";
// if fired remove it at each place till you find the one causing it
}
}
Last edited by willmotil; November 29th, 2014 at 08:14 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|