Capturing R6025 pure virtual call

后端 未结 3 1991
鱼传尺愫
鱼传尺愫 2020-12-13 20:52

I currently capture MiniDumps of unhandled exceptions using SetUnhandledExceptionFilter however at times I am getting \"R6025: pure virtual function\".

3条回答
  •  暖寄归人
    2020-12-13 21:43

    See this answer here to the question where do “pure virtual function call” crashes come from?.

    To help with debugging these kinds of problems you can, in various versions of MSVC, replace the runtime library's purecall handler. You do this by providing your own function with this signature:

    int __cdecl _purecall(void)
    

    and linking it before you link the runtime library. This gives YOU control of what happens when a purecall is detected. Once you have control you can do something more useful than the standard handler. I have a handler that can provide a stack trace of where the purecall happened; see here: http://www.lenholgate.com/archives/000623.html for more details.

    (Note you can also call _set_purecall_handler() to install your handler in some versions of MSVC).

    So, in your purecall handler, make your minidump.

提交回复
热议问题