Crashes while exiting from c# application

G

GL

I am getting a crash while exiting from my application. Pl find the
Stack Trace of the crash:

System.Windows.Forms.Application.ThreadWindows.ThreadWindows(System.Windows.Forms.Control
parent = <undefined value>, bool onlyWinForms = true) + 0x8c bytes
system.windows.forms.dll!ThreadContext.DisposeThreadWindows() + 0x54
bytes
system.windows.forms.dll!ThreadContext.Dispose() + 0xa1 bytes
system.windows.forms.dll!ThreadContext.RunMessageLoopInner(int reason =
0xffffffff, System.Windows.Forms.ApplicationContext context =
{System.Windows.Forms.ApplicationContext}) + 0x280 bytes
system.windows.forms.dll!ThreadContext.RunMessageLoop(int reason =
0xffffffff, System.Windows.Forms.ApplicationContext context =
{System.Windows.Forms.ApplicationContext}) + 0x50 bytes
system.windows.forms.dll!System.Windows.Forms.Application.Run

I am not able to reproduce this crash in Debug mode. But this is only
coming in Release mode.

Could anyone help me to resolve this issue?

Thanks,
GL

NOTE: This application calls functions from our unmanaged dll very
frequently.
 
G

GL

hey .. I forgot to notedown the Exception Name. I think, it
ExecutionEngineException (not sure).

Sometime this application gives the following Error dialog
Caption: Setup Error
Message: Failed to load resources

-GL
 
G

GL

hey .. I forgot to notedown the Exception Name. I think, it
ExecutionEngineException (not sure).

Sometime this application gives the following Error dialog
Caption: Setup Error
Message: Failed to load resources
 
T

Truong Hong Thi

There is not enough information to say anything. Is your app
multithreaded? What kinds of unmanaged code does it call? What inside
the forms' closing events? Do you update UI from other thread without
marshaling to the owner thread by using Control.Invoke or
Control.BeginInvoke?
 
T

TT \(Tom Tempelaere\)

Hey GL,

GL said:
hey .. I forgot to notedown the Exception Name. I think, it
ExecutionEngineException (not sure).

Sometime this application gives the following Error dialog
Caption: Setup Error
Message: Failed to load resources

-GL

It also helps to give us some versioning, like
- OS version + any service packs
- .NET Framwork version + any service packs
- Development environment version
- Language + version

Anyway, if it is an ExecutionEngineException it could indicate a bug in the
..NET framework. From the .NET docu for EEE:
<quote>
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.
</quote>

This leads me to my first question:
- 1/ Are you using .NET Framework 1.1?
And second
- 2/ Have you installed SP1 (service pack 1) for .NET Framework 1.1?

If you answer 1/ Yes, 2/ No, then I advise you to install SP1 for .NET
Framework 1.1 and see if that solves your problem. A lot of issues are
solved in that service pack, and most probably your issue too.

Get SP1 for .NET Framework 1.1 here:
http://www.microsoft.com/downloads/...4f-088e-40b2-bbdb-a83353618b38&displaylang=en
Get more info on updates for .NET Framework here:
http://msdn.microsoft.com/netframework/downloads/updates/default.aspx

Tell us if that solved your problem.

Kind regards,
PS: I solved an obstructing ExecutionEngineException in my current dev.
project by upgrading to SP1 for .NET Framework 1.1
 
W

Willy Denoyette [MVP]

GL said:
I am getting a crash while exiting from my application. Pl find the
Stack Trace of the crash:

System.Windows.Forms.Application.ThreadWindows.ThreadWindows(System.Windows.Forms.Control
parent = <undefined value>, bool onlyWinForms = true) + 0x8c bytes
system.windows.forms.dll!ThreadContext.DisposeThreadWindows() + 0x54
bytes
system.windows.forms.dll!ThreadContext.Dispose() + 0xa1 bytes
system.windows.forms.dll!ThreadContext.RunMessageLoopInner(int reason =
0xffffffff, System.Windows.Forms.ApplicationContext context =
{System.Windows.Forms.ApplicationContext}) + 0x280 bytes
system.windows.forms.dll!ThreadContext.RunMessageLoop(int reason =
0xffffffff, System.Windows.Forms.ApplicationContext context =
{System.Windows.Forms.ApplicationContext}) + 0x50 bytes
system.windows.forms.dll!System.Windows.Forms.Application.Run

I am not able to reproduce this crash in Debug mode. But this is only
coming in Release mode.

Could anyone help me to resolve this issue?

Thanks,
GL

NOTE: This application calls functions from our unmanaged dll very
frequently.

The crash is probably due to the call's into unmanaged code, check your
argument types and sizes very carefully, also check your calling
convention(s). Failures in both result in ExecutionEngineExceptions, because
you might overwrite CLR and/or GC structures.

Willy.
 

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