Crash without dump file

D

Droopy

Hi,

I am running an application on 74 PC (1 instance on each PC).
This morning, 2 applications crashes.
There were neither popup windows signaling it nor dump file created.
I only find in the event log an entry signaling a dotnet 2.0 runtime
error :

Event Type: Error
Event Source: .NET Runtime 2.0 Error Reporting
Event Category: None
Event ID: 1000
Date: 5/05/2006
Time: 7:40:20
User: N/A
Computer: IPD51140
Description:
Faulting application ipdrouting.exe, version 2.0.13.29189, stamp
445a19fb, faulting module unknown, version 0.0.0.0, stamp 00000000,
debug? 0, fault address 0x00902190.

For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.
Data:
0000: 41 00 70 00 70 00 6c 00 A.p.p.l.
0008: 69 00 63 00 61 00 74 00 i.c.a.t.
0010: 69 00 6f 00 6e 00 20 00 i.o.n. .
0018: 46 00 61 00 69 00 6c 00 F.a.i.l.
0020: 75 00 72 00 65 00 20 00 u.r.e. .
0028: 20 00 69 00 70 00 64 00 .i.p.d.
0030: 72 00 6f 00 75 00 74 00 r.o.u.t.
0038: 69 00 6e 00 67 00 2e 00 i.n.g...
0040: 65 00 78 00 65 00 20 00 e.x.e. .
0048: 32 00 2e 00 30 00 2e 00 2...0...
0050: 31 00 33 00 2e 00 32 00 1.3...2.
0058: 39 00 31 00 38 00 39 00 9.1.8.9.
0060: 20 00 34 00 34 00 35 00 .4.4.5.
0068: 61 00 31 00 39 00 66 00 a.1.9.f.
0070: 62 00 20 00 69 00 6e 00 b. .i.n.
0078: 20 00 75 00 6e 00 6b 00 .u.n.k.
0080: 6e 00 6f 00 77 00 6e 00 n.o.w.n.
0088: 20 00 30 00 2e 00 30 00 .0...0.
0090: 2e 00 30 00 2e 00 30 00 ..0...0.
0098: 20 00 30 00 30 00 30 00 .0.0.0.
00a0: 30 00 30 00 30 00 30 00 0.0.0.0.
00a8: 30 00 20 00 66 00 44 00 0. .f.D.
00b0: 65 00 62 00 75 00 67 00 e.b.u.g.
00b8: 20 00 30 00 20 00 61 00 .0. .a.
00c0: 74 00 20 00 6f 00 66 00 t. .o.f.
00c8: 66 00 73 00 65 00 74 00 f.s.e.t.
00d0: 20 00 30 00 30 00 39 00 .0.0.9.
00d8: 30 00 32 00 31 00 39 00 0.2.1.9.
00e0: 30 00 0d 00 0a 00 0.....

It is exactly the same on both PC (same .
stamp, same fault address).
I have no idea how to analyse this message.
Besides, I have no clue where to search.
I added the following code in my Main function to try to get some
informations from the source of the problem :

Application.ThreadException +=
new System.Threading.ThreadExceptionEventHandler
(Application_ThreadException);
AppDomain.CurrentDomain.UnhandledException +=
new UnhandledExceptionEventHandler
(CurrentDomain_UnhandledException);

functions code:

private static void Application_ThreadException (object sender,
System.Threading.ThreadExceptionEventArgs e)
{
try
{
System.IO.StreamWriter sw = new System.IO.StreamWriter
("IpdRouting_DUMP.LOG", true);
sw.WriteLine(System.DateTime.Now.ToShortDateString() + " @ " +
System.DateTime.Now.ToLongTimeString() + ">\t" +
e.Exception.Source + " /// " + e.Exception.Message);
sw.Close();
}
catch
{
Application.Exit();
}
}

private static void CurrentDomain_UnhandledException (object sender,
UnhandledExceptionEventArgs e)
{
try
{
string message = e.ExceptionObject.ToString();
if(message.ToUpper().IndexOf("THREADABORTEXCEPTION") == -1)
{
System.IO.StreamWriter sw = new System.IO.StreamWriter
("IpdRouting_Unhandled.LOG", true);
sw.WriteLine (System.DateTime.Now.ToShortDateString () + " @
" +
System.DateTime.Now.ToLongTimeString () + ">\t" +
message);
Exception ex = e.ExceptionObject as Exception;
if (ex != null)
{
sw.WriteLine (System.DateTime.Now.ToShortDateString () +
" @ " +
System.DateTime.Now.ToLongTimeString () + ">\t" +
ex.StackTrace);
if (ex.InnerException != null)
sw.WriteLine (ex.InnerException.ToString ());
}
sw.Flush ();
sw.Close ();
}
}
catch
{
//Application.Exit();
}
}

