Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

System.ExecutionEngineException for certificate object creation

60 views
Skip to first unread message

Sushant Bhatia

unread,
May 2, 2005, 12:35:10 PM5/2/05
to
Hi All.

I am using the SecureBlackBox class to create a new X509 certificate.

SBX509.TElX509Certificate certUsr = new SBX509.TElX509Certificate();
certUser.LoadFromBuffer(certData);

This works fine in some areas of my code but all of a sudden, a certain
part of my code is throwing a System.ExecutionEngineException on that
line. I debugged it and went over my code line by line and this is the
exception info.

I have no idea what to do. Funny thing is that my try-catch doesn't
catch this.

Any suggestions????
Cheers.
Sushant Bhatia

- System.Exception {"Exception of type System.ExecutionEngineException
was thrown." } System.Exception
System.Object {System.ExecutionEngineException} System.Object
_className "System.ExecutionEngineException" string
_COMPlusExceptionCode -532459699 int
_exceptionMethod <undefined value> System.Reflection.MethodBase
_exceptionMethodString null string
_helpURL null string
_HResult -2146233082 int
_innerException { } System.Exception
_message null string
_remoteStackIndex 0 int
_remoteStackTraceString null string
_source null string
_stackTrace <undefined value> System.Object
_stackTraceString null string
_xcode -532459699 int
_xptrs 0 int
HelpLink null string
HResult -2146233082 int
InnerException { } System.Exception
Message "Exception of type System.ExecutionEngineException was
thrown." string
Source null string
StackTrace null string
TargetSite <undefined value> System.Reflection.MethodBase

Yunus Emre ALPÖZEN [MCAD.NET]

unread,
May 2, 2005, 2:05:25 PM5/2/05
to
Just copied from MSDN library,

"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"

:)
I think it is a bug. You should submit it !!

--

Thanks,
Yunus Emre ALPÖZEN
BSc, MCAD.NET

"Sushant Bhatia" <sushant...@gmail.com> wrote in message
news:1115051710....@g14g2000cwa.googlegroups.com...

Joe Kaplan (MVP - ADSI)

unread,
May 2, 2005, 2:17:56 PM5/2/05
to
If I had to guess, I would say that the SecureBlackBox product corrupted the
managed heap with some interop or p/invoke that went wrong. In any event,
you would need to take this to them first as MS won't touch it directly
since it happened in a third party component (I don't think).

Joe K.

"Yunus Emre ALPÖZEN [MCAD.NET]" <ye...@msakademik.net> wrote in message
news:u59QAG0T...@TK2MSFTNGP15.phx.gbl...

Sushant Bhatia

unread,
May 2, 2005, 9:08:37 PM5/2/05
to
Hi Yunus & Joe,

I don't think its a SecureBlackBox issue because I am using the very
same call throughout my application in different functions. Its only
this specific call to object creation that is throwing the exception.
If I comment it out, no exception is thrown. The application is a
Client/Server chat program and the exception is being thrown in one
chat client. I used the very same object creation call in the server
right before I send the data to see if its an issue with SecureBlackBox
and it worked fine.

I don't think the CLR is corrupted because it runs all the application
I have as normal.

2 follow up questions:-

-A friend of mine suggested that I compile the code above for release
instead of debug as I am doing now because the CLR for release is
"different" to the debug CLR. Is this true? Is there "really" a
different CLR for release and debug?

-Another friend suggested I look at the stack size to see if there were
any issues in there. Can the ExecutionEngineException be thrown because
of Stack "miscalculations"?

I will try this on another machine to see if it still throws the
exception. I'll post a bit later with the results of that.

Thanks for your replies.
Sushant Bhatia

Joe Kaplan (MVP - ADSI)

unread,
May 2, 2005, 11:25:19 PM5/2/05
to
I'm not sure how you can conclude that the vendor component is not at fault
here just because it works some of the time. These types of errors tend to
be hard to track down and there might be a combination of symptoms that
causes the problem.

Changing to a release build might help with the problem (l've seen that
before personally), but that does not bode well that the problem is solved.
Still, it is worth a shot.

If stack SIZE was an issue, you would probably have gotten a
StackOverflowException like you get from infinite recursion and such. I'm
still betting on some kind of corruption that happened due to some unmanaged
code doing something to memory that it should not have.

The classic way to debug this would be to use a lower level debugger like
windbg with the SOS extension loaded, but there is steep learning curve
there if you are not already skilled. I can't be of any assistance with
that. You might consider posting on the dotnet.framework.clr newsgroup to
see if they have any suggestions as a lot of the more hard core CLR guys
hang out there.

Best of luck,

Joe K.


"Sushant Bhatia" <sushant...@gmail.com> wrote in message

news:1115082517.7...@z14g2000cwz.googlegroups.com...

Sushant Bhatia

unread,
May 3, 2005, 6:03:20 PM5/3/05
to
Joe you were right! :-) It is the SecureBlackBox.dll

For some reason, when the same code at home (without recompiling) I get
errors for the initialization. I posted the errors caught at

http://temphome.mine.nu/blogs/ankh_morporks_finest_coder_ii/archive/2005/05/03/208.aspx

Its wierd that my school machine thrown the ExecutionEngineException
but my home machine is able to catch the specific cause.

I still have no idea what the exception actually "means". I know the
cctor() function is a class constructor function but why should a
constructor which takes no parameters throw a
TypeInitializationException->NullReferenceException unless something
internal was being initalized. And why won't this error be thrown
everytime the constructor is called?

Joe Kaplan (MVP - ADSI)

unread,
May 3, 2005, 6:22:17 PM5/3/05
to
Have you reverse compiled it with reflector to see what is in the cctor? It
might be unmanaged code which you might not be able to see, but perhaps you
can get more info.

My guess is that it is still memory corruption do to some bad pointer stuff.
NullReferenceExceptions in unmanaged code sometimes indicate other types of
pointer problems than a simple null reference.

I'd go to the vendor, especially if you can create a repro. Sending them a
crash dump of the process should help.

Joe K.

"Sushant Bhatia" <sushant...@gmail.com> wrote in message

news:1115157800.7...@o13g2000cwo.googlegroups.com...

Sushant Bhatia

unread,
May 3, 2005, 6:32:51 PM5/3/05
to
Thanks Joe. I am trying to write a bug report for them.

0 new messages