Application crashes ignoring try{...}catch{...}

A

Alexey Kouzmitch

Hi,

I wrote a console application which is called from a SQL Server job. The
application utilizes a COM object, to pump data from a legacy (not very old
however) application to SQL server. The application works fine, but once in
a while it fails with the following message written to the event log:

-----------------------------------------------------------------------
The description for Event ID ( 0 ) in Source ( .NET
Runtime ) cannot be found. The local computer may not have
the necessary registry information or message DLL files to
display messages from a remote computer. The following
information is part of the event: .NET Runtime version
1.1.4322.0-
<application name>.exe -
Common Language Runtime Debugging Services: Application
has generated an exception that could not be handled.

Process id=0xce8 (3304), Thread id=0xdf4 (3572).
-----------------------------------------------------------------------

The application wraps ALL of its code in a try...catch... block and then
writes a log entry in the catch. That doesn't get called when this happens.
It seems as if the application is just stopped w/o it knowing it and an
error generated in the runtime.

The error doesn't seem to have a pattern, and a repeat run of the program
would work.

What could be causing this? How can I get more information on the error? Is
there a way to make the program generate a core dump file to see what the
exception was and where exactly it had happened?

Thanks.

-Alexey.
 
T

TB

Alexey Kouzmitch said:
Hi,

I wrote a console application which is called from a SQL Server job. The
application utilizes a COM object, to pump data from a legacy (not very old
however) application to SQL server. The application works fine, but once in
a while it fails with the following message written to the event log:

-----------------------------------------------------------------------
The description for Event ID ( 0 ) in Source ( .NET
Runtime ) cannot be found. The local computer may not have
the necessary registry information or message DLL files to
display messages from a remote computer. The following
information is part of the event: .NET Runtime version
1.1.4322.0-
<application name>.exe -
Common Language Runtime Debugging Services: Application
has generated an exception that could not be handled.

Process id=0xce8 (3304), Thread id=0xdf4 (3572).
-----------------------------------------------------------------------

The application wraps ALL of its code in a try...catch... block and then
writes a log entry in the catch. That doesn't get called when this happens.
It seems as if the application is just stopped w/o it knowing it and an
error generated in the runtime.

The error doesn't seem to have a pattern, and a repeat run of the program
would work.

What could be causing this? How can I get more information on the error? Is
there a way to make the program generate a core dump file to see what the
exception was and where exactly it had happened?

Thanks.

-Alexey.


Sorry Alexey, but I don't have an answer. I wanted to add my plea for
help because I think I'm seeing something similar.

I have some legacy C++ DLLs that I have to access through the
Runtime.Interop service and occasionally (but not always) I get an
exception thrown on the call to the imported routine that complains
about an object reference being null.

So that you don't think it's the fault of some buggy code in the
legacy DLLs, note that I also added imports for
QueryPerformanceCounter and QueryPerformanceFrequency to do some
performance timing and they, too, will occasionally generate this
exception.

It's as if the dynamic link to the imported function is getting
stomped on and nulled out so that the function call itself is somehow
generating the exception, not the called function (if that makes
sense).

-- TB
 
R

Rahul Kapoor

can you install windows debugging tools on this machine?
if you can (you just need to xcopy them) it includes a vb script call adplus
which you can run to monitor an application for fatal errors, when a fatal
error occurs this create a dmp file which you can look at to ascertain the
exact cause of the crash

Rahul

(e-mail address removed)
 

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