Application_ThreadException is not triggered.
CurrentDomain_UnhandledException is triggered for both PC, with the same
following lines in file 'IpdRouting_Unhandled.LOG' (only hour is
different) :

5/05/2006 @ 7:40:18> System.NullReferenceException: Object reference not
set to an instance of an object.
5/05/2006 @ 7:40:18>

To be complete, I had a System.AccessViolationException exception in
previous crash. I added the following line in my config file in <runtime>
Element :

<legacyNullReferenceExceptionPolicy enabled = "1">

9 PC use unmanaged code to handle serial COM ports and never crash !
The 65 other PC don't use unmanaged code and some crash !

Is it possible to get a stack trace when my application crash ?

Sorry for this long message.

Thanks in advance.

I
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Compile it in debug mode and deploy the .pdb files .

Additionally you can not handle the event and the framework will dump the
stacktrace in the console
so an alternative method could be run the program from the prompt and see
the message you are getting.

As per your description it seems that you have some problem in your managed
code. you are accesing a member of an instance that is null
 
D

Droopy

Hi,

Compile it in debug mode and deploy the .pdb files .

Additionally you can not handle the event and the framework will dump
the stacktrace in the console
so an alternative method could be run the program from the prompt and
see the message you are getting.

As per your description it seems that you have some problem in your
managed code. you are accesing a member of an instance that is null

OK thanks a lot for this very quick answer.
I will try and let you know the results.
 
W

Willy Denoyette [MVP]

Remove this from your config file:
<legacyNullReferenceExceptionPolicy enabled = "1">

Enumerate over the exception object in your UE handler get the exception
message and stacktrace and dump the contents to a log file or the eventlog.
...
StringBuilder sb = new StringBuilder(2048);
Exception currentExc = null;
for (currentExc = (Exception)e.ExceptionObject; currentExc != null;
currentExc = currentExc.InnerException) {
sb.AppendFormat("0}\r\n{1}\r\n{2}",
currentExc.GetType().FullName,
currentEx .Message,
currentExc.StackTrace);
}

Willy.

