Groups | Blog | Home
all groups > dotnet clr > october 2003 >

dotnet clr : Application crashes ignoring try{...}catch{...}


Alexey Kouzmitch
10/31/2003 10:00:09 AM
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.


tbrown92030 NO[at]SPAM kaxy.com
10/31/2003 3:00:34 PM
[quoted text, click to view]


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).

mikegreonline NO[at]SPAM microsoft.com
11/1/2003 12:20:18 AM
Alexey,

I'm sorry but I really don't know what could be going on. Do you know where
the exception is being thrown from? One thing to try would be to run the
application under a debugger and when the exception occurs you should be
able to see what type of exception it is. How is the console application
being called from SQL?

Thanks,

Michael Green
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only.
Alexey Kouzmitch
11/3/2003 9:03:21 AM
Well,

That's the problem. I have no idea where the exception occurs. It seems that
the process jsut gets killed. The application is called from SQL with
'xp_cmdshell' stored procedure. It works fine one run, and not the other. It
is part of a data population process. But data seems to have no impact,
since it will run over the data it had failed for if ran again. I can't run
it under the debugger, since the setup is in the client's environment and
the problem is so intermittent.

How can I get more info on the process? How do I force a core dump to be
generated?

Thanks,

Alexey,


[quoted text, click to view]

Ben Rush
11/3/2003 12:14:16 PM
I have seen the error shown in the event log when my event source wasn't
registered properly on the machine - so I couldn't write to the event log.
Maybe I'm misreading the post (and if I am I apologize), but is it possible
that the reason you can't scope out the exception is because event logging
isn't working properly, and so the real exception isn't being logged but
instead an exception that is representative of the fact that your event
source isn't properly registered is being logged?

Again, I'm sorry if I'm giving you data that may be redundant with your
knowledge already, but drill to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\

and make sure you're registered.



[quoted text, click to view]

Alexey Kouzmitch
11/3/2003 1:38:34 PM
It is registered. And I get logging from the application when it runs
properly. At this point I only wish it was that easy :). Thank you for your
comment.

Alexey.


[quoted text, click to view]

kwendex NO[at]SPAM yahoo.com
11/3/2003 8:21:51 PM
I don't know a whole lot about logging, but is it possible that a
seperate application that isn't registered may throw an exception,
something that executes as a result of your code, thereby causing this
to be generated.

This is an interesting problem, please post if you get an answer.

Thanks,
Ben


[quoted text, click to view]
Rahul Kapoor
11/5/2003 8:31:50 PM
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

r_ahu_l@nospam.yahoo.com
[quoted text, click to view]

keyur shah
11/6/2003 12:22:08 AM
For the problem/issue on server which doesnt have a definite pattern,,,,
you need to attach debugger to the server/iis and then we can look at
the debugger results to figure out what did really happen.

We used to get a lot of help from the dump of the debugger.

Keyur Shah
Verizon Communications
732-423-0745

*** Sent via Developersdex http://www.developersdex.com ***
AddThis Social Bookmark Button