简体   繁体   English

抛出std :: exception使Visual Studio 2013 IDE崩溃

[英]Throwing std::exception crashes Visual Studio 2013 IDE

I've just filed a bug report to Microsoft, on my system throwing any exception with std::exception or those that inherit it crashes the Visual Studio 2013 IDE. 我刚刚向Microsoft提交了一个错误报告 ,在我的系统上引发了任何带有std::exception或继承该std::exception ,使Visual Studio 2013 IDE崩溃。 Have anyone else seen this problem or is it a quirk on my system that enables the bug? 其他人是否看到过此问题,或者是我的系统中的一个古怪现象导致该错误? I can also mention that my Visual Studio 2012 on the same system have not such issues. 我还可以提到,我在同一系统上的Visual Studio 2012没有此类问题。

The following minimalist example crashes my Visual Studio 2013 IDE: 以下简约示例使我的Visual Studio 2013 IDE崩溃:

#include "stdafx.h"
#include <stdexcept>
#include <iostream>

int _tmain(int argc, _TCHAR* argv [])
{
    try
    {
        throw std::exception("Crashtest");
    }
    catch (...)
    {
        std::cerr << "Error" << std::endl; // never reached
    }

    return 0; // never reached
}

Anyone have a suggestion for a work-around until they have fixed this, it's quite annoying at the moment. 在解决此问题之前,任何人都会提出解决方法的建议,此刻这很烦人。

Update 更新

Intel has posted a workaround for this bug here: 英特尔在此发布了针对此错误的解决方法:

http://software.intel.com/en-us/forums/topic/494680 http://software.intel.com/en-us/forums/topic/494680

I just created a new C++ Console application, with precompiled header, and then pasted your code. 我刚刚创建了一个带有预编译头的新C ++控制台应用程序,然后粘贴了您的代码。 I was not able to recreate the issue. 我无法重现该问题。 I'm able to place a breakpoint on std::cerr << and hit it without fault. 我可以在std::cerr <<上放置一个断点,然后毫无问题地将其击中。

Have you tried re-installing Visual Studio 2013? 您是否尝试过重新安装Visual Studio 2013? I'm guessing you have a corrupt installation or a misconfigured debugger. 我猜测您的安装损坏或调试器配置错误。 Make sure to remove previous versions of Visual Studio. 确保删除以前版本的Visual Studio。 Even though they work side-by-side I've seen issues previously with native debugging. 即使它们并排工作,我以前也曾遇到本机调试问题。

确保已使用选项/EHsc启用C ++异常处理。

I did some further investigation on this bug this weekend. 这个周末,我对此漏洞进行了进一步调查。 First I uninstalled Windows 7 and upgraded to Windows 8.1 Enterprise (64-bit). 首先,我卸载了Windows 7,然后升级到Windows 8.1 Enterprise(64位)。 Then I installed Visual Studio Ultimate 2013 (v12.0.21005 REL). 然后,我安装了Visual Studio Ultimate 2013(v12.0.21005 REL)。 I ran the program below with no problems and I thought that I had fixed the problem. 我在下面运行了程序,没有任何问题,我认为我已经解决了问题。 However, when I installed Intel C++ Studio XE 2013 (included SP1 with update 1) the bug came back. 但是,当我安装Intel C ++ Studio XE 2013(包含更新1的SP1)时,该错误再次出现。 So there seem (at least on my system) to be an issue with how Visual Studio 2013 and Intel C++ Studio 2013 works together. 因此(至少在我的系统上)似乎Visual Studio 2013和Intel C ++ Studio 2013如何协同工作存在问题。

I've been stuck in this problem for 3 days until I discovered that the problem was in try-catch blocks. 我一直在这个问题上停留了3天,直到发现问题出在try-catch块中。 Viewing this article: http://msdn.microsoft.com/en-us/library/0yd65esw.aspx , I realized the importance of not leaving a "catch" empty. 查看本文: http : //msdn.microsoft.com/zh-cn/library/0yd65esw.aspx ,我意识到了不留空白的重要性。 Remove the try catch block and check, please. 请卸下尝试挡块并进行检查。

Well, this problem happened to me while developing a simple sequential workflow SharePoint 2013 in Visual Studio 2013 in "OnTaskChanged" methods. 嗯,在Visual Studio 2013中以“ OnTaskChanged”方法开发简单的顺序工作流SharePoint 2013时,这个问题发生了。

I hope the answer may help someone else. 我希望答案可以帮助其他人。

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

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