Shutdown exception handling for Win32/C++

后端 未结 3 666
执笔经年
执笔经年 2021-01-24 12:50

I have a process that handles exceptions great. It calls:

_set_se_translator(exception_trans_func); 
SetUnhandledExceptionFilter(UnhandledExceptionFilterHandler         


        
相关标签:
3条回答
  • 2021-01-24 13:05

    It could be that STL code is being executed during the destruction of global variables at program shutdown time and perhaps (depending on the version of STL that you're using) some global variables that it requires have already been destroyed.

    I've seen this with VS2008's STL. There are some STL lock objects that are created via a file level static during start up.

    Are you using STL in your error handler functions? It could be that one of these is going off late in program shutdown and causing the problem.

    0 讨论(0)
  • 2021-01-24 13:24

    This sounds like the CRT has put an SEH try/catch block (can't write it properly, Markdown kicks in) around some piece of code, and is catching the exception to display the message, so you never end up calling the unhandled exception code path. You might have to do some CRT hacking to figure out what's happening.

    0 讨论(0)
  • 2021-01-24 13:29

    What operating system are they running?

    I assume you're setting the error mode using something like

    ::SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);

    to make sure that windows isn't jumping in with its own error handling?

    0 讨论(0)
提交回复
热议问题