nimbus-eth2
nimbus-eth2 copied to clipboard
Build fails on nim-chronos compilation when using GCC 11 or 12
Describe the bug
After upgrading to NixOS 22.05 which uses GCC 11 by default I encountered this error when compiling nimbus-eth2
:
Unable to coalesce ssa_names 93 and 875 which are marked as MUST COALESCE.
colonenvP__93(ab) and colonenvP__875(ab)
during RTL pass: expand
/build/nimbus-eth2/vendor/nim-chronos/chronos/asyncmacro2.nim: In function 'handlePeer__zLPhGEjTU9bcC1VW0v4lgag_25':
/build/nimbus-eth2/vendor/nim-chronos/chronos/asyncmacro2.nim:126:15: internal compiler error: SSA corruption
126 | var iteratorNameSym = genSym(nskIterator, $prcName)
| ^
0x15324f7 internal_error(char const*, ...)
???:0
0xbd5590 coalesce_ssa_name(_var_map*)
???:0
0xb8376f rewrite_out_of_ssa(ssaexpand*)
???:0
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]: *** [/build/ccg1oZEe.mk:299: /build/ccwkfglS.ltrans99.ltrans.o] Error 1
make[2]: *** Waiting for unfinished jobs....
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
/nix/store/rs684lgm8k7akkgbisb49z4vpxxc2zns-binutils-2.38/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make[1]: *** [nimcache/release/nimbus_beacon_node/nimbus_beacon_node.makefile:2864: build] Error 1
make: *** [Makefile:258: nimbus_beacon_node] Error 2
Additional context Locking GCC at 10 works fine, but I also tested GCC 12 since @Menduist mentioned he uses it without issues but it also fails.
It looks like GCC crash because of out of memory?
I have 32 GB of memory and 64 GB of RAM on my desktop, and I don't see it in the memory usage graph, no SWAPping either:
Never goes beyond 10 GB:
Related GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98845
is this still an issue?
Tested with GCC 11.3.0
and 23.5.0
release and I cannot reproduce this issue.