Re: pkgbase sometimes reported package vs. running kernel mismatches [ 1400505 vs. 1400501] (despite uname -KU producing 1400505 1400505)

From: Kirill Ponomarev <kp_at_krion.cc>
Date: Sat, 27 Jan 2024 08:20:15 UTC
On 01/20, Mark Millard wrote:
> I got some odd reports of the likes of:
> 
> Newer FreeBSD version for package FreeBSD-tcpd-lib32:
> To ignore this error set IGNORE_OSVERSION=yes
> - package: 1400505
> - running kernel: 1400501
> Ignore the mismatch and continue? [y/N]: 
> 
> It was in a context with:
> 
> # uname -apKU
> FreeBSD generic 14.0-STABLE FreeBSD 14.0-STABLE stable/14-n266448-e2b71e1490a3 GENERIC arm64 aarch64 1400505 1400505
> 
> # file /usr/sbin/pkg* /usr/local/sbin/pkg*
> /usr/sbin/pkg:                ELF 64-bit LSB pie executable, ARM aarch64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 14.0 (1400501), FreeBSD-style, stripped
> /usr/local/sbin/pkg:          ELF 64-bit LSB executable, ARM aarch64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 14.0 (1400097), FreeBSD-style, with debug_info, not stripped
> /usr/local/sbin/pkg-static:   ELF 64-bit LSB executable, ARM aarch64, version 1 (FreeBSD), statically linked, for FreeBSD 14.0 (1400097), FreeBSD-style, with debug_info, not stripped
> /usr/local/sbin/pkg_libchk:   POSIX shell script, ASCII text executable
> /usr/local/sbin/pkg_trim:     POSIX shell script, ASCII text executable
> /usr/local/sbin/pkg_validate: POSIX shell script, ASCII text executable
> 
> # ls -Tlodt /usr/sbin/pkg* /usr/local/sbin/pkg*
> -r-xr-xr-x  1 root wheel -    33328 Jan 19 19:40:53 2024 /usr/sbin/pkg
> -rwxr-xr-x  1 root wheel -      235 Jan  9 20:48:36 2024 /usr/local/sbin/pkg_libchk
> -rwxr-xr-x  1 root wheel -      235 Jan  9 20:48:36 2024 /usr/local/sbin/pkg_trim
> -rwxr-xr-x  1 root wheel -      235 Jan  9 20:48:36 2024 /usr/local/sbin/pkg_validate
> -rwxr-xr-x  1 root wheel -  3353416 Jan  5 21:30:02 2024 /usr/local/sbin/pkg
> -rwxr-xr-x  1 root wheel - 32710384 Jan  5 21:30:02 2024 /usr/local/sbin/pkg-static
> 
> 
> But the pkg results were somewhat variable, despite that stable context.
> I tried reboots multiple times and still got mixed results.
> 
> I do not known where the 1400501 in "running kernel: 1400501" came
> from when it was reported.

I see these anomalies here as well:

~ uname -apKU
FreeBSD krion.cc 15.0-CURRENT FreeBSD 15.0-CURRENT main-n267784-2d05a1c81b2c GENERIC amd64 amd64 1500012 1500012
~ ls -Tlodt /usr/sbin/pkg* /usr/local/sbin/pkg*

-r-xr-xr-x  1 root wheel uarch    34832 Jan 25 19:35:45 2024 /usr/sbin/pkg
-rwxr-xr-x  1 root wheel uarch  3408416 Jan 23 21:31:27 2024 /usr/local/sbin/pkg
-rwxr-xr-x  1 root wheel uarch 34087808 Jan 23 21:31:27 2024 /usr/local/sbin/pkg-static

~ file /usr/sbin/pkg* /usr/local/sbin/pkg*
/usr/sbin/pkg:              ELF 64-bit LSB pie executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 15.0 (1500007), FreeBSD-style, stripped
/usr/local/sbin/pkg:        ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 15.0 (1500011), FreeBSD-style, with debug_info, not stripped
/usr/local/sbin/pkg-static: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), statically linked, for FreeBSD 15.0 (1500011), FreeBSD-style, with debug_info, not stripped

Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
Updating FreeBSD-base repository catalogue...
Fetching packagesite.pkg: 100%   39 KiB  40.2kB/s    00:01
Processing entries:   0%
Newer FreeBSD version for package FreeBSD-wpa-man:
To ignore this error set IGNORE_OSVERSION=yes
- package: 1500012
- running kernel: 1500007