c++ - 调试器启动时 VS2012 : Breakpoint in ntdll. dll,没有更多信息

标签 c++ windows debugging windows-8 visual-studio-2012

偶尔,当我使用 VS2012 在 Debug模式下启动/调试我的应用程序时,我会得到一个对话框:

<blahblah.exe> has triggered a breakpoint.

它不包含其他信息,所以我点击 break 看看发生了什么。哦,但是后来我得到“wntdll.pdb not loaded”,并且没有关于该问题的其他信息。调用堆栈指向 ntdll.dll,此时我的应用程序似乎还没有开始执行。

此时选择继续将使应用程序/调试器照常继续。

这种情况经常发生(10 次发射中大约有 7 次发射)。我正在运行 Windows 8(64 位)和带有更新 1 的 Visual Studio 2012。

以前我有 Windows 7(64 位)和 VS2010,从来没有遇到过这个问题。这个特定的项目已经从它在 (2010) 中创建的版本升级,所以这可能是问题的一部分。

以前有人遇到过这个问题吗?我不知道从哪里开始寻找原因。虽然我运行的是 64 位 Windows,但我应该指出我正在构建 32 位应用程序。

更新: 启用 Microsoft 符号服务器后,调用堆栈如下所示:

>   ntdll.dll!_LdrpDoDebuggerBreak@0()  Unknown
    ntdll.dll!_LdrpInitializeProcess@8()    Unknown
    ntdll.dll!__LdrpInitialize@8()  Unknown
    ntdll.dll!_LdrpInitialize@8()   Unknown
    ntdll.dll!_LdrInitializeThunk@8()   Unknown

我还应该补充一点,以防万一,我绝对没有在我的代码中的任何地方手动设置断点

最佳答案

这个烦人的问题源于 Visual Studio 中的一个错误:

What's happening is that we're not correctly handling multiple loader breakpoint events from different processes simultaneously. The OS triggers a loader breakpoint once the process is up and running but before any execution can take place for debuggers to instanciate breakpoints and take other action. Normally we successfully ignore these (at least in the single launch case). You can work around this by disabling the "Break all processes when one process breaks" checkbox in tools->options->debugger. Also note that this isn't a fatal error. We're just stopping at an internal breakpiont and you can just hit F5 again to keep going.

It's a race condition so won't be that easy for us to track down and multi-launch usage in VS is fairly low so I'm going to won't fix this assuming the workaround above will be good enough to get you unblocked and we'll revisit this if we see more reports from additional customers. Does that sound reasonable to you?

Thanks again for the feedback.

Marc Paine Visual Studio Debugger Engineering Manager

来源:Microsoft Connect

我遵循了在 Visual Studio 调试器设置中禁用“一个进程中断时中断所有进程”复选框的建议,这暂时“解决了”这个问题。

也许如果我们能让更多的人报告这个错误的相同问题/烦恼,微软最终会按照他们的建议修复它。

关于c++ - 调试器启动时 VS2012 : Breakpoint in ntdll. dll,没有更多信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14376523/

相关文章:

c++ - 返回时如何避免复制

c++ - 最快的时间分辨率系统

javascript - phantomjs:找不到命令

visual-studio - 使用本地 IIS 编辑并继续

c++ - Qt Creator 在指定的调试文件夹中创建调试和发布文件夹

c++ - 在 C++ 中将类型作为返回类型

c++ - 在 vector 中的 vector 之间移动指针会导致 vector 迭代器不兼容

c++ - 我的合并排序算法没有得到正确答案

c++ - 构建使用 boost::asio 的程序时发出警告

windows - 什么(软件)USB 嗅探器可用于 Windows?