diffkemp
diffkemp copied to clipboard
DiffKemp requires input when building RHEL 8.4 and 8.5 kernels
When building the RHEL 8.4 and 8.5 kernels (4.18.0-305.el8
and linux-4.18.0-348.el8
, respectively) with the current version, DiffKemp hangs and is waiting for input while building the first function (__alloc_disk_node
). Upon pressing enter, the build continues. This seems like a bug, I will try to take a closer look when I have time.
Steps to reproduce:
- download the kernels using
rhel-kernel-get
- Run either
bin/diffkemp build-kernel kernel/linux-4.18.0-305.el8 snapshots/linux-4.18.0-305.el8 kernel/linux-4.18.0-305.el8/kabi_whitelist_x86_64
orbin/diffkemp build-kernel kernel/linux-4.18.0-348.el8 snapshots/linux-4.18.0-348.el8 kernel/linux-4.18.0-348.el8/kabi_whitelist_x86_64
I have tried to build 4.18.0-305.el8
and it seems that you are correct.
Hint: when you debug this, try to cd
to the kernel directory and manually run a build command, e.g.:
$ make V=1 --just-print block/genhd.o
That should also halt and you should see the reason (perhaps a missing config?).
I looked at this and it looks like:
-
When using the standard dev shell (
nix develop
) for both downloading (withrhel-kernel-get
script) and building the mentioned kernels (diffkemp build-kernel
) there is no problem (DiffKemp does not hang). -
When using the shell
nix develop .#test-kernel-buildenv
for downloading (rhel-kernel-get
) the mentioned kernels, theCONFIG_KASAN
is undefined. And then when using the normal dev shell (nix develop
) for building the mentioned kernels (diffkemp build-kernel
) the building hangs at* * Restart config... * * * KASAN: runtime memory debugger * KASAN: runtime memory debugger (KASAN) [N/y/?] (NEW)
because of the undefined
CONFIG_KASAN configuration
.To solve this, we could theoretically add
scripts/config --disable CONFIG_KASAN
inside therhel-kernel-get
script or inside thebuild-kernel
command.
Thanks for the analysis @PLukas2018.
Updating rhel-kernel-get
won't help here as this particular config is probably missing b/c the compiler in the Nix environment has different features than the one in normal dev shell. If you tried the mentioned commands in the test-kernel-buildenv
shell, they would work just fine.
So, I think that we have two options here:
- Update DiffKemp to automatically add the missing config by using
make olddefconfig
(which will set all the missing configs to the default values). The problem is that the user may not expect that and therefore we may end up analyzing a different kernel configuration than the user intended to. It'd have to be well-documented if we decide to go this way. - Detect the situation (kernel build stuck on a missing config) and fail the
build-kernel
command with a proper error message (which could even hint the user to runmake olddefconfig
on their own).
I slightly prefer the second option although I'm not sure how hard the detection would be.
Solved by #372 (detects if some configs are missing and exits with error message).