PC Review


Reply
Thread Tools Rate Thread

What causes 'System.ExecutionEngineException' ?

 
 
Tim Mulholland
Guest
Posts: n/a
 
      29th Jan 2004
I have an application that uses an external C(?) Dll and it seems like
after I make a specific call to that dll the application will crash at a
random call to the dll in the future. It sometimes crashes the next call
after said call, while sometimes it doesn't crash for 5 minutes; but it
always crashes.

As long as I don't call tira_get_captured_data it doesn't crash so I am
assuming that is the cause. I get a System.ExecutionEngineException error
in System.Windows.Forms.dll or mscorlib.dll and it does not give me a line
number so I am stuck. The call that seems to be the beginning of the end is
[DllImport("Tira2.dll")] public static extern int tira_get_captured_data(ref
IntPtr data, ref int size); I had to make a few conversions, its original
def is
extern "C" __stdcall int tira_get_captured_data ( const unsigned char**
data, int* size )

Is something wrong with the conversion I made?


Thanks in advance


 
Reply With Quote
 
 
 
 
Tian Min Huang
Guest
Posts: n/a
 
      30th Jan 2004
Hello Tim,

Thanks for your post. As I understand, the problem you are facing is that
it throws System.ExecutionEngineException. Please correct me if there is
any misunderstanding. I'd like to share the following information with you:

1. MSDN documentation describes ExecutionEngineException as:
"The exception that is thrown when there is an internal error in the
execution engine of the common language runtime. This class cannot be
inherited.

Execution engine errors are fatal errors that should never occur. Such
errors occur mainly when the execution engine has been corrupted or data is
missing. The system can throw this exception at any time. When possible,
the system throws an exception that provides more information than the
ExecutionEngineException exception."

ExecutionEngineException Class
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemexecutionengineexceptionclasstopic.asp

2. I reviewed your description carefully, and I suspect that the problem
may be caused by using P/Invoke to call unmanaged API, especially the
"data" parameter. Please check which side (the caller or callee) should
allocate the memory for "data" to call tira_get_captured_data, and make
sure that you marshall the data properly. I believe the following MSDN
articles are helpful:

Consuming Unmanaged DLL Functions
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconConsumingUnmanagedDLLFunctions.asp

Marshaling Data with Platform Invoke
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconmarshalingdatawithplatforminvoke.asp

Marshal Class
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfSystemRuntimeInteropServicesMarshalClassTopic.asp

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
An unhandled exception of type 'System.ExecutionEngineException' occurred in System.Data.dll Stephen Flynn Microsoft VB .NET 3 6th Mar 2007 01:50 PM
System.ExecutionEngineException zfeld Microsoft Dot NET Framework 0 20th Sep 2004 04:32 PM
System.ExecutionEngineException =?Utf-8?B?U2hpanVGcmFuY2lz?= Microsoft Dot NET Framework 1 5th Feb 2004 09:58 PM
What causes 'System.ExecutionEngineException' ? Tim Mulholland Microsoft C# .NET 1 30th Jan 2004 12:41 AM
System.ExecutionEngineException Tony Microsoft C# .NET 0 4th Dec 2003 02:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:19 PM.