gcc (Ubuntu 5.4.0-6ubuntu1 ~ 16.04.4) 5.4.0 20160609

Here is the error that the compiler gave me:

internal compiler error: Segmentation fault

int delete_struct (ProgramLang * structList, int num)

Please submit a full bug report, with preprocessed source if appropriate.
See <file: ///usr/share/doc/gcc-5/README.Bugs> for instructions.

I first encounter such errors and do not know what to do. Can someone explain what the error is and how to correct such errors?

The compilation command I used:

g++ -Wall -W -std=c++11 -o Kursach_2 main.cpp Database_functions.cpp ioStruct_functions.cpp ioFile_functions.cpp 

Link to github: https://github.com/JokerSamStrew/Kursach_2term (the code is very raw and curved)

  • Labzov As follows from the message, this is a compiler error. Perhaps it is caused by some ornate designs used in your program. Therefore, refactor the modules of the program and compile the program, gradually expanding it. - Vlad from Moscow
  • one
    I do not think this is your mistake or your code. Compiler memory error. The reasons contributing to the manifestation of the error are a great many - wasps, architecture, patch level of libraries, etc .. - 0xdb
  • @VladfromMoscow The fact is that I just added a couple of functions, my main.cpp doesn’t use anything at all - Semyon Labzov
  • @ 0xdb What do you mean by compiler memory error? - Semyon Labzov
  • @Semyon Labzov Then check out these features and simplify them. Use simple and clear designs. - Vlad from Moscow

1 answer 1

This message means that you have encountered a compiler error. This happens - no big deal.

It would be great if you help the authors fix it. To do this, install the compiler version under development (the gcc-snapshot package in Debian / Ubuntu) and check if this error is reproduced again (the package puts GCC in the /usr/lib/gcc-snapshot directory).

 /usr/lib/gcc-snapshot/bin/g++ -Wall -W -std=c++11 -o Kursach_2 main.cpp Database_functions.cpp ioStruct_functions.cpp ioFile_functions.cpp 

If the error does not repeat, update the version of the compiler. Otherwise, please fill out the bug report in the GCC bug tracker . Be sure to specify the version of the compiler used (enough output gcc -v ). Very likely, the local comrades will help you, if the English is not very.

For more detailed instructions on how to report an error, see the /usr/share/doc/gcc/README.Bugs file.


Investigated your situation. I confirm the behavior of the GCC. In the latest build of the compiler (dated 2016-04-14), the error is not reproduced.

In your case, the compiler crashes due to the precompiled Database_functions.hpp.gch header. Sometimes this can be, if it was created with other flags than those used in the current compilation. To solve the problem, simply delete this file.

NB: the compiler produces such a header to speed up the compilation, if you transfer .hpp as an input file