dslm4515 / Musl-LFS

Linux From Scratch using Musl as Libc
GNU General Public License v3.0
170 stars 21 forks source link

Random Internal Compiler Errors #44

Closed dslm4515 closed 2 years ago

dslm4515 commented 3 years ago

Ever since GCC 10.x, there are now internal compiler errors randomly occurring during tool chain build and even during final system build.

For example, trying to build coreutils [for toolchain build] on a triple core x86_64 CPU with 8GB of DDR3 ram:

during RTL pass: cse2
lib/sha256.c: In function 'sha256_process_block':
lib/sha256.c:535:1: internal compiler error: Segmentation fault
  535 | }
      | ^
0xb1999f crash_signal
        ../../gcc/toplev.c:328
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
make[2]: *** [Makefile:10273: lib/sha256.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/mnt/mlfs/sources/coreutils-8.32'
make[1]: *** [Makefile:12910: all-recursive] Error 1
make[1]: Leaving directory '/mnt/mlfs/sources/coreutils-8.32'
make: *** [Makefile:7027: all] Error 2

GCC of this toolchain was build from GCC 10.2.1 snapshot source from Alpine Linux along with patches from Alpine Linux

dslm4515 commented 3 years ago

Host machine specs:

dslm4515 commented 3 years ago

Coreutils continues to build if i step down the make jobs .... from 3 to 1

make -j1
firasuke commented 3 years ago

Was just going to comment that when experiencing Segmentation faults it's better to attempt compiling with -j1 just to check if the error will persist or not.

dslm4515 commented 3 years ago

I forgot to document it, but on an earlier build, using GCC 10.2.0, LLVM 11.0 would also stop compiling with internal compiler error even after trying ninja -j2 and ninja -j1.... i was able to complete the build after issuing ninja -j1 many times until all targets were built

I am rebuilding now with GCC 10.2.1 pre2 from Alpine Linux and using their patches. Source tarball is from Alpine Linux and not upstream (not from GNU mirrors). Wondering if those patches might help.

dslm4515 commented 3 years ago

Strangely, I am getting internal compiler error when compiling groff :

  CXX      src/roff/troff/input.o
during IPA pass: icf
src/roff/troff/input.cpp:8931:1: internal compiler error: Segmentation fault
 8931 | }
      | ^
0xc9325f crash_signal
        ../../gcc/toplev.c:328
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
make[1]: *** [Makefile:7146: src/roff/troff/input.o] Error 1
make[1]: Leaving directory '/sources/groff-1.22.4'
make: *** [Makefile:5600: all] Error 2

Earlier, i had issues with unable to compress files over ~15MB with tar, bzip2, xz, and even lzip ... issue went away if i rebuilt host machine's kernel without DRM (Direct Rendering Management) but with a simple framebuffer enabled.... But now I am getting internal compiler error randomly even for small packages, like ninja.

But if I run echo 1 > /proc/sys/vm/drop_caches then groff compiles fine with out rebuilding entirely ( make clean && make -j1. )

dslm4515 commented 2 years ago

https://github.com/dslm4515/MLFS-pkgtool/issues/7#issuecomment-963738517

Most likely caused by failing RAM sticks