- 1、本文档共6页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
退出线程时由于析构错误引发的崩溃!
Problem: Fatal error thread exit if FLS callback not freed
kb/2754614
By 唔該正常D
在退出进程之前崩溃,dump 显示系统尝试调用一个已经卸载了DLL 里的函数,引发崩溃现象:win7/win2003 下,程序在关机时崩溃,有DUMP 生成,
错误代码,COM 组件释放有问题
Cxx::~Cxx()
{
if (NULL != m_pInterfaceXX)
{
delete m_pInterfaceXX; m_pInterfaceXX = NULL;
}
}
正确代码应该为
Cxx::~Cxx()
{
if (NULL != m_pInterfaceXX)
{
m_pInterfaceXX-Release();
}
}
A C++ DLL statically linked to CRT may cause a fatal error at thread exit if the DLL load or
A C++ DLL statically linked to CRT may cause a fatal error at thread exit if the DLL load or
unload sequence is interrupted by an unhandled exception.
A process may crash at thread exit with an Access Violation exception (0xC0000005, EXCEPTION_ACCESS_VIOLATION) if it had dynamically loaded (such as by calling LoadLibrary()) a native C++ DLL that was statically linked with C Runtime, and the DLL generated an unhandled exception during its initialization or shutdown.
During the CRT startup or shutdown (such as during DLL_PROCESS_ATTACH or DLL_PROCESS_DETACH in DllMain(), or in the constructor or destructor of a global/static C++ object), if the DLL generates a fatal error that is unhandled, the LoadLibrary call just swallows the exception and returns with NULL. When the DLL load or unload fails, some error codes you may observe include:
? ERROR_NOACCESS (998) or EXCEPTION_ACCESS_VIOLATION (0xC0000005, 0n3221225477)
? EXCEPTION_INT_DIVIDE_BY_ZERO (0xC0000094, 0n3221225620)
? ERROR_STACK_OVERFLOW (1001) or EXCEPTION_STACK_OVERFLOW (0xC00000FD,
0n3221225725)
? C++ exception (0xE06D7363, 0n3765269347)
? ERROR_DLL_INIT_FAILED (0x8007045A)
This library startup or shutdown failure usually is not observed until the calling thread is about to exit, in the form of a deadly Access Violation exception with a similar call stack as below:
Unloaded_TestDll.dll+0x1642 ntdll!RtlProcessFlsData+0x57 ntdll!LdrShutdownProcess+0xbd ntdll!RtlExitUserProcess+0x74 kernel32!ExitProcessStub+0x12 TestExe! crtExitProcess+0x17 TestExe!doexit
文档评论(0)