Recurring compiler crashes and obscure errors.

  • Thread starter Thread starter AJTC
  • Start date Start date
A

AJTC

Guest
Over the past several weeks I experiencing seemingly spontaneous compilers crashes or obscure errors in our code base. I am curious if anyone might have strategies that could help me resolve the issue(s?).

The individual errors can frequently be resolved by simply moving code around. Often by simply creating a temporary to break up the problem line. For example. I will have the following line of code:

SoundManager::shared().playSoundForEvent(BUBBLE_POP_SEVENT,"DialogAppear");

the code will compile fine for several weeks, then suddenly some change in our code base will result in the line spitting out an error such as follows:

2>C:\Dir\File.cpp(348): fatal error C1001: An internal error has occurred in the compiler.
2> (compiler file msc1.cpp, line 1325)
2> To work around this problem, try simplifying or changing the program near the locations listed above.
2> Please choose the Technical Support command on the Visual C++
2> Help menu, or open the Technical Support help file for more information
2> INTERNAL COMPILER ERROR in C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_arm\CL.exe
2> Please choose the Technical Support command on the Visual C++
2> Help menu, or open the Technical Support help file for more information
2>cl : Command line error D8040: error creating or communicating with child process



mean while an identical line in a different function will be fine. I can follow the advice in the message to resolve the error:




auto& soundManager = SoundManager::shared();

soundManager.playSoundForEvent(BUBBLE_POP_SEVENT,"DialogAppear");



Although it is great that I can make the error go away, I am getting tired of having to make a few more of these changes every couple of days. There is also several different variations, e.g.:


yesFunc = std::bind(&Class::voidVoidMemberFunction, this);

started giving this error:

2>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\tuple(365): error C2216: initonly cannot be used with event (C:\Dir\File.cpp)
2> C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\functional(1154) : see reference to class template instantiation std::tuple<Namespace::Class *> being compiled
2> C:\Dir\File.cpp(710) : see reference to class template instantiation std::_Bind<true,void,std::_Pmf_wrap<void (__cdecl Namespace::Class::* )(void),void,Namespace::Class,>,Namespace::Class *const > being compiled
2>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\tuple(365): error C2216: initonly cannot be used with new (C:\Dir\File.cpp)
2>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\tuple(365): error C2216: initonly cannot be used with sealed (C:\Dir\File.cpp)
2>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\tuple(365): error C2216: initonly cannot be used with virtual (C:\Dir\File.cpp)
2>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\tuple(365): error C2216: initonly cannot be used with extern (C:\Dir\File.cpp)
2>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\tuple(365): error C2216: initonly cannot be used with friend (C:\Dir\File.cpp)
2>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\tuple(365): error C2216: initonly cannot be used with override (C:\Dir\File.cpp)
2>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\tuple(365): error C2216: initonly cannot be used with newline (C:\Dir\File.cpp)
2>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\tuple(365): error C2216: initonly cannot be used with <Unknown> (C:\Dir\File.cpp)
2>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\tuple(365): fatal error C1903: unable to recover from previous error(s); stopping compilation (C:\Dir\File.cpp)


To fix it I can either use a using std::bind & drop the namespace resolution, turn the function into a temporary before assigning or yesFunc, or turn the member function pointer into a temporary before using it as an parameter for bind.


There are a number of other variations, but little consistency. The only thing that seems somewhat consistent is the solution (either create a temporary or drop a namespace resolution).

Although I am using VS2015 RC, I started with VS2013 and had the same issue so I dont think it is a 2015 bug. My assumption at this point is an issue with our code base, but have run out of ideas on what to try. As a side note, the code is fine in other compilers.

Continue reading...
 
Back
Top