Home Dashboard Directory Help
Search

Crash (Stackoverflow) on application exit by Alois


Status: 

Closed
 as Fixed Help for as Fixed


6
0
Sign in
to vote
Type: Bug
ID: 764933
Opened: 9/27/2012 6:47:56 AM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

When a thread is in a wait state when the Main method is left but shortly before a thread.Interrupt was called on it it can happen that the other thread is causing a crash due to a bug in the error handling of the CLR.

During the shutdown the CLR assumes that no thread does wake up anymore. But if the Finalizer thread is stuck this race conditon does surface. Since Thread.Interrupt is asynchronous the CLR thinks that after the Main method has been left that all threads are not running anymore. But the other Thread is waken up again from the Wait state at a time where important CLR structure seem to be already missing.

This does occur only with 4.0 (x64 and x86). On 3.5 and 4.5 I was not able to repro it.

Details
Sign in to post a comment.
Posted by Microsoft on 1/23/2013 at 9:49 AM
Thank you for reporting this. The stack overflow was due to an error in the CLR's wait logic, which caused it to honor Thread.Interrupt (and other signals) during shutdown, sending the thread into infinite recursion. As you have noted, this should not be the case in .NET 4.5, as we have fixed this bug. If this is a blocking issue for you, I would recommend upgrading to 4.5.

Thanks again,
Eric Eilebrecht
SDE - CLR.
Posted by Microsoft on 9/28/2012 at 12:31 AM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 9/27/2012 at 6:50 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
File Name Submitted By Submitted On File Size  
ConsoleApplication1 (2).zip 9/27/2012 22 KB