Answered by:
VC 2012.2 unhandled exception (ntdll.dll): The operation completed successfully in mainCRTStartup

Question
-
I've been experiencing this for the past day. It's a little odd.
The application is crashing in mainCRTStartup with the instruction pointer at __security_init_cookie();
Call stack:
ntdll.dll!_NtRaiseException@12() Unknown
ntdll.dll!_KiUserExceptionDispatcher@8() Unknown
> <app>!WinMainCRTStartup() Line 374 C
kernel32.dll!@BaseThreadInitThunk@12() Unknown
ntdll.dll!___RtlUserThreadStart@8() Unknown
ntdll.dll!__RtlUserThreadStart@8() Unknown
I'm running on Windows 7 x64, this is a 32 bit app. It is compiled with /GS. The most interesting component of this is I'm attaching the debugger using the process described in: http://msdn.microsoft.com/en-us/library/a329t4ed(v=vs.71).aspx and using the vsjitdebugger.exe as the debugger. If I select the VS2012 instance with my solution loaded it crashes. If I select a VS2005 debugger, it runs fine. If I start a new instance of VS2012 it crashes (so no solution). If I select a VS2010 debugger, it runs fine. All of them are configured to use the same symbol store the same way.
I have done this same experiment with a completely different app (also built in VS2012.2 VC++) with the same results.
Just to be thorough, I also reproduced it with a console C++ app with:
// HelloWorld.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <stdio.h> int _tmain(int argc, _TCHAR* argv[]) { printf("Hello World!\n"); return 0; }
And I can get it to reproduce with HelloWorld.exe above on another machine. If I disable the debugger setting in the registry, HelloWorld.exe runs fine.
- Edited by Brent Scriver Sunday, June 2, 2013 6:22 AM
- Moved by Elegentin Xie Monday, June 3, 2013 5:51 AM from Visual C++, to a more appropriate forum
Sunday, June 2, 2013 5:45 AM
Answers
-
- Edited by Brent Scriver Tuesday, June 4, 2013 7:33 PM
- Marked as answer by Jack Zhai-MSFTMicrosoft contingent staff Wednesday, June 5, 2013 1:55 AM
Tuesday, June 4, 2013 7:33 PM
All replies
-
Hi,
Welcome here.
Based on your description, I will move the thread to Visual Studio Diagnostics (Debugger, Profiler, IntelliTrace) .
Thanks for your understanding.
Regards,
Elegentin Xie
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.Monday, June 3, 2013 5:51 AM -
Thank you, apologies for the incorrect categorization.Monday, June 3, 2013 8:55 PM
-
Hi Brent,
Since it worked well in other VS version, and just the VS2012 has this issue, you can submit this feedback to Microsoft Connect feedback portal: http://connect.microsoft.com, Microsoft engineers will evaluate them seriously. Thanks for your understanding.
Best Regards,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.Tuesday, June 4, 2013 5:35 AM -
- Edited by Brent Scriver Tuesday, June 4, 2013 7:33 PM
- Marked as answer by Jack Zhai-MSFTMicrosoft contingent staff Wednesday, June 5, 2013 1:55 AM
Tuesday, June 4, 2013 7:33 PM -
I find by "Manually choose debugging engines" followed by selecting the Managed option for 4.5/4.0, I can then step past __security_init_cookie to my own code. I'm no longer sure if this is a work-around as I still observe unusual behavior.
- Edited by Frank Kotarski Monday, June 10, 2013 3:45 PM clarify
Monday, June 10, 2013 3:22 PM -
Except I'm debugging a native app, so only debugging managed wouldn't help me.Tuesday, June 11, 2013 2:25 AM
-
Same here. I checked both native and managed, and even stranger the debugger reports it will only use Native, but the issue disappears.
I wonder if it is related to this - wrong ntdll symbol loaded for 32bit
http://social.msdn.microsoft.com/Forums/en-US/windbg/thread/d9e209e5-75b8-4677-93c5-6544945dacba/Regards
FrankTuesday, June 11, 2013 2:53 PM