Subject: [libbpf] 41862faccd: kernel-selftests.bpf.make_fail

From: kernel test robot <[email-masked]>
Date: Fri, 17 Apr 2020 11:35:15 +0800

Greeting,

FYI, we noticed the following commit (built with gcc-7):

commit: 41862faccd8de068b39b8de522e459c4f1c457fc ("[PATCH] libbpf: Make bpf/bpf_helpers.h self-contained")
url: https://github.com/0day-ci/linux/commits/Yoshiki-Komachi/libbpf-Make-bpf-bpf_helpers-h-self-contained/20200407-143219
base: https://git.kernel.org/cgit/linux/kernel/git/bpf/bpf-next.git master

in testcase: kernel-selftests
with following parameters:

	group: kselftests-bpf
	ucode: 0xd6

test-description: The kernel contains a set of "self tests" under the tools/testing/selftests/ directory. These are intended to be small unit tests to exercise individual code paths in the kernel.
test-url: https://www.kernel.org/doc/Documentation/kselftest.txt

on test machine: 8 threads Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz with 16G memory

caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace):

If you fix the issue, kindly add following tag
Reported-by: kernel test robot <[email-masked]>

  BPF      runqslower.bpf.o
In file included from runqslower.bpf.c:4:
In file included from /usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-41862faccd8de068b39b8de522e459c4f1c457fc/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:5:
In file included from /usr/include/linux/types.h:9:
/usr/include/linux/posix_types.h:27:3: error: typedef redefinition with different types ('struct __kernel_fd_set' vs 'struct __kernel_fd_set')
} __kernel_fd_set;
  ^
/usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-41862faccd8de068b39b8de522e459c4f1c457fc/tools/testing/selftests/bpf/tools/include/vmlinux.h:45659:3: note: previous definition is here
} __kernel_fd_set;
  ^
In file included from runqslower.bpf.c:4:
In file included from /usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-41862faccd8de068b39b8de522e459c4f1c457fc/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:5:
In file included from /usr/include/linux/types.h:9:
In file included from /usr/include/linux/posix_types.h:36:
In file included from /usr/include/asm/posix_types.h:7:
In file included from /usr/include/asm/posix_types_64.h:18:
/usr/include/asm-generic/posix_types.h:68:22: error: typedef redefinition with different types ('unsigned int' vs '__kernel_ulong_t' (aka 'unsigned long'))
typedef unsigned int    __kernel_size_t;
                        ^
/usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-41862faccd8de068b39b8de522e459c4f1c457fc/tools/testing/selftests/bpf/tools/include/vmlinux.h:55:26: note: previous definition is here
typedef __kernel_ulong_t __kernel_size_t;
                         ^
In file included from runqslower.bpf.c:4:
In file included from /usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-41862faccd8de068b39b8de522e459c4f1c457fc/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:5:
In file included from /usr/include/linux/types.h:9:
In file included from /usr/include/linux/posix_types.h:36:
In file included from /usr/include/asm/posix_types.h:7:
In file included from /usr/include/asm/posix_types_64.h:18:
/usr/include/asm-generic/posix_types.h:69:14: error: typedef redefinition with different types ('int' vs '__kernel_long_t' (aka 'long'))
typedef int             __kernel_ssize_t;
                        ^
/usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-41862faccd8de068b39b8de522e459c4f1c457fc/tools/testing/selftests/bpf/tools/include/vmlinux.h:57:25: note: previous definition is here
typedef __kernel_long_t __kernel_ssize_t;
                        ^
In file included from runqslower.bpf.c:4:
In file included from /usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-41862faccd8de068b39b8de522e459c4f1c457fc/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:5:
In file included from /usr/include/linux/types.h:9:
In file included from /usr/include/linux/posix_types.h:36:
In file included from /usr/include/asm/posix_types.h:7:
In file included from /usr/include/asm/posix_types_64.h:18:
/usr/include/asm-generic/posix_types.h:70:14: error: typedef redefinition with different types ('int' vs '__kernel_long_t' (aka 'long'))
typedef int             __kernel_ptrdiff_t;
                        ^
/usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-41862faccd8de068b39b8de522e459c4f1c457fc/tools/testing/selftests/bpf/tools/include/vmlinux.h:60597:25: note: previous definition is here
typedef __kernel_long_t __kernel_ptrdiff_t;
                        ^
In file included from runqslower.bpf.c:4:
In file included from /usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-41862faccd8de068b39b8de522e459c4f1c457fc/tools/testing/selftests/bpf/tools/include/bpf/bpf_helpers.h:5:
In file included from /usr/include/linux/types.h:9:
In file included from /usr/include/linux/posix_types.h:36:
In file included from /usr/include/asm/posix_types.h:7:
In file included from /usr/include/asm/posix_types_64.h:18:
/usr/include/asm-generic/posix_types.h:81:3: error: typedef redefinition with different types ('struct __kernel_fsid_t' vs 'struct __kernel_fsid_t')
} __kernel_fsid_t;
  ^
/usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-41862faccd8de068b39b8de522e459c4f1c457fc/tools/testing/selftests/bpf/tools/include/vmlinux.h:30449:3: note: previous definition is here
} __kernel_fsid_t;
  ^
5 errors generated.
Makefile:56: recipe for target '/usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-41862faccd8de068b39b8de522e459c4f1c457fc/tools/testing/selftests/bpf/tools//runqslower.bpf.o' failed
make[1]: *** [/usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-41862faccd8de068b39b8de522e459c4f1c457fc/tools/testing/selftests/bpf/tools//runqslower.bpf.o] Error 1
Makefile:142: recipe for target '/usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-41862faccd8de068b39b8de522e459c4f1c457fc/tools/testing/selftests/bpf/runqslower' failed
make: *** [/usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-41862faccd8de068b39b8de522e459c4f1c457fc/tools/testing/selftests/bpf/runqslower] Error 2
make: Leaving directory '/usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-41862faccd8de068b39b8de522e459c4f1c457fc/tools/testing/selftests/bpf'

To reproduce:

        git clone https://github.com/intel/lkp-tests.git
        cd lkp-tests
        bin/lkp install job.yaml  # job file is attached in this email
        bin/lkp run     job.yaml

Thanks,
Rong Chen