Throwing std::exception crashes Visual Studio 2013 IDE - c++

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. 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.
The following minimalist example crashes my 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

I just created a new C++ Console application, with precompiled header, and then pasted your code. I was not able to recreate the issue. I'm able to place a breakpoint on std::cerr << and hit it without fault.
Have you tried re-installing Visual Studio 2013? I'm guessing you have a corrupt installation or a misconfigured debugger. Make sure to remove previous versions of Visual Studio. Even though they work side-by-side I've seen issues previously with native debugging.

Make sure you have enabled C++ exception handling with option /EHsc.

I did some further investigation on this bug this weekend. First I uninstalled Windows 7 and upgraded to Windows 8.1 Enterprise (64-bit). Then I installed 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. So there seem (at least on my system) to be an issue with how Visual Studio 2013 and Intel C++ Studio 2013 works together.

I've been stuck in this problem for 3 days until I discovered that the problem was in try-catch blocks. Viewing this article: http://msdn.microsoft.com/en-us/library/0yd65esw.aspx, I realized the importance of not leaving a "catch" empty. 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.
I hope the answer may help someone else.

Related

IDE (Dev c++, visual express, code block, etc) doesn't work on my computer [duplicate]

I'm trying to run some C++ code in Visual Studio 2015. When I build it I get no errors, but once I run it, all I get is an empty console. I don't think it froze, because I can see a flashing underscore.
Also if I run it in debug mode Visual Studio just freezes.
I used a simple "hello world" code:
#include <iostream>
int main()
{
std::cout << "hello world!\n";
return 0;
}
What I tried:
I tried reinstalling Visual Studio, but it didn't fix anything.
I also tried running some Python and C# code and both worked without problems.
Note: this issue is also being reported by gcc/mingw/cygwin users.
Do you use Avast antivirus? If so, try disabling it and then test your program. There have been several similar questions on SO recently and Avast was the problem.
If that fixes the problem I suggest you add an exclusion for your "\Visual Studio 2015\Projects" directory instead of completely disabling your antivirus. You could also file a bug report with Avast or try a different antivirus.

I cannot print in visual studio 2015 [duplicate]

I'm trying to run some C++ code in Visual Studio 2015. When I build it I get no errors, but once I run it, all I get is an empty console. I don't think it froze, because I can see a flashing underscore.
Also if I run it in debug mode Visual Studio just freezes.
I used a simple "hello world" code:
#include <iostream>
int main()
{
std::cout << "hello world!\n";
return 0;
}
What I tried:
I tried reinstalling Visual Studio, but it didn't fix anything.
I also tried running some Python and C# code and both worked without problems.
Note: this issue is also being reported by gcc/mingw/cygwin users.
Do you use Avast antivirus? If so, try disabling it and then test your program. There have been several similar questions on SO recently and Avast was the problem.
If that fixes the problem I suggest you add an exclusion for your "\Visual Studio 2015\Projects" directory instead of completely disabling your antivirus. You could also file a bug report with Avast or try a different antivirus.

Visual Studio freezes on running C++ Code [duplicate]

I'm trying to run some C++ code in Visual Studio 2015. When I build it I get no errors, but once I run it, all I get is an empty console. I don't think it froze, because I can see a flashing underscore.
Also if I run it in debug mode Visual Studio just freezes.
I used a simple "hello world" code:
#include <iostream>
int main()
{
std::cout << "hello world!\n";
return 0;
}
What I tried:
I tried reinstalling Visual Studio, but it didn't fix anything.
I also tried running some Python and C# code and both worked without problems.
Note: this issue is also being reported by gcc/mingw/cygwin users.
Do you use Avast antivirus? If so, try disabling it and then test your program. There have been several similar questions on SO recently and Avast was the problem.
If that fixes the problem I suggest you add an exclusion for your "\Visual Studio 2015\Projects" directory instead of completely disabling your antivirus. You could also file a bug report with Avast or try a different antivirus.

Visual Studio 2015 Community - can't run any code [duplicate]

I'm trying to run some C++ code in Visual Studio 2015. When I build it I get no errors, but once I run it, all I get is an empty console. I don't think it froze, because I can see a flashing underscore.
Also if I run it in debug mode Visual Studio just freezes.
I used a simple "hello world" code:
#include <iostream>
int main()
{
std::cout << "hello world!\n";
return 0;
}
What I tried:
I tried reinstalling Visual Studio, but it didn't fix anything.
I also tried running some Python and C# code and both worked without problems.
Note: this issue is also being reported by gcc/mingw/cygwin users.
Do you use Avast antivirus? If so, try disabling it and then test your program. There have been several similar questions on SO recently and Avast was the problem.
If that fixes the problem I suggest you add an exclusion for your "\Visual Studio 2015\Projects" directory instead of completely disabling your antivirus. You could also file a bug report with Avast or try a different antivirus.

VS2005 SP1 on Win XP crashes after loading solution with 362 projects without any error, log or trace

I am running Visual Studio 2005 on Windows XP. It crashes without any error, log or trace when I try to load the solution for our product that contains 362 projects. I don't think the size of solution (362) is a problem, because it works on my colleagues computers. There is no entry of this in Event Viewer.
Any help to locate root cause of the problem or any solution if known would be greatly appreciated.
Thanks,
Shashibhushan
Thanks Luke for your suggestion. When I debugged using windbg.exe, it became evident that the exception was being generated at the time of loading dll related to "VMDebugger - Visual Studio Integrated Virtual Machine Debugger". I disabled it from the Add-in Manager and now the solution is being loaded successfully and working fine. Thanks for all your suggestions.
Thanks,
Shashi
Just some general thougts:
Uninstall SP1 - i had several difficulties with it. I.e. i was unable to create a working x64 DLL using SP1
Try again on a different machine that so far does not have Visual Studio on it. So you know wheteher its a problem of the Machine, or maybe a general Problem of Visual Studio
Uninstall and reinstall Visual Studio.
EDIT:
If you started seeing these problems yesterday i would even more strongly suggest, to uninstall and reinstall VisualStudio as well as SP1.
Did you install any new software recently?