| Hi,
|
| I am running an application on 74 PC (1 instance on each PC).
| This morning, 2 applications crashes.
| There were neither popup windows signaling it nor dump file created.
| I only find in the event log an entry signaling a dotnet 2.0 runtime
| error :
|
| Event Type: Error
| Event Source: .NET Runtime 2.0 Error Reporting
| Event Category: None
| Event ID: 1000
| Date: 5/05/2006
| Time: 7:40:20
| User: N/A
| Computer: IPD51140
| Description:
| Faulting application ipdrouting.exe, version 2.0.13.29189, stamp
| 445a19fb, faulting module unknown, version 0.0.0.0, stamp 00000000,
| debug? 0, fault address 0x00902190.
|
| For more information, see Help and Support Center at
| http://go.microsoft.com/fwlink/events.asp.
| Data:
| 0000: 41 00 70 00 70 00 6c 00 A.p.p.l.
| 0008: 69 00 63 00 61 00 74 00 i.c.a.t.
| 0010: 69 00 6f 00 6e 00 20 00 i.o.n. .
| 0018: 46 00 61 00 69 00 6c 00 F.a.i.l.
| 0020: 75 00 72 00 65 00 20 00 u.r.e. .
| 0028: 20 00 69 00 70 00 64 00 .i.p.d.
| 0030: 72 00 6f 00 75 00 74 00 r.o.u.t.
| 0038: 69 00 6e 00 67 00 2e 00 i.n.g...
| 0040: 65 00 78 00 65 00 20 00 e.x.e. .
| 0048: 32 00 2e 00 30 00 2e 00 2...0...
| 0050: 31 00 33 00 2e 00 32 00 1.3...2.
| 0058: 39 00 31 00 38 00 39 00 9.1.8.9.
| 0060: 20 00 34 00 34 00 35 00 .4.4.5.
| 0068: 61 00 31 00 39 00 66 00 a.1.9.f.
| 0070: 62 00 20 00 69 00 6e 00 b. .i.n.
| 0078: 20 00 75 00 6e 00 6b 00 .u.n.k.
| 0080: 6e 00 6f 00 77 00 6e 00 n.o.w.n.
| 0088: 20 00 30 00 2e 00 30 00 .0...0.
| 0090: 2e 00 30 00 2e 00 30 00 ..0...0.
| 0098: 20 00 30 00 30 00 30 00 .0.0.0.
| 00a0: 30 00 30 00 30 00 30 00 0.0.0.0.
| 00a8: 30 00 20 00 66 00 44 00 0. .f.D.
| 00b0: 65 00 62 00 75 00 67 00 e.b.u.g.
| 00b8: 20 00 30 00 20 00 61 00 .0. .a.
| 00c0: 74 00 20 00 6f 00 66 00 t. .o.f.
| 00c8: 66 00 73 00 65 00 74 00 f.s.e.t.
| 00d0: 20 00 30 00 30 00 39 00 .0.0.9.
| 00d8: 30 00 32 00 31 00 39 00 0.2.1.9.
| 00e0: 30 00 0d 00 0a 00 0.....
|
| It is exactly the same on both PC (same .
| stamp, same fault address).
| I have no idea how to analyse this message.
| Besides, I have no clue where to search.
| I added the following code in my Main function to try to get some
| informations from the source of the problem :
|
| Application.ThreadException +=
| new System.Threading.ThreadExceptionEventHandler
| (Application_ThreadException);
| AppDomain.CurrentDomain.UnhandledException +=
| new UnhandledExceptionEventHandler
| (CurrentDomain_UnhandledException);
|
| functions code:
|
| private static void Application_ThreadException (object sender,
| System.Threading.ThreadExceptionEventArgs e)
| {
| try
| {
| System.IO.StreamWriter sw = new System.IO.StreamWriter
| ("IpdRouting_DUMP.LOG", true);
| sw.WriteLine(System.DateTime.Now.ToShortDateString() + " @ " +
| System.DateTime.Now.ToLongTimeString() + ">\t" +
| e.Exception.Source + " /// " + e.Exception.Message);
| sw.Close();
| }
| catch
| {
| Application.Exit();
| }
| }
|
| private static void CurrentDomain_UnhandledException (object sender,
| UnhandledExceptionEventArgs e)
| {
| try
| {
| string message = e.ExceptionObject.ToString();
| if(message.ToUpper().IndexOf("THREADABORTEXCEPTION") == -1)
| {
| System.IO.StreamWriter sw = new System.IO.StreamWriter
| ("IpdRouting_Unhandled.LOG", true);
| sw.WriteLine (System.DateTime.Now.ToShortDateString () + " @
| " +
| System.DateTime.Now.ToLongTimeString () + ">\t" +
| message);
| Exception ex = e.ExceptionObject as Exception;
| if (ex != null)
| {
| sw.WriteLine (System.DateTime.Now.ToShortDateString () +
| " @ " +
| System.DateTime.Now.ToLongTimeString () + ">\t" +
| ex.StackTrace);
| if (ex.InnerException != null)
| sw.WriteLine (ex.InnerException.ToString ());
| }
| sw.Flush ();
| sw.Close ();
| }
| }
| catch
| {
| //Application.Exit();
| }
| }
|
| Application_ThreadException is not triggered.
| CurrentDomain_UnhandledException is triggered for both PC, with the same
| following lines in file 'IpdRouting_Unhandled.LOG' (only hour is
| different) :
|
| 5/05/2006 @ 7:40:18> System.NullReferenceException: Object reference not
| set to an instance of an object.
| 5/05/2006 @ 7:40:18>
|
| To be complete, I had a System.AccessViolationException exception in
| previous crash. I added the following line in my config file in <runtime>
| Element :
|
| <legacyNullReferenceExceptionPolicy enabled = "1">
|
| 9 PC use unmanaged code to handle serial COM ports and never crash !
| The 65 other PC don't use unmanaged code and some crash !
|
| Is it possible to get a stack trace when my application crash ?
|
| Sorry for this long message.
|
| Thanks in advance.
|
| I
 
D

Droopy

Remove this from your config file:
<legacyNullReferenceExceptionPolicy enabled = "1">

Enumerate over the exception object in your UE handler get the
exception message and stacktrace and dump the contents to a log file
or the eventlog. ..
StringBuilder sb = new StringBuilder(2048);
Exception currentExc = null;
for (currentExc = (Exception)e.ExceptionObject; currentExc !=
null;
currentExc = currentExc.InnerException) {
sb.AppendFormat("0}\r\n{1}\r\n{2}",
currentExc.GetType().FullName,
currentEx .Message,
currentExc.StackTrace);
}

Willy.

