-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clang-19 built kernel fails several stackinit_kunit tests w. "ASSERTION FAILED at lib/stackinit_kunit.c" vs. same kernel built with gcc-14 passes tests (v6.14-rc3, x86_32) #2071
Comments
Also, does it happen if you turn off automatic pattern initialization? |
Did that. Interesting results. 🤓
|
This reproduces easily with
Have I mentioned how much I like the KUnit tooling? :) Observation: 64-bit architectures appear to all pass but the two 32-bit architectures I can test with
Now to figure out if this is a test problem or compiler issue... |
My educated guess is ... I am^W^Wthe tests are to blame. :) Specifically, pattern init hasn't gotten a lot of testing in the last couple years as everything moved to zero-init. I have considered actually removing the CONFIG option. But in the meantime, I will take a look at the tests. (Did they pass in Clang 18?) |
Does not seem like it:
|
At least INIT_STACK_ALL_PATTERN seems good enough to uncover some corner cases & bugs. 😉 Also the tests pass when GCC is used instead of clang. If I would have to guess as a non-expert this hints to clang/llvm implementation problems of INIT_STACK_ALL_PATTERN, not to an issue with pattern init itself. |
Gave v6.14-rc3 a test ride on my Thinkpad T60 and noticed stackinit_kunit tests fail when I build the kernel with clang-19. Same kernel built with gcc-14 passes test.
This is also reproducible on qemu. I used
qemu-system-i386 -smp 2 -m 2G -nographic -append "console=ttyS0 root=/dev/sda1" -kernel /boot/vmlinuz-6.14.0-rc3-P3 -hda Debian-VM_p3.img
on qemu 9.1.2 on Gentoo Linux with a Debian 12.9 image.Full dmesg from my Thinkpad T60 attached, Kernel .config attached.
config_614-rc3_p3-gcc14.txt
config_614-rc3_p3-clang19.txt
dmesg_614-rc3_p3-clang19.log
dmesg_614-rc3_p3-gcc14.log
The text was updated successfully, but these errors were encountered: