Home All Groups Group Topic Archive Search About

Issue with multiple GUI threads on .NET 1.1

Author
6 Jun 2006 11:56 AM
Alexei Adadurov
Hello!

I am writing a desktop application that uses multiple GUI threads to
interact with the user.
Secondary GUI thread creates a main form for this thread, having
application's main form as its parent and calls
System.Windows.Forms.Application.Run() with this newly created form.
The problem is that, under certain conditions (described below) secondary
GUI thread strangely crashes after it has exited the 'threadstart' function.
The crash is 'Unhandled access violation exception' (0xc000000a) in
ntdll.dll with the following call stack:

ntdll.dll!_RtlFreeThreadActivationContextStack@0()  + 0x1eda4
kernel32.dll!_ExitThread@4()  + 0x39
kernel32.dll!_BaseThreadStart@8()  + 0x3d


My environment is .NET 1.1, Microsoft Windows XP SP2.

Condition for crash is that thread crashes only after I create and display a
modal dialog box (another custom form), heaving main form for GUI thread #2
as Parent. This dialog box is used to display messages to the user instead
of System.Windows.Forms.MessageBox (it has enhanced functionality like
"Don't show this anymore" checkbox and timeout timer allowing it to be
dismissed if user haven't clicked any buttons. When I switch back to
System.Windows.Forms.MessageBox everything is fine.

As this issue occurs in a big solution, I created new simple little
CrashTest Project to isolate and simulate this behavior, but so far I
haven't succeeded.

Does anyone know what could cause this behaviour?

Best regards,
Alexei N. Adadurov

(alexei.adadurov at super-lab dot ru)

Author
6 Jun 2006 3:13 PM
Brian Gideon
Alexei,

I think you're just going to have to start plugging pieces into the
CrashTest project until you get the crash you're looking for.

Try running the application on another machine.

This sounds like a particularly difficult problem to troubleshoot.

Brian

Alexei Adadurov wrote:
Show quote
> Hello!
>
> I am writing a desktop application that uses multiple GUI threads to
> interact with the user.
> Secondary GUI thread creates a main form for this thread, having
> application's main form as its parent and calls
> System.Windows.Forms.Application.Run() with this newly created form.
> The problem is that, under certain conditions (described below) secondary
> GUI thread strangely crashes after it has exited the 'threadstart' function.
> The crash is 'Unhandled access violation exception' (0xc000000a) in
> ntdll.dll with the following call stack:
>
> ntdll.dll!_RtlFreeThreadActivationContextStack@0()  + 0x1eda4
> kernel32.dll!_ExitThread@4()  + 0x39
> kernel32.dll!_BaseThreadStart@8()  + 0x3d
>
>
> My environment is .NET 1.1, Microsoft Windows XP SP2.
>
> Condition for crash is that thread crashes only after I create and display a
> modal dialog box (another custom form), heaving main form for GUI thread #2
> as Parent. This dialog box is used to display messages to the user instead
> of System.Windows.Forms.MessageBox (it has enhanced functionality like
> "Don't show this anymore" checkbox and timeout timer allowing it to be
> dismissed if user haven't clicked any buttons. When I switch back to
> System.Windows.Forms.MessageBox everything is fine.
>
> As this issue occurs in a big solution, I created new simple little
> CrashTest Project to isolate and simulate this behavior, but so far I
> haven't succeeded.
>
> Does anyone know what could cause this behaviour?
>
> Best regards,
> Alexei N. Adadurov
>
> (alexei.adadurov at super-lab dot ru)

AddThis Social Bookmark Button