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: 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.


Elegentin Xie on Mon, 03 Jun 2013 05:51:25


Welcome here.

Based on your description, I will move the thread to Visual Studio Diagnostics (Debugger, Profiler, IntelliTrace) .

Thanks for your understanding.


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:, Microsoft engineers will evaluate them seriously. Thanks for your understanding.

Best Regards,

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