Friday, December 9, 2011

EMET causes troubles for visual studio’s debugging

Since last month, one of my projects fails to be started by visual studio when trying to debug it, while still can run standalone and also can be attached after having started, and can also be started from windbg.

Sometimes showing the message: STATUS_STACK_BUFFER_OVERRUN, sometimes studio hangs, sometimes debugger keeps interrupted at ntdll.dll!_LdrpSnapThunk@36 when trying to load cryptsp.dll. Due to the tight dev schedule, I chose to move on with other projects.

Today, I tried to fix it. First, since STATUS_STACK_BUFFER_OVERRUN is VC’s runtime security checking, after disable this compiling option, still not work. Then, check appverif and gflags setting options, clearing them, still not work. Then, tried to debug the _LdrpSnapThunk codes, no infinite loop and seems just unexpected interrupted, anyway, could not figure out why it failsSad smile

Then, I tried to rename my executable, it works! So, it should not be my debugger problem, must be kind of specific setting like Application Compatibility Toolkits. I reviewed such kind of settings on my machine, and found last month, I installed EMET(Enhanced Mitigation Experience Toolkit) and played with my project without restoring it, then trouble comesSmile

I also found other guys got similar problems, causing lot of troubles to developers.

http://forums.silverlight.net/t/221268.aspx