Summary: | kldxref: /boot/kernel/kernel: too many segments | ||
---|---|---|---|
Product: | Base System | Reporter: | Matthias Apitz <guru> |
Component: | kern | Assignee: | Ed Maste <emaste> |
Status: | In Progress --- | ||
Severity: | Affects Some People | CC: | 000.fbsd, admin, brian, dvl, emaste, grahamperrin, guru, herbert, michael.osipov, mizhka, terry-freebsd |
Priority: | --- | Keywords: | needs-qa |
Version: | CURRENT | ||
Hardware: | arm64 | ||
OS: | Any | ||
URL: | https://cgit.freebsd.org/src/commit/?id=d53b44084e66e4d21bec7143f00a8677c90a09d2 |
Description
Matthias Apitz
2021-01-06 07:09:34 UTC
Obviously, this is already fixed in 05c312a339096ac54d404029ddfcd0114d452a4c (SVN: r364435): https://cgit.freebsd.org/src/commit/?id=05c312a339096ac54d404029ddfcd0114d452a4c https://svnweb.freebsd.org/base?view=revision&revision=364435 The system which was compiled was SVN rev. r368166 The message itself was fixed by base r364435, but it can still appear if you upgrade from an older source checkout. At some point kldxref should be made into a bootstrap tool, or some other trick should be used to force installkernel to use a fresh copy. We saw it today when installing a 13.0 RELEASE kernel on a 12.2 host Similar to the previous poster, I have an esxi vm with v 12 stable on it, where code was gotten via svnlite. I then deleted /usr/src, rebooted, and got v 13 stable via git clone. After the make kernel completed, I also saw this error. I am also seeing this on 12-STABLE r371492. My build script builds and installs world before the kernel, so this doesn't seem to be from a stale toolchain: cd /usr/obj rm -Rf usr cd ../src make -j24 buildworld && make installworld && make -j24 kernel (In reply to Terry Kennedy from comment #6) Applying the patch from base r364435 seems to fix the problem, so it seems we may just be looking at a missing MFC. A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=d53b44084e66e4d21bec7143f00a8677c90a09d2 commit d53b44084e66e4d21bec7143f00a8677c90a09d2 Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2020-08-20 18:50:46 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2022-01-14 15:45:14 +0000 Bump kldxref's MAXSEGS to 16, to stop complaints about the kernel supposedly having too many segments, when lld 11 links it. Such kernels should load just fine. Note that we may still do some tweaking of our kernel linker scripts, to lower the number of segments, although the exact benefit is not entirely clear. PR: 252459 (cherry picked from commit 05c312a339096ac54d404029ddfcd0114d452a4c) usr.sbin/kldxref/ef.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
The problem is still relevant for 12-STABLE.
# make installkernel 'KERNCONF=universal-12-3'
...
===> zlib (install)
install -T release -o root -g wheel -m 555 zlib.ko /boot/kernel/
install -T debug -o root -g wheel -m 555 zlib.ko.debug /usr/lib/debug/boot/kernel/
kldxref /boot/kernel
kldxref: /boot/kernel/kernel: too many segments
--------------------------------------------------------------
>>> Installing kernel universal-12-3 completed on Wed Jun 22 10:05:41 EEST 2022
--------------------------------------------------------------
# uname -KUr
12.3-STABLE 1203500 1203500
# svnlite info /usr/src | awk '/Revision:/ {print$2;}'
372167
I don't know what and where was fixed but something was probably forgotten. I see this error on FreeBSD 12.3-RELEASE-p10 amd64 GENERIC machine building update to 12.4-RELEASE # make installkernel DESTDIR=/vol0/12.4-RELEASE_amd64 kldxref: /vol0/12.4-RELEASE_amd64/boot/kernel/kernel: too many segments Triage: assignment to the committer of d53b44084e66e4d21bec7143f00a8677c90a09d2 (In reply to Vladyslav V. Prodan from comment #9) Up. #make installkernel 'KERNCONF=universal-13-3' ... kldxref /usr/obj/usr/src/amd64.amd64/release/dist/kernel/boot/kernel kldxref: error while reading /usr/obj/usr/src/amd64.amd64/release/dist/kernel/boot/kernel/iwlwifi-9000-pu-b0-jf-b0-46.ucode.ko: Bad address kldxref: error while reading /usr/obj/usr/src/amd64.amd64/release/dist/kernel/boot/kernel/iwlwifi-9260-th-b0-jf-b0-46.ucode.ko: Bad address kldxref: /usr/obj/usr/src/amd64.amd64/release/dist/kernel/boot/kernel/kernel: too many segments # uname -KUr 12.3-STABLE 1203500 1203500 # awk -F: '{print $2}' /usr/src/.gituprevision | head -1 6766a47c0 |