Bug 236375 - make -j4 buildworld fails for latest -RELEASE svn on arm64/RPI3
Summary: make -j4 buildworld fails for latest -RELEASE svn on arm64/RPI3
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: 12.0-RELEASE
Hardware: arm64 Any
: --- Affects Only Me
Assignee: freebsd-arm (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-07 20:03 UTC by Matthias Schojohann
Modified: 2019-03-20 22:40 UTC (History)
3 users (show)

See Also:


Attachments
ARMConstantIslandPass-9fde53.sh (6.22 KB, text/plain)
2019-03-07 20:07 UTC, Matthias Schojohann
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Schojohann 2019-03-07 20:03:57 UTC
--- Target/ARM/ARMConstantIslandPass.o ---
c++: error: unable to execute command: Killed
c++: error: clang frontend command failed due to signal (use -v to see invocation)
FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1)
Target: aarch64-unknown-freebsd12.0
Thread model: posix
InstalledDir: /usr/bin
c++: note: diagnostic msg: PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the crash backtrace, preprocessed source, and associated run script.
--- Target/ARM/ARMHazardRecognizer.o ---
c++  -target aarch64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/arm64.aarch64/tmp -B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin  -O2 -pipe -I/usr/obj/usr/src/arm64.aarch64/lib/clang/libllvm -I/usr/src/contrib/llvm/lib/Target/AArch64 -I/usr/src/contrib/llvm/lib/Target/ARM -I/usr/src/contrib/llvm/lib/Target/Mips -I/usr/src/contrib/llvm/lib/Target/PowerPC -I/usr/src/contrib/llvm/lib/Target/Sparc -I/usr/src/contrib/llvm/lib/Target/X86 -I/usr/src/lib/clang/include -I/usr/src/contrib/llvm/include -DLLVM_BUILD_GLOBAL_ISEL -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DNDEBUG -DLLVM_DEFAULT_TARGET_TRIPLE=\"aarch64-unknown-freebsd12.0\" -DLLVM_HOST_TRIPLE=\"aarch64-unknown-freebsd12.0\" -DDEFAULT_SYSROOT=\"\" -DLLVM_TARGET_ENABLE_AARCH64 -DLLVM_TARGET_ENABLE_ARM -DLLVM_TARGET_ENABLE_MIPS -DLLVM_TARGET_ENABLE_POWERPC -DLLVM_TARGET_ENABLE_SPARC -DLLVM_TARGET_ENABLE_X86 -DLLVM_NATIVE_ASMPARSER=LLVMInitializeAArch64AsmParser -DLLVM_NATIVE_ASMPRINTER=LLVMInitializeAArch64AsmPrinter -DLLVM_NATIVE_DISASSEMBLER=LLVMInitializeAArch64Disassembler -DLLVM_NATIVE_TARGET=LLVMInitializeAArch64Target -DLLVM_NATIVE_TARGETINFO=LLVMInitializeAArch64TargetInfo -DLLVM_NATIVE_TARGETMC=LLVMInitializeAArch64TargetMC -ffunction-sections -fdata-sections -gline-tables-only -MD -MF.depend.Target_ARM_ARMHazardRecognizer.o -MTTarget/ARM/ARMHazardRecognizer.o -fstack-protector-strong -Qunused-arguments  -std=c++11 -fno-exceptions -fno-rtti -gline-tables-only -stdlib=libc++ -Wno-c++11-extensions  -c /usr/src/contrib/llvm/lib/Target/ARM/ARMHazardRecognizer.cpp -o Target/ARM/ARMHazardRecognizer.o
--- Target/ARM/ARMConstantIslandPass.o ---
c++: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
c++: note: diagnostic msg: /tmp/ARMConstantIslandPass-9fde53.cpp
c++: note: diagnostic msg: /tmp/ARMConstantIslandPass-9fde53.sh
c++: note: diagnostic msg:

********************
*** [Target/ARM/ARMConstantIslandPass.o] Error code 254

make[6]: stopped in /usr/src/lib/clang/libllvm
1 error

make[6]: stopped in /usr/src/lib/clang/libllvm
*** [all_subdir_lib/clang/libllvm] Error code 2

make[5]: stopped in /usr/src/lib/clang
1 error

make[5]: stopped in /usr/src/lib/clang
*** [all_subdir_lib/clang] Error code 2

make[4]: stopped in /usr/src/lib
1 error

make[4]: stopped in /usr/src/lib
*** [lib__L] Error code 2

make[3]: stopped in /usr/src
1 error

make[3]: stopped in /usr/src
*** [libraries] Error code 2

make[2]: stopped in /usr/src
1 error

make[2]: stopped in /usr/src
*** [_libraries] Error code 2

make[1]: stopped in /usr/src
1 error

make[1]: stopped in /usr/src
*** [buildworld] Error code 2

make: stopped in /usr/src
1 error

make: stopped in /usr/src
Comment 1 Matthias Schojohann 2019-03-07 20:07:48 UTC
Created attachment 202702 [details]
ARMConstantIslandPass-9fde53.sh

.cpp is too big. I can upload it elsewhere if it is needed.
Comment 2 Andrew "RhodiumToad" Gierth 2019-03-08 22:56:45 UTC
This error just means you ran out of memory. Configure (more) swap space or use smaller -j setting.
Comment 3 Mark Johnston freebsd_committer freebsd_triage 2019-03-20 16:15:53 UTC
Indeed, this looks like an OOM kill.
Comment 4 Mark Millard 2019-03-20 22:40:05 UTC
(In reply to Mark Johnston from comment #3)

Notes tied to adjusting vm.pageout_oom_seq to
potentially avoid the OOM kills. (Mostly
taken from another place that I've reported
such.):


If the person with the problem see any of the:

swap_pager_getswapspace(number): failed

message they really were out of swap. But if
they only see:

kernel: pid ... (...), uid ..., was killed: out of swap space

they likely had swap available, the issue not
really being swap space.

The 2nd type of message can happen when there is
plenty of swap but processes that stay runnable are
preventing having sufficient free RAM after some
number of tries to agin free RAM by FreeBSD: runnable
processes are not (fully) swapped-out by FreeBSD,
only paged.

In my view the "was killed: out of swap space" should
text be adjusted.

vm.pageout_oom_seq notes:

There is a tunable that can increase the number
of tries at freeing RAM before "was killed: out
of swap space" happens. This is used on low end
armv7's and aarch64's and such to allow buildworld
and the like to complete with -j4, for example.

vm.pageout_oom_seq has a default of 12 (last I
checked). Figures like 120 and 1024 have been
used on those low end armv7 and aarch64 examples.
(pi2 V1.1 and rpi3 are examples: just 1 GiByte
of RAM. Of course sufficient swap space is also
required for this kind of context.)

For lld based links, LDFLAGS.lld+= -Wl,--no-threads
can also help avoid memory use by avoiding having
ncpu+2 threads in use in each active lld.

How-to-build-software documentation should probably
cover this subject.