This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc behavior on memory exhaustion

On 2017.08.09 at 14:05 +0100, Andrew Roberts wrote:
> I routinely build the weekly snapshots and RC's, on x64, arm and aarch64.
> The last gcc 8 snapshot and the two recent 7.2 RC's have failed to build on
> aarch64 (Raspberry Pi 3, running Arch Linux ARM). I have finally traced this
> to the system running out of memory. I guess a recent kernel update had
> changed the memory page size and the swap file was no longer being used
> because the page sizes didn't match.
> Obviously this is my issue, but the error's I was getting from gcc did not
> help. I was getting ICE's, thus:
> /usr/local/gcc/bin/g++ -Wall -Wextra -Wno-ignored-qualifiers
> -Wno-sign-compare -Wno-write-strings -std=c++14 -pipe -march=armv8-a
> -mcpu=cortex-a53 -mtune=cortex-a53 -ftree-vectorize -O3 -DUNAME_S=\"linux\"
> -DUNAME_M=\"aarch64\" -DOSMESA=1 -I../libs/include -DRASPBERRY_PI
> -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/unicode   -c
> -o glerr.o glerr.cpp
> {standard input}: Assembler messages:
> {standard input}: Warning: end of file not at end of a line; newline
> inserted
> {standard input}:204: Error: operand 1 must be an integer register -- `mov'
> {standard input}: Error: open CFI at the end of file; missing .cfi_endproc
> directive
> g++: internal compiler error: Killed (program cc1plus)
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <> for instructions.
> make: *** [<builtin>: glerr.o] Error 4
> make: *** Waiting for unfinished jobs....
> I was seeing the problem when building using make -j2. Both building gcc and
> building large user projects.
> There are two issues here:
> 1) There was discussion about increasing the amount of memory gcc would
> reserve to help speed up compilation of large source files, I wondered if
> this could be a factor.
> 2) It would be nice to see some sort of out of memory error, rather than
> just an ICE.

"internal compiler error: Killed" is almost always an out of memory
error. dmesg will show that the OOM killer kicked in and killed the
cc1plus process.

> The system has 858Mb of  RAM without the swap file.
> Building a single source file seems to use up to 97% of the available memory
> (for a 2522 line C++ source file).
> make -j2 is enough to cause the failure.

Well, you should really use a cross compiler for this setup.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]