Shutdown exception handling for Win32/C++

回眸只為那壹抹淺笑 提交于 2019-12-02 03:18:13

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?

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!