Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 944146

Summary: sys-kernel/gentoo-kernel-6.6.58-r1: unable to compile on RPi4 due to pahole eating all memory
Product: Gentoo Linux Reporter: kavol
Component: Current packagesAssignee: Distribution Kernel Project <dist-kernel>
Status: UNCONFIRMED ---    
Severity: normal CC: d, flow, kernel
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/scripts/Makefile.btf?id=09048d22b7825a5025cf7e135f7e3134daff4df2
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 351559    

Description kavol 2024-11-20 14:03:14 UTC
Trying to update world on my Raspberry Pi 4 with 4 GiB RAM recently caused the machine to hang.
On second try, with top running on another connection, the last thing I see is it was compiling the kernel and pahole eating the whole memory and ioswap getting above 90% then the machine stops responding completely (top screen no more refreshed, trying new ssh connection hangs indefinitely ...) After invoking OOM killer manually via sysrq, it returns to normal - however emerge finishes with error, without installing the new kernel obviously.

Reproducible: Always

Steps to Reproduce:
1. have Gentoo on Raspberry Pi with 4 GiB RAM
2. emerge -1 sys-kernel/gentoo-kernel

Actual Results:  
system hangs
emerge output ends in:

+ aarch64-unknown-linux-gnu-ld.bfd -EL -maarch64elf -z noexecstack --no-warn-rwx-segments --no-undefined -X -shared -Bsymbolic -z notext --no-apply-dynamic-relocs --fix-cortex-a53-843419 --build-id=sha1 -X --orphan-handling=warn --script=./arch/arm64/kernel/vmlinux.lds -o .tmp_vmlinux.btf --whole-archive vmlinux.a .vmlinux.export.o init/version-timestamp.o --no-whole-archive --start-group ./drivers/firmware/efi/libstub/lib.a --end-group
+ info BTF .btf.vmlinux.bin.o
+ printf '  %-7s %s\n' BTF .btf.vmlinux.bin.o
  BTF     .btf.vmlinux.bin.o
+ LLVM_OBJCOPY=aarch64-unknown-linux-gnu-objcopy
+ pahole -J --btf_gen_floats -j --lang_exclude=rust --skip_encoding_btf_inconsistent_proto --btf_gen_optimized .tmp_vmlinux.btf


Expected Results:  
emerge finishes cleanly
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-11-20 14:09:04 UTC
Maybe we should backport https://lore.kernel.org/linux-kbuild/20241102100452.793970-1-flo@geekplace.eu/.
Comment 2 Mike Pagano gentoo-dev 2024-11-21 19:28:49 UTC
The particular patch referenced is now in genpatches and will be included when 6.11.10 is released.  It is not application to kernels we support less than 6.11.X.
Comment 3 David Sardari 2025-01-23 21:37:38 UTC
I had the same problem with pahole and building sys-kernel/gentoo-kernel-6.6.73 on my 4 GiB RAM vServer. The switch to dev-util/pahole-1.29 and sys-kernel/gentoo-kernel-6.12.10 solved it for me.