OK I will try.
Thanks a lot.
 
D

Droopy

It doesn't help, I got no stack trace and no inner exception :-(

I am using 4 Hashtables internally (kind of business objects).
Each enumeration, Add or Remove is surrounded by a lock
(hashtable.SyncRoot).
To display these datas in GUI, each object has a static member that returns
the Hashtable using the Clone () method.
Then the GUI enumerate this cloned hashtable, without lock this time.
Is it the correct way of using and displaying Hashtables ?

Any help would be greatly appreciated.
Thanks in advance.
 
D

Droopy

I am using 4 Hashtables internally (kind of business objects).
Each enumeration, Add or Remove is surrounded by a lock
(hashtable.SyncRoot).
To display these datas in GUI, each object has a static member that
returns the Hashtable using the Clone () method.
Then the GUI enumerate this cloned hashtable, without lock this time.
Is it the correct way of using and displaying Hashtables ?

Any help would be greatly appreciated.
Thanks in advance.

I found an invalid casting.
I add many try/catch.
Now, it seems there is no more crash.
But still, every night, 1 or 2 PC displayed a popup window signaling that a
problem occured and that the application must be closed.
My application is still running but will be closed if the user click the OK
button.
Is it possible to prevent this window from displaying until I find the bug
?
Can I analyse the event log message reporting a dotnet runtime error ?

Thanks in advance.
 
D

Droopy

I found an invalid casting.
I add many try/catch.
Now, it seems there is no more crash.
But still, every night, 1 or 2 PC displayed a popup window signaling
that a problem occured and that the application must be closed.
My application is still running but will be closed if the user click
the OK button.
Is it possible to prevent this window from displaying until I find the
bug ?
Can I analyse the event log message reporting a dotnet runtime error ?

Thanks in advance.

Last precision, I found this Exception catched in my main form :

2006-05-10 06:54:26,076 [IpdRouting main ] ERROR IpdRouting -
DisplayRoutingTablePc: exception catched System.NullReferenceException:
Object reference not set to an instance of an object.
at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef
hWnd, Int32 Msg, IntPtr wParam, ListViewCompareCallback pfnCompare)
at System.Windows.Forms.ListView.Sort()
at System.Windows.Forms.ListView.InsertItems(Int32 displayIndex,
ListViewItem[] items, Boolean checkHosting)
at System.Windows.Forms.ListView.ListViewNativeItemCollection.Add
(ListViewItem value)
at System.Windows.Forms.ListView.ListViewItemCollection.Add
(ListViewItem value)
at IpdRouting.FormMain.DisplayRoutingTablePc() in C:\Projects
\IpdRouting\IpdRouting\FormMain.cs:line 775


private void DisplayRoutingTablePc ()
{
try
{
int hostsUp = 0;
listViewPc.BeginUpdate ();
listViewPc.Items.Clear ();
foreach (DictionaryEntry de in
HostRouter.Current.PcHosts)
{
PcHost pc = (PcHost) de.Value;
ListViewItem lvi = new ListViewItem
(pc.HostId.ToString ());
lvi.SubItems.Add (pc.IpAddress.ToString ());
lvi.SubItems.Add (GetWatchDogAnswerText (pc));
ListViewItem.ListViewSubItem status;
if (pc.Message.Length <= 0)
status = lvi.SubItems.Add (pc.Status.ToString
());
else
status = lvi.SubItems.Add (string.Format ("{0} -
{1}",
pc.Status.ToString (), pc.Message));

if (pc.Status != HostStatus.Undefined)
lvi.UseItemStyleForSubItems = false;
switch (pc.Status)
{
case HostStatus.HostUp:
status.BackColor = Color.LightGreen;
hostsUp++;
break;

case HostStatus.HostDown:
case HostStatus.ConnectionFailed:
status.BackColor = Color.Red;
break;

case HostStatus.ConnectingStartUp:
case HostStatus.ConnectingRouting:
case HostStatus.ConnectingWatchDog:
status.BackColor = Color.Orange;
break;
}
listViewPc.Items.Add (lvi); // LINE 775
}

listViewPc.EndUpdate ();
labelPcCount.Text = "PC Count = " +
listViewPc.Items.Count.ToString ();
labelPcsUp.Text = "PC Up Count = " + hostsUp.ToString ();
labelPcsUpG.Text = labelPcsUp.Text;
}
catch (Exception ex)
{
if (_logger.IsErrorEnabled)
_logger.Error ("DisplayRoutingTablePc: exception
catched " +
ex);
}
}
 

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