Connect: VS2013 reports incorrect thread exit code - by redtracy

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


16
0
Sign in
to vote
ID 812144 Comments
Status Closed Workarounds
Type Bug Repros 4
Opened 12/20/2013 3:21:27 PM
Access Restriction Public

Description

See the attached example program.
I start a worker thread which runs for a while and then exits normally.
VS2010 reports in the debugger Output window "The thread 'Test' <id> has exited with code 0 (0x0)"
VS2013 reports in the debugger Output window "The thread <id> has exited with code 259 (0x103)"
Sign in to post a comment.
Posted by Microsoft on 2/25/2015 at 2:41 PM
This was fixed in Visual Studio 2015 and the fix should be present in CTP 3 onward (including Visual Studio 2015 Preview).
Given the nature of the bug the workaround is that "259 (0x103)" always means exit code "0 (0x0)". STILL_ACTIVE (259) means that execution of managed code has exited on the given thread but that the Common Language Runtime has decided to keep the underlying native thread for possible future reuse.
The official guidance is not to use 259 as an error code for exiting threads or processes, see "Remarks" in GetExitCodeThread / GetExitCodeProcess functions ( https://msdn.microsoft.com/en-us/library/windows/desktop/ms683190(v=vs.85).aspx / https://msdn.microsoft.com/en-us/library/windows/desktop/ms683189(v=vs.85).aspx ).

--Patrick
Visual Studio Debugger Team
Posted by ShawnInder on 2/25/2015 at 4:52 AM
@Patrick
In which version of Visual Studio will this be fixed? When is this version coming out? Can you propose a workaround in the mean time? Can't you make a patch for the existing Visual Studio?
Posted by Microsoft on 1/8/2014 at 2:02 PM
Thank you reporting this issue. We have found the problem and it will be fixed in a future version of Visual Studio.
-Patrick
Visual Studio Debugger Team
Posted by Microsoft on 12/22/2013 at 10:23 PM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by Microsoft on 12/20/2013 at 3:53 PM
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)