简体   繁体   English

什么是 ntdll.dll?RcConsolidateFrames?

[英]What is ntdll.dll!RcConsolidateFrames?

I have a call stack like below from my dump file.我的转储文件中有如下所示的调用堆栈。 I want to find my code in the call stack, but I can't.我想在调用堆栈中找到我的代码,但找不到。 What is start point to analyze my dump?分析我的转储的起点是什么? Link option of my program is release/Od.我程序的链接选项是release/Od。

msvcr120.dll!abort() 
msvcr120.dll!terminate()
msvcp120.dll!_Call_func$catch()
msvcr120.dll!_CallSettingFrame()
msvcr120.dll!__CxxCallCatchBlock(_EXCEPTION_RECORD * pExcept=0x0000002885f9b010)
ntdll.dll!RcConsolidateFrames()
msvcp120.dll!_Call_func(void * _Data=0x00000028835d5ce0)
msvcr120.dll!_callthreadstartex()
msvcr120.dll!_threadstartex(void * ptd=0x000000288366e410)
kernel32.dll!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()

TL;DR : If you re- throw; TL;DR :如果你重新throw; the call stack will not show the original location, but something further up the stack and ntdll.dll!RcConsolidateFrames() .调用堆栈不会显示原始位置,但会显示堆栈和ntdll.dll!RcConsolidateFrames()的位置。


You will find ntdll.dll!RcConsolidateFrames() in your call stack for an unhandled exception instead of the actual location when the code uses catch(ANYTHING) + throw;当代码使用catch(ANYTHING) + throw;时,您会在调用堆栈中找到ntdll.dll!RcConsolidateFrames()以获取未处理的异常,而不是实际位置; in an x64 binary .在 x64 二进制文件中。

You see, if you catch and re-throw, the original call stack has been already unwound , and when you then throw;你看,如果你catch并重新抛出,原来的调用栈已经被展开了,当你再throw; it will re-throw the original exception, but the call stack information is now messed up.它会重新抛出原来的异常,但是调用栈信息现在乱七八糟了。

My observations for MSVC is that this will always happen with any throw;我对 MSVC 的观察是,任何throw; that is then unhandled and leads to a dump file.然后未处理并导致转储文件。 Specifically:具体来说:

  • It does not matter whether you use catch(...) or catch(cppTypeEx&)使用catch(...)还是catch(cppTypeEx&)并不重要
  • It does not matter whether it is a C++ exception (with /EHsc or /EHa ) or a SEH exception (with /EHa ).它是 C++ 异常(使用/EHsc/EHa )还是 SEH 异常(使用/EHa并不重要。
  • It will look like this in the debugger as well as in a dump file.它在调试器转储文件中看起来像这样。

Bottom line: throw;底线: throw; will mess up your call stack会弄乱你的调用堆栈

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM