ubuntu_bpf failed to build with F-hwe-5.15

Bug #2034483 reported by Po-Hsu Lin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-kernel-tests
New
Undecided
Unassigned

Bug Description

Issue found with 5.15.0-83.92~20.04.1

This is not a regression as we didn't test ubuntu_bpf on this kernel before.

Test build failed with:
    CLNG-BPF [test_maps] test_global_func13.o
    CLNG-BPF [test_maps] test_cls_redirect_subprogs.o
    CLNG-BPF [test_maps] test_overhead.o
    CLNG-BPF [test_maps] timer_mim.o
  make[1]: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf'
  make: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests'
  stderr:
  Warning: Kernel ABI header at 'tools/include/uapi/linux/bpf.h' differs from latest version at 'include/uapi/linux/bpf.h'
  Warning: Kernel ABI header at 'tools/include/uapi/linux/netlink.h' differs from latest version at 'include/uapi/linux/netlink.h'
  Warning: Kernel ABI header at 'tools/include/uapi/linux/if_link.h' differs from latest version at 'include/uapi/linux/if_link.h'
  In file included from progs/timer_mim.c:7:
  /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/bpf_tcp_helpers.h:24:18: warning: unknown attribute 'preserve_access_index' ignored [-Wunknown-attributes]
  } __attribute__((preserve_access_index));
                   ^
  /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/bpf_tcp_helpers.h:37:18: warning: unknown attribute 'preserve_access_index' ignored [-Wunknown-attributes]
  } __attribute__((preserve_access_index));
                   ^
  /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/bpf_tcp_helpers.h:41:18: warning: unknown attribute 'preserve_access_index' ignored [-Wunknown-attributes]
  } __attribute__((preserve_access_index));
                   ^
  /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/bpf_tcp_helpers.h:52:18: warning: unknown attribute 'preserve_access_index' ignored [-Wunknown-attributes]
  } __attribute__((preserve_access_index));
                   ^
  /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/bpf_tcp_helpers.h:56:18: warning: unknown attribute 'preserve_access_index' ignored [-Wunknown-attributes]
  } __attribute__((preserve_access_index));
                   ^
  /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/bpf_tcp_helpers.h:84:18: warning: unknown attribute 'preserve_access_index' ignored [-Wunknown-attributes]
  } __attribute__((preserve_access_index));
                   ^
  /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/bpf_tcp_helpers.h:133:18: warning: unknown attribute 'preserve_access_index' ignored [-Wunknown-attributes]
  } __attribute__((preserve_access_index));
                   ^
  /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/bpf_tcp_helpers.h:149:18: warning: unknown attribute 'preserve_access_index' ignored [-Wunknown-attributes]
  } __attribute__((preserve_access_index));
                   ^
  /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/bpf_tcp_helpers.h:208:11: error: use of unknown builtin '__builtin_preserve_field_info' [-Wimplicit-function-declaration]
          return !!BPF_CORE_READ_BITFIELD(tp, is_cwnd_limited);
                   ^
  /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tools/include/bpf/bpf_core_read.h:88:36: note: expanded from macro 'BPF_CORE_READ_BITFIELD'
          const void *p = (const void *)s + __CORE_RELO(s, field, BYTE_OFFSET); \
                                            ^
  /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tools/include/bpf/bpf_core_read.h:41:2: note: expanded from macro '__CORE_RELO'
          __builtin_preserve_field_info((src)->field, BPF_FIELD_##info)
          ^
  8 warnings and 1 error generated.
  make[1]: *** [Makefile:470: /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/timer_mim.o] Error 1
  make: *** [Makefile:171: all] Error 2

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Error message on F-hwe-5.15 ARM64

 [stdout] CLNG-BPF [test_maps] tailcall3.o
 [stdout] CLNG-BPF [test_maps] freplace_global_func.o
 [stdout] CLNG-BPF [test_maps] btf__core_reloc_nesting___err_missing_container.o
 [stdout] CLNG-BPF [test_maps] btf_dump_test_case_packing.o
 [stdout] CLNG-BPF [test_maps] test_endian.o
 [stderr] In file included from progs/test_endian.c:4:
 [stderr] /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tools/include/vmlinux.h:5:15: error: attribute 'preserve_access_index' is not supported by '#pragma clang attribute'
 [stderr] #pragma clang attribute push (__attribute__((preserve_access_index)), apply_to = record)
 [stderr] ^
 [stderr] /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tools/include/vmlinux.h:160504:15: error: '#pragma clang attribute pop' with no matching '#pragma clang attribute push'
 [stderr] #pragma clang attribute pop
 [stderr] ^
 [stderr] 2 errors generated.
 [stderr] make[1]: *** [Makefile:470: /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/test_endian.o] Error 1
 [stdout] make[1]: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf'
 [stdout] make: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests'
 [stderr] make: *** [Makefile:171: all] Error 2

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :
Download full text (5.7 KiB)

Tested with different clang / llvm available on Focal:
clang-10 and llvm-10, test build will fail with:
    CLNG-BPF [test_maps] pyperf600.o
    CLNG-BPF [test_maps] profiler2.o
    CLNG-BPF [test_maps] test_pe_preserve_elems.o
    CLNG-BPF [test_maps] atomics.o
  make[1]: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf'
  make: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests'
  stderr:
  Warning: Kernel ABI header at 'tools/include/uapi/linux/bpf.h' differs from latest version at 'include/uapi/linux/bpf.h'
  Warning: Kernel ABI header at 'tools/include/uapi/linux/netlink.h' differs from latest version at 'include/uapi/linux/netlink.h'
  Warning: Kernel ABI header at 'tools/include/uapi/linux/if_link.h' differs from latest version at 'include/uapi/linux/if_link.h'
  fatal error: error in backend: line 27: Invalid usage of the XADD return value
  Stack dump:
  0. Program arguments: clang-10 -g -D__TARGET_ARCH_x86 -mlittle-endian -I/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/tools/include -I/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf -I/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/include/uapi -I/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/usr/include -idirafter /usr/local/include -idirafter /usr/lib/llvm-10/lib/clang/10.0.0/include -idirafter /usr/include/x86_64-linux-gnu -idirafter /usr/include -Wno-compare-distinct-pointer-types -DENABLE_ATOMICS_TESTS -O2 -target bpf -c progs/atomics.c -o /home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf/atomics.o -mcpu=v3
  1. <eof> parser at end of file
  2. Code generation
  3. Running pass 'Function Pass Manager' on module 'progs/atomics.c'.
  4. Running pass 'BPF PreEmit Checking' on function '@add'
  /lib/x86_64-linux-gnu/libLLVM-10.so.1(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x1f)[0x7f66edf4d4ff]
  /lib/x86_64-linux-gnu/libLLVM-10.so.1(_ZN4llvm3sys17RunSignalHandlersEv+0x50)[0x7f66edf4b7b0]

clang-11 and llvm-11, test build will fail with:
    CLNG-BPF [test_maps] test_l4lb.o
    CLNG-BPF [test_maps] pyperf600.o
    CLNG-BPF [test_maps] profiler2.o
    CLNG-BPF [test_maps] test_pe_preserve_elems.o
    CLNG-BPF [test_maps] atomics.o
  make[1]: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests/bpf'
  make: Leaving directory '/home/ubuntu/autotest/client/tmp/ubuntu_bpf/src/linux/tools/testing/selftests'
  stderr:
  Warning: Kernel ABI header at 'tools/include/uapi/linux/bpf.h' differs from latest version at 'include/uapi/linux/bpf.h'
  Warning: Kernel ABI header at 'tools/include/uapi/linux/netlink.h' differs from latest version at 'include/uapi/linux/netlink.h'
  Warning: Kernel ABI header at 'tools/include/uapi/linux/if_link.h' differs from latest version at 'include/uapi/linux/if_link.h'
  fatal error: error in backend: line 27: Invalid usage of the XADD return value
  PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated ru...

Read more...

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

OK I noticed that clang-13 is available in focal-proposed universe, and with this version the test can be built.

Since we don't enable -proposed for SRU now, and this package has already stayed in -proposed since 2022-07-15. Looks like it's unlikely to get promoted to -updates.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.