Application goes down with out any wornin.

  • Thread starter Thread starter TPI
  • Start date Start date
T

TPI

I wrote application wich i working on IntPtr.
Whole thing is using Marshal.ReadInt32 and Marshal.WriteInt32.
And sometimes the application shuts down with out any wornings and
exceptions.
With out worninigs and exceptions I do not know where to look up.
I need help with this problem.
 
Hi,

Have you checked the event log?

Why are you using p/invoke ?

what about some tracing?, can you localize the problem, maybe write info to
a file to show the progress so you could find where the problem is.

without more info it's almost impossible to help you

cheers,
 
This is recurrence object, witch i doing some calculations on first one then
is going do the secend one and to the last one then
start again. Whole project is taking IntPtr from the other aplication
(.NET).
Every thing there is recurrency even methodes call it's selef recurrency.

parent-object-child

void method(object)
{
do something;

if(object.child != null)
{
method(object.child);
}
else
{
call evend end();
}
}

This is how this works.

And I do not know how to checked the event log or do some tracing.
I've never done this before.
Would you tell me what to do?


U¿ytkownik "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT
dot.state.fl.us> napisa³ w wiadomo¶ci
 
Hi,

Are you sure all your recursive methods finish correctly? maybe you have
an infinite loop somewhere

Apart from that, d this ( if it does makes sense ) take a sample of the
data you are getting from the other app and use it internally, do not use
the external app

Did you tried to debug it?

cheers,
 
Hi

I put in to main method try block and so far i working with out any
exceptions.
It is working slower but still working. I lost about 200 ms on one cykl.
In try block is working over a day with out any memory increment, and I
think that it's going to work.

With out that block went down sometimes after tree hours - so debugging is
impassable.
Ones I had an infinite loop, but also had an exception.

So fare is working - thaks.
Robert Janda.

U¿ytkownik "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT
dot.state.fl.us> napisa³ w wiadomo¶ci
 
Hi ,

I bet you solve nothing, you are just catching the exception,
do this:
1- use a logger to write to the event viewer any exception you are getting
(below I send you a class you can use )
write Exception.Message and Exception.StackTrace

2- Hook AppDomain.UnhandledException and Application.ThreadException , do
the above logging

The log wrapper:
public class Logger
{
private static System.Diagnostics.EventLog eventLog1;

static public void CreateLog( string msg, EventLogEntryType level)
{
eventLog1.WriteEntry( msg, level);
}
static Logger()
{
//
// TODO: Add constructor logic here
//
eventLog1 = new System.Diagnostics.EventLog();
((System.ComponentModel.ISupportInitialize)(eventLog1)).BeginInit();
//
// eventLog1
//
eventLog1.Log = "Application";
eventLog1.Source = "LaceUP Order Dispatcher";

((System.ComponentModel.ISupportInitialize)(eventLog1)).EndInit();

}
}

cheers,
 
I'll try it?
Thanks.

U¿ytkownik "Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT
dot.state.fl.us> napisa³ w wiadomo¶ci
 
Back
Top