Application crashes with native exception

G

Guest

I have an application in windows mobile smartphone 5.0 that is generating a
'native exception' errorr andomly and closing the application/crashing.
It displays exception code and exception address.The exception address keeps
on changing but three exception codes keeps on coming randomly .Those
exception codes are : 0x80000002, 0xc0000005 and 0xc000001d

If try to trace it out through debugging it displays " the remote connection
to the application is broken " and the application stops by pressing ok.


I was wondering if anyone has any idea's or tips with regards to
tracking this issue down and resolving it?

My questions are as follows:

1. Is there a way to trap/break on a native exception, as we are hoping
to stack trace back; to find the offending code/issue?

2. Does anyone have any tips to help us track down this problem or has
anyone come across a similar problem?

3. If there are some memory leaks how to trace it ?

4. Is there any tool for tracing this behaviour for windows mobile 5.0

Any help would be greatly appreciated.
 
P

Peter Foot [MVP]

Error 0x80000002 is ran out of memory. Likely culprits in your code are
anywhere you are allocating native memory or marshalling structures between
managed and native memory. Also look for memory intensive operations in your
code - loading images and datasets for example. Make sure you have the
latest service pack for the .NETCF version you are using - SP3 for .NETCF
1.0 and SP1 for .NETCF 2.0

Peter
 
T

Tomer Gabel

Hello Kripa,

My experience leads me to believe that mixed (native/managed) debugging just
doesn't work with VS2k5 on Windows Mobile. What we usually do is to Set As
Startup Project the native/managed projects according to what we wish to
debug. Regarding how to track it down, you can forget about getting an accurate
stack trace -- just use System.Diagnostics.Debug.WriteLine to track down
which call to native code (from the managed code, usually via P/Invoke or
COM) caused the problem.

Welcome to the wonderful world of .NET CF :)

Regards,
Tomer Gabel (http://www.tomergabel.com)
Monfort Software Engineering Ltd. (http://www.monfort.co.il)
 
P

Paul G. Tobey [eMVP]

Yes, that's true. There's no native/managed debugging support, at this
point. I think that this will happen and I haven't yet tried Orcas, so
maybe it already has, but it's a lot of work for a small team who is also
working on the next version of .NET CF, etc., etc.

Paul T.
 
G

Guest

Hi there,

Hope you'll bear with me as I'm totally new to WinCE.NET programming. You
say "just use System.Diagnostics.Debug.WriteLine to track down
which call to native code (from the managed code, usually via P/Invoke or
COM) caused the problem." The 0xc0000005 error we're getting appears only
occasionally and usually in different places. Is there maybe some type of
routine I could write that would at least note when the error occurs? We
think it might be related to our communications but are not sure.

Also, all the research I've done on this issue points to a problem in C
code. The application I took over is written in VB.NET but it uses a C
application for the communications. Is this 0xc0000005 error something that
only happens in C code or could it also happen in VB code? Just trying to
narrow down what might be causing the probelm. Thanks!
 

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