Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

crashes

Vegan
New Contributor I
430 Views

I have been operating an open source chess program tournament for a long time, and I have noticed that some contestants compiled with the Intel compiler crash and result in the engine losing the game as well as spawning an error message in Windows

I have Visual Studio and I have tried new project and loaded one of the problem engines and after cleaning up some defects related to the C++ ISO standard I was able to make a stable x64 build

now the program works fine, so this tells me the Intel compiler needs some work on it to eliminate the crashing

 

 

0 Kudos
4 Replies
jimdempseyatthecove
Honored Contributor III
430 Views

The fact that a program is stable using one compiler and not stable using a different compiler is not necessarily indicative of a compiler error in the failing system. The alternative, which is usually more likely, is the working compiler produced code that did not expose the programming error.

When you received the error message, what did it say?

Typically the errors fall into the following (incomplete) categories:

a) Access via invalid pointer. Note, when an invalid pointer was previously valid, but now is no longer valid (after delete) the memory address it points to is valid (but the contents is undefined but can be what it was recently). This type of error does not cause a program crash unless the (now undefined) contents contains a pointer that has been modified (corrupted) to point to an unmapped virtual address. Therefore, if your program is using pointers to objects out of scope, your program is running by accident and not by design.

b) Instructing the compiler to use vector instructions that require alignment on addresses that are not aligned. This usually occurs when the programmer blindly inserts #pragma simd and/or other compiler directives without regard to if the addresses used are actually aligned. Use of these vector related pragmas is a contract between you and the compiler that obligates the programmer to provide what he/she claims to provide. The compiler is free to use or not use that information to produce vectorized code. Note, if you are supplying addresses that are not specifically bound to be aligned, then the vectorized code can work by chance when the data is in fact aligned (by chance). Also note, when the working compiler elects to not vectorize the code the program will also work.

c) Using a compiler/linker option that specifies unlimited stack for a multi-threaded program.

Please review your code for any of the above characteristics.

Jim Dempsey

0 Kudos
Vegan
New Contributor I
430 Views

I opened up the code and it's clearly away from the ISO standard which makes it more time consuming to clean up

one program was succesful as there was not many problems to fix, others were in world of hurt

not sure how tolerant Intel's compilers are but the BAT file included suggests it's all command line driven

 

0 Kudos
TimP
Honored Contributor III
430 Views

Rather than detecting violations of language standard and then backing off optimization, compilers generally expect you at least to set checking options and correct those problems (and test with conservative options before using aggressive ones).  Intel 16.0 beta compiler did add /Qprotect-parens option so as to allow over-riding one of its more risky default violations of standard.

0 Kudos
Vegan
New Contributor I
430 Views

I have left the more egregious problems on the back burner with some comments as to the changes needed

I use Visual Studio so once a given project is imported I can clean it up over time

 

0 Kudos
Reply