Re: 13.4-RELEASE : freebsd-update fetch-then-install updated kernel but not /usr/lib/debug/boot/kernel/kernel.debug

From: Alan Somers <asomers_at_freebsd.org>
Date: Tue, 04 Feb 2025 15:41:08 UTC
On Sat, Dec 14, 2024 at 10:42 PM Mark Millard <marklmi@yahoo.com> wrote:
>
> I was looking have a context to be able to use kgdb for looking at
> a 13.4-RELEASE-p2 (so: a 13.4-RELEASE-p1 kernel).
>
> To get a set of files for 13.4-RELEASE-p2 I had to start from a
> 13.4-RELEASE and use freebsd-update : there is no direct download
> of a kernel*.txz set or other such for the patched kernel, so far
> as I can tell.
>
> But the freebsd-update update-then-install sequence:
>
> ) Updated boot/kernel/kernel (and more)
> yet:
> ) Did not update usr/lib/debug/boot/kernel/kernel.debug
>
> After the update, kgdb reports for the updated context:
>
> warning: the debug information found in "/usr/lib/debug//boot/kernel/kernel.debug" does not match "/boot/kernel/kernel" (CRC mismatch).
>
> And I diff'd before-vs-after copies of
> usr/lib/debug/boot/kernel/kernel.debug and it did not
> have a change of content, nor did its modification
> date change.
>
> How is one supposed to investigate via, say, panic backtrace
> addresses and such of a patched vintage of the likes of
> 13.4-RELEASE and its patched kernel? Does it require
> setting up an environment for rebuilding from source that
> will happen to accurately reproduce what the official
> build produced?
>
> I'd rather avoid the question of if a configuration for
> (re-)building is the cause of a difference vs. other
> potential causes of differences: I wish there were
> known-good download files to use for reference.
>
> I'll note that technically, for what I was attempting to
> do, I should only need expanded kernel.txz , kernel-dbg.txz ,
> and src.txz files if they were for the right patch level.
> It is the need to use freebsd-update that leads to involving
> far more.
>
>
> Somewhat related Side note . . .
>
> As noted in:
>
> https://lists.freebsd.org/archives/freebsd-pkgbase/2024-December/000483.html
>
> the likes of a PkgBase 14.2-RELEASE vs. a set of the *.txz for
> the "same" 14.2-RELEASE are not a full match, apparently with:
>
> ) pad byte differences
>
> ) Differences in memory layout for .rodata through .eh_frame  .
>    (File paths are recorded that have differing lengths, for
>     example.)
>
>
> ===
> Mark Millard
> marklmi at yahoo.com

I've noticed this, too.  I don't know why it happens, and it's
frustrating. It looks like sometimes freebsd-update will update a
kernel module's symbol file, ala
/usr/lib/debug/boot/kernel/ctl.ko.debug , but not update the symbols
for the kernel itself.  Other times, however, it updates both.