VC 2012.2 unhandled exception (ntdll.dll): The operation completed successfully in mainCRTStartup
Category: visual studio vc
Question
Brent Scriver on Sun, 02 Jun 2013 05:45:11
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.
Replies
Elegentin Xie on Mon, 03 Jun 2013 05:51:25
Hi,
Welcome here.
Based on your description, I will move the thread to Visual Studio Diagnostics (Debugger, Profiler, IntelliTrace) .
Thanks for your understanding.
Regards,
Brent Scriver on Mon, 03 Jun 2013 20:55:38
Thank you, apologies for the incorrect categorization.
Jack Zhai-MSFT on Tue, 04 Jun 2013 05:35:50
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,
Brent Scriver on Tue, 04 Jun 2013 19:33:41
Frank Kotarski on Mon, 10 Jun 2013 15:22:44
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.
Brent Scriver on Tue, 11 Jun 2013 02:25:21
Except I'm debugging a native app, so only debugging managed wouldn't help me.
Frank Kotarski on Tue, 11 Jun 2013 14:53:24
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
Frank