How to get buffer overflow exception information in a mixed application?

In all the WPF applications that I am developing, there is a global exception handler subscribed to AppDomain.CurrentDomain.UnhandledExceptionthat logs everything that it can find, and then displays a dialog box telling the user to contact the author where the log file is located, etc. This works extremely well, and both clients and I are very happy because it allows you to quickly fix problems.

However, when developing a mixed WPF / C # / CLI / C ++ application, application crashes sometimes do not fall into the above exception handler. Instead, a standard Windows dialog box appears saying "XXX hast stopped working". In detail, he shows, for example,

 Problem Event Name: BEX
 Application Name:   XXX.exe
 Fault Module Name:  clr.dll
 ...

This mainly happens when a managed function is called from the inherited code and when this function refreshes the screen. I did not take long to find out the cause of the problem, but only because I can reproduce the failure on my machine and connect the debugger: in all cases, the native thread was still at the call point of the function pointer to the managed delegate, which calls the C code directly # / WPF.

The real problem will be when this happens on the client machine: given that usually clients are not the best journalists of mistakes, it’s very quick, very long time to understand what’s wrong when all they can provide me is details above.

: , ? , ? ? msvcr100_clr0004.dll clr.dll( , ), :

msvcr100_clr0400.dll!__crt_debugger_hook()  
clr.dll!___report_gsfailure()  + 0xeb bytes 
clr.dll!_DoJITFailFast@0()  + 0x8 bytes 
clr.dll!CrawlFrame::CheckGSCookies()  + 0x2c3b72 bytes  

- ++- __crt_debugger_hook() (, -)? : CheckGSCookies , - ?

: native ++ CLI ( GetFunctionPointerForDelegate, , , # System.Action. ( WPF) propertychanged. - ( ) , .

, SetUnhandledExceptionFilter, , , . , - , . , : , ( ) ui. ans , dll, . .

+5
1

.NET 4 CLR . , "cookie" , , cookie - . , , . , .

, , , . , scribbles junk CLR . , , . , , .

+3

All Articles