Application crashes

J

Julie

Hi, I have an application built with C# (Visual Studio 2005) whose
Release version runs on a target machine. The application typically
runs without crashing, but on occasion crashes.
The application is multi-threaded, and I specifically put try/catch
statements around the code in each of these threads, hoping to contain
the crash. But I guess that wasn't sufficient, as the app crashed
yesterday. The error that comes up is simply "NameOfApp needs to
close" (or something like that). No indication of where in the code
the crash occurred.

Would this most likely be some operating system-level crash, or what
do you think? What does the fact that the error shows no source code
location information tell us about this error?

Also, I am trying to understand what types of errors try/catch is
capable of catching, and what it is not. It seems I can catch many
different types of errors, much more so than when I used to work on
Visual C++ 6.0.

Thanks!
 
J

Julie

Julie wrote:

 > [...]
Also, I am trying to understand what types of errors try/catch is
capable of catching, and what it is not. It seems I can catch many
different types of errors, much more so than when I used to work on
Visual C++ 6.0.

You should be writing your program so that the errors don't occur.  Just
because you can catch errors that doesn't mean there's a way to do so
without corrupting your data or otherwise causing more subtle problems.

As for your specific problem, there's no way for anyone to suggest
what's wrong if you don't provide specifics, including a
concise-but-complete code example that reliably demonstrates the problem.

Pete

Well, my plan was to attempt to catch the error and then print out a
stack trace of where it occurred, so that I could then fix the bug.

The problem is that when I run the code on my development machine in
debug mode, it never crashes. When I run it on the target machine, it
occasionally crashes, and I have no idea where.

My main question is: what is the difference between a crash whose
error box reports where the crash occurred in the code and an error
that doesn't provide any information?

My second question is: given that the error is not being caught, what
does this indicate about the type of error?

I can see what you're saying, that maybe I'm catching the error,
moving on, and then having some corruption of memory later on. I will
consider investigating that possibility. Thanks.
 
J

Julie

It could be as simple as no symbols on the computer where the error
occurred.  Have you copied the appropriate .pdb file to the install
directory where the program is?


Lacking specific context, nothing, other than it obviously happens
somewhere other than where you have an exception handler (or, a remote
possibility, that it's some kind of error that can't be trapped as an
exception…again, lacking context, there's no way for any of us to know
if that could be a possibility or not).

Pete

Thanks! I'm not sure about the pdb file, so I'll look into that.
Although, given that I am using a .msi to install the released version
of software onto the target machine, I'm guessing it would install
this as well(?).

Any clue as to what types of errors can't be trapped as exceptions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top