Skip to content

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

@ernsteiswuerfel

Description

@ernsteiswuerfel

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.

KTAP version 1
1..1
    KTAP version 1
    # Subtest: stackinit
    # module: stackinit_kunit
    1..108
    ok 1 test_u8_zero
    ok 2 test_u16_zero
    ok 3 test_u32_zero
    ok 4 test_u64_zero
    ok 5 test_char_array_zero
    ok 6 test_small_hole_zero
    # test_big_hole_zero: ASSERTION FAILED at lib/stackinit_kunit.c:428
    Expected sum == 0, but
        sum == 124 (0x7c)

uninit bytes: 124
    not ok 7 test_big_hole_zero
    ok 8 test_trailing_hole_zero
    ok 9 test_packed_zero
    ok 10 test_small_hole_old_zero
    # test_big_hole_old_zero: ASSERTION FAILED at lib/stackinit_kunit.c:429
    Expected sum == 0, but
        sum == 124 (0x7c)

uninit bytes: 124
    not ok 11 test_big_hole_old_zero
    ok 12 test_trailing_hole_old_zero
    ok 13 test_packed_old_zero
    ok 14 test_same_sizes_zero
    # test_small_start_zero: ASSERTION FAILED at lib/stackinit_kunit.c:430
    Expected sum == 0, but
        sum == 31 (0x1f)

uninit bytes: 31
    not ok 15 test_small_start_zero
    # test_small_end_zero: ASSERTION FAILED at lib/stackinit_kunit.c:430
    Expected sum == 0, but
        sum == 2 (0x2)

uninit bytes: 2
    not ok 16 test_small_end_zero
    ok 17 test_same_sizes_old_zero
    # test_small_start_old_zero: ASSERTION FAILED at lib/stackinit_kunit.c:431
    Expected sum == 0, but
        sum == 31 (0x1f)

uninit bytes: 31
    not ok 18 test_small_start_old_zero
    # test_small_end_old_zero: ASSERTION FAILED at lib/stackinit_kunit.c:431
    Expected sum == 0, but
        sum == 2 (0x2)

uninit bytes: 2
    not ok 19 test_small_end_old_zero
    # test_small_hole_dynamic_partial: ASSERTION FAILED at lib/stackinit_kunit.c:434
    Expected sum == 0, but
        sum == 3 (0x3)

uninit bytes: 3
    not ok 20 test_small_hole_dynamic_partial
    ok 21 test_big_hole_dynamic_partial
    # test_trailing_hole_dynamic_partial: ASSERTION FAILED at lib/stackinit_kunit.c:434
    Expected sum == 0, but
        sum == 3 (0x3)

uninit bytes: 3
    not ok 22 test_trailing_hole_dynamic_partial
    ok 23 test_packed_dynamic_partial
    # test_small_hole_assigned_dynamic_partial: ASSERTION FAILED at lib/stackinit_kunit.c:437
    Expected sum == 0, but
        sum == 3 (0x3)

uninit bytes: 3
    not ok 24 test_small_hole_assigned_dynamic_partial
    ok 25 test_big_hole_assigned_dynamic_partial
    # test_trailing_hole_assigned_dynamic_partial: ASSERTION FAILED at lib/stackinit_kunit.c:437
    Expected sum == 0, but
        sum == 3 (0x3)

uninit bytes: 3
    not ok 26 test_trailing_hole_assigned_dynamic_partial
    ok 27 test_packed_assigned_dynamic_partial
    ok 28 test_same_sizes_dynamic_partial
    ok 29 test_small_start_dynamic_partial
    ok 30 test_small_end_dynamic_partial
    ok 31 test_same_sizes_assigned_dynamic_partial
    ok 32 test_small_start_assigned_dynamic_partial
    ok 33 test_small_end_assigned_dynamic_partial
    ok 34 test_small_hole_static_partial
    # test_big_hole_static_partial: ASSERTION FAILED at lib/stackinit_kunit.c:433
    Expected sum == 0, but
        sum == 124 (0x7c)

uninit bytes: 124
    not ok 35 test_big_hole_static_partial
    ok 36 test_trailing_hole_static_partial
    ok 37 test_packed_static_partial
    ok 38 test_small_hole_static_all
    # test_big_hole_static_all: ASSERTION FAILED at lib/stackinit_kunit.c:433
    Expected sum == 0, but
        sum == 124 (0x7c)

uninit bytes: 124
    not ok 39 test_big_hole_static_all
    ok 40 test_trailing_hole_static_all
    ok 41 test_packed_static_all
    # test_small_hole_dynamic_all: ASSERTION FAILED at lib/stackinit_kunit.c:434
    Expected sum == 0, but
        sum == 3 (0x3)

uninit bytes: 3
    not ok 42 test_small_hole_dynamic_all
    ok 43 test_big_hole_dynamic_all
    # test_trailing_hole_dynamic_all: ASSERTION FAILED at lib/stackinit_kunit.c:434
    Expected sum == 0, but
        sum == 3 (0x3)

uninit bytes: 3
    not ok 44 test_trailing_hole_dynamic_all
    ok 45 test_packed_dynamic_all
    # test_small_hole_runtime_partial: ASSERTION FAILED at lib/stackinit_kunit.c:435
    Expected sum == 0, but
        sum == 15 (0xf)

uninit bytes: 15
    not ok 46 test_small_hole_runtime_partial
    # test_big_hole_runtime_partial: ASSERTION FAILED at lib/stackinit_kunit.c:435
    Expected sum == 0, but
        sum == 127 (0x7f)

uninit bytes: 127
    not ok 47 test_big_hole_runtime_partial
    # test_trailing_hole_runtime_partial: ASSERTION FAILED at lib/stackinit_kunit.c:435
    Expected sum == 0, but
        sum == 12 (0xc)

uninit bytes: 12
    not ok 48 test_trailing_hole_runtime_partial
    # test_packed_runtime_partial: ASSERTION FAILED at lib/stackinit_kunit.c:435
    Expected sum == 0, but
        sum == 12 (0xc)

uninit bytes: 12
    not ok 49 test_packed_runtime_partial
    # test_small_hole_runtime_all: ASSERTION FAILED at lib/stackinit_kunit.c:435
    Expected sum == 0, but
        sum == 3 (0x3)

uninit bytes: 3
    not ok 50 test_small_hole_runtime_all
    # test_big_hole_runtime_all: ASSERTION FAILED at lib/stackinit_kunit.c:435
    Expected sum == 0, but
        sum == 124 (0x7c)

uninit bytes: 124
    not ok 51 test_big_hole_runtime_all
    # test_trailing_hole_runtime_all: ASSERTION FAILED at lib/stackinit_kunit.c:435
    Expected sum == 0, but
        sum == 3 (0x3)

uninit bytes: 3
    not ok 52 test_trailing_hole_runtime_all
    ok 53 test_packed_runtime_all
    # test_small_hole_assigned_static_partial: ASSERTION FAILED at lib/stackinit_kunit.c:436
    Expected sum == 0, but
        sum == 3 (0x3)

uninit bytes: 3
    not ok 54 test_small_hole_assigned_static_partial
    ok 55 test_big_hole_assigned_static_partial
    # test_trailing_hole_assigned_static_partial: ASSERTION FAILED at lib/stackinit_kunit.c:436
    Expected sum == 0, but
        sum == 3 (0x3)

uninit bytes: 3
    not ok 56 test_trailing_hole_assigned_static_partial
    ok 57 test_packed_assigned_static_partial
    # test_small_hole_assigned_static_all: ASSERTION FAILED at lib/stackinit_kunit.c:436
    Expected sum == 0, but
        sum == 3 (0x3)

uninit bytes: 3
    not ok 58 test_small_hole_assigned_static_all
    ok 59 test_big_hole_assigned_static_all
    # test_trailing_hole_assigned_static_all: ASSERTION FAILED at lib/stackinit_kunit.c:436
    Expected sum == 0, but
        sum == 3 (0x3)

uninit bytes: 3
    not ok 60 test_trailing_hole_assigned_static_all
    ok 61 test_packed_assigned_static_all
    # test_small_hole_assigned_dynamic_all: ASSERTION FAILED at lib/stackinit_kunit.c:437
    Expected sum == 0, but
        sum == 3 (0x3)

uninit bytes: 3
    not ok 62 test_small_hole_assigned_dynamic_all
    ok 63 test_big_hole_assigned_dynamic_all
    # test_trailing_hole_assigned_dynamic_all: ASSERTION FAILED at lib/stackinit_kunit.c:437
    Expected sum == 0, but
        sum == 3 (0x3)

uninit bytes: 3
    not ok 64 test_trailing_hole_assigned_dynamic_all
    ok 65 test_packed_assigned_dynamic_all
    ok 66 test_same_sizes_static_partial
    # test_small_start_static_partial: ASSERTION FAILED at lib/stackinit_kunit.c:439
    Expected sum == 0, but
        sum == 31 (0x1f)

uninit bytes: 31
    not ok 67 test_small_start_static_partial
    ok 68 test_small_end_static_partial
    ok 69 test_same_sizes_static_all
    # test_small_start_static_all: ASSERTION FAILED at lib/stackinit_kunit.c:439
    Expected sum == 0, but
        sum == 28 (0x1c)

uninit bytes: 28
    not ok 70 test_small_start_static_all
    # test_small_end_static_all: ASSERTION FAILED at lib/stackinit_kunit.c:439
    Expected sum == 0, but
        sum == 3 (0x3)

uninit bytes: 3
    not ok 71 test_small_end_static_all
    ok 72 test_same_sizes_dynamic_all
    ok 73 test_small_start_dynamic_all
    # test_small_end_dynamic_all: ASSERTION FAILED at lib/stackinit_kunit.c:440
    Expected sum == 0, but
        sum == 3 (0x3)

uninit bytes: 3
    not ok 74 test_small_end_dynamic_all
    ok 75 test_same_sizes_runtime_partial
    # test_small_start_runtime_partial: ASSERTION FAILED at lib/stackinit_kunit.c:441
    Expected sum == 0, but
        sum == 31 (0x1f)

uninit bytes: 31
    not ok 76 test_small_start_runtime_partial
    ok 77 test_small_end_runtime_partial
    ok 78 test_same_sizes_runtime_all
    # test_small_start_runtime_all: ASSERTION FAILED at lib/stackinit_kunit.c:441
    Expected sum == 0, but
        sum == 28 (0x1c)

uninit bytes: 28
    not ok 79 test_small_start_runtime_all
    ok 80 test_small_end_runtime_all
    ok 81 test_same_sizes_assigned_static_partial
    ok 82 test_small_start_assigned_static_partial
    ok 83 test_small_end_assigned_static_partial
    ok 84 test_same_sizes_assigned_static_all
    ok 85 test_small_start_assigned_static_all
    # test_small_end_assigned_static_all: ASSERTION FAILED at lib/stackinit_kunit.c:442
    Expected sum == 0, but
        sum == 3 (0x3)

uninit bytes: 3
    not ok 86 test_small_end_assigned_static_all
    ok 87 test_same_sizes_assigned_dynamic_all
    ok 88 test_small_start_assigned_dynamic_all
    # test_small_end_assigned_dynamic_all: ASSERTION FAILED at lib/stackinit_kunit.c:443
    Expected sum == 0, but
        sum == 3 (0x3)

uninit bytes: 3
    not ok 89 test_small_end_assigned_dynamic_all
    ok 90 test_small_hole_assigned_copy # SKIP XFAIL uninit bytes: 3
    ok 91 test_big_hole_assigned_copy # SKIP XFAIL uninit bytes: 124
    ok 92 test_trailing_hole_assigned_copy # SKIP XFAIL uninit bytes: 3
    ok 93 test_packed_assigned_copy
    ok 94 test_same_sizes_assigned_copy
    ok 95 test_small_start_assigned_copy # SKIP XFAIL uninit bytes: 28
    ok 96 test_small_end_assigned_copy
    # test_u8_none: ASSERTION FAILED at lib/stackinit_kunit.c:446
    Expected sum == 0, but
        sum == 1 (0x1)

uninit bytes: 1
    not ok 97 test_u8_none
    # test_u16_none: ASSERTION FAILED at lib/stackinit_kunit.c:446
    Expected sum == 0, but
        sum == 2 (0x2)

uninit bytes: 2
    not ok 98 test_u16_none
    # test_u32_none: ASSERTION FAILED at lib/stackinit_kunit.c:446
    Expected sum == 0, but
        sum == 4 (0x4)

uninit bytes: 4
    not ok 99 test_u32_none
    # test_u64_none: ASSERTION FAILED at lib/stackinit_kunit.c:446
    Expected sum == 0, but
        sum == 8 (0x8)

uninit bytes: 8
    not ok 100 test_u64_none
    # test_char_array_none: ASSERTION FAILED at lib/stackinit_kunit.c:446
    Expected sum == 0, but
        sum == 16 (0x10)

uninit bytes: 16
    not ok 101 test_char_array_none
    ok 102 test_switch_1_none # SKIP XFAIL uninit bytes: 80
    ok 103 test_switch_2_none # SKIP XFAIL uninit bytes: 80
    # test_small_hole_none: ASSERTION FAILED at lib/stackinit_kunit.c:447
    Expected sum == 0, but
        sum == 16 (0x10)

uninit bytes: 16
    not ok 104 test_small_hole_none
    # test_big_hole_none: ASSERTION FAILED at lib/stackinit_kunit.c:447
    Expected sum == 0, but
        sum == 128 (0x80)

uninit bytes: 128
    not ok 105 test_big_hole_none
    # test_trailing_hole_none: ASSERTION FAILED at lib/stackinit_kunit.c:447
    Expected sum == 0, but
        sum == 16 (0x10)

uninit bytes: 16
    not ok 106 test_trailing_hole_none
    # test_packed_none: ASSERTION FAILED at lib/stackinit_kunit.c:447
    Expected sum == 0, but
        sum == 16 (0x10)

uninit bytes: 16
    not ok 107 test_packed_none
    # test_user: ASSERTION FAILED at lib/stackinit_kunit.c:449
    Expected sum == 0, but
        sum == 16 (0x10)

uninit bytes: 16
    not ok 108 test_user
# stackinit: pass:57 fail:45 skip:6 total:108
# Totals: pass:57 fail:45 skip:6 total:108
not ok 1 stackinit

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

Metadata

Metadata

Assignees

Labels

[BUG] linuxA bug that should be fixed in the mainline kernel.[FIXED][LINUX] 6.15This bug was fixed in Linux 6.15

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions