github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/pkg/build/build_test.go (about)

     1  // Copyright 2017 syzkaller project authors. All rights reserved.
     2  // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  package build
     5  
     6  import (
     7  	"fmt"
     8  	"os/exec"
     9  	"strings"
    10  	"testing"
    11  )
    12  
    13  func TestCompilerIdentity(t *testing.T) {
    14  	t.Parallel()
    15  	for _, compiler := range []string{"gcc", "clang", "bazel"} {
    16  		compiler := compiler
    17  		t.Run(compiler, func(t *testing.T) {
    18  			t.Parallel()
    19  			if _, err := exec.LookPath(compiler); err != nil {
    20  				t.Skipf("compiler '%v' is not found: %v", compiler, err)
    21  			}
    22  			id, err := compilerIdentity(compiler)
    23  			if err != nil {
    24  				t.Fatalf("failed: %v", err)
    25  			}
    26  			if id == "" {
    27  				t.Fatalf("identity is empty")
    28  			}
    29  			if strings.Contains(id, "\n") {
    30  				t.Fatalf("identity contains a new line")
    31  			}
    32  			// We don't know what's the right answer,
    33  			// so just print it for manual inspection.
    34  			t.Logf("id: '%v'", id)
    35  		})
    36  	}
    37  }
    38  
    39  func TestExtractRootCause(t *testing.T) {
    40  	for i, test := range rootCauseTests {
    41  		test := test
    42  		t.Run(fmt.Sprint(i), func(t *testing.T) {
    43  			reason, file := extractCauseInner([]byte(test.e), test.src)
    44  			if test.reason != string(reason) {
    45  				t.Errorf("expected:\n%s\ngot:\n%s", test.reason, reason)
    46  			}
    47  			if test.file != file {
    48  				t.Errorf("expected file: %q, got: %q", test.file, file)
    49  			}
    50  		})
    51  	}
    52  }
    53  
    54  type RootCauseTest struct {
    55  	e      string
    56  	reason string
    57  	src    string
    58  	file   string
    59  }
    60  
    61  // nolint: lll
    62  var rootCauseTests = []RootCauseTest{
    63  	{`
    64    LINK     /home/dvyukov/src/linux2/tools/objtool/objtool
    65    MKELF   scripts/mod/elfconfig.h
    66    HOSTCC  scripts/mod/modpost.o
    67    HOSTCC  scripts/mod/sumversion.o
    68    HOSTCC  scripts/mod/file2alias.o
    69    HOSTLD  scripts/mod/modpost
    70    CC      kernel/bounds.s
    71    CALL    scripts/atomic/check-atomics.sh
    72    CC      arch/x86/kernel/asm-offsets.s
    73    UPD     include/generated/asm-offsets.h
    74    CALL    scripts/checksyscalls.sh
    75  `,
    76  		"",
    77  		"",
    78  		"",
    79  	},
    80  	{`
    81  cc -g -Werror db_break.c
    82  sys/dev/kcov.c:93:6: error: use of undeclared identifier 'kcov_cold123'; did you mean 'kcov_cold'?
    83          if (kcov_cold123)
    84              ^~~~~~~~~~~~
    85              kcov_cold
    86  sys/dev/kcov.c:65:5: note: 'kcov_cold' declared here
    87  int kcov_cold = 1;
    88      ^
    89  1 error generated.
    90  `,
    91  		"sys/dev/kcov.c:93:6: error: use of undeclared identifier 'kcov_cold123'; did you mean 'kcov_cold'?",
    92  		"",
    93  		"sys/dev/kcov.c",
    94  	},
    95  	{`
    96    CC       /tools/objtool/parse-options.o
    97  In file included from ./scripts/gcc-plugins/gcc-common.h:119:0,
    98   from <stdin>:1:
    99  /gcc-5.5.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.5.0/plugin/include/builtins.h:23:17: fatal error: mpc.h: No such file or directory
   100  compilation terminated.
   101  Cannot use CONFIG_GCC_PLUGINS: your gcc installation does not support plugins, perhaps the necessary headers are missing?
   102  scripts/Makefile.gcc-plugins:51: recipe for target 'gcc-plugins-check' failed
   103  make: *** [gcc-plugins-check] Error 1
   104  make: *** Waiting for unfinished jobs....
   105    UPD     include/config/kernel.release
   106  `,
   107  		"/gcc-5.5.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.5.0/plugin/include/builtins.h:23:17: fatal error: mpc.h: No such file or directory",
   108  		"",
   109  		"",
   110  	},
   111  	{`
   112  Starting local Bazel server and connecting to it...
   113  Loading:
   114  Loading: 0 packages loaded
   115  Analyzing: target //runsc:runsc (1 packages loaded)
   116  Analyzing: target //runsc:runsc (5 packages loaded)
   117  Analyzing: target //runsc:runsc (15 packages loaded)
   118  Analyzing: target //runsc:runsc (92 packages loaded)
   119  Analyzing: target //runsc:runsc (99 packages loaded)
   120  Analyzing: target //runsc:runsc (115 packages loaded)
   121  ERROR: /kernel/vdso/BUILD:13:1: no such target '@bazel_tools//tools/cpp:cc_flags': target 'cc_flags' not declared in package 'tools/cpp' defined by /syzkaller/home/.cache/bazel/_bazel_root/e1c9d86bae2b34f90e83d224bc900958/external/bazel_tools/tools/cpp/BUILD and referenced by '//vdso:vdso'
   122  ERROR: Analysis of target '//runsc:runsc' failed; build aborted: Analysis failed
   123  INFO: Elapsed time: 14.914s
   124  INFO: 0 processes.
   125  FAILED: Build did NOT complete successfully (189 packages loaded)
   126  `,
   127  		`ERROR: /kernel/vdso/BUILD:13:1: no such target '@bazel_tools//tools/cpp:cc_flags': target 'cc_flags' not declared in package 'tools/cpp' defined by /syzkaller/home/.cache/bazel/_bazel_root/e1c9d86bae2b34f90e83d224bc900958/external/bazel_tools/tools/cpp/BUILD and referenced by '//vdso:vdso'
   128  ERROR: Analysis of target '//runsc:runsc' failed; build aborted: Analysis failed
   129  FAILED: Build did NOT complete successfully (189 packages loaded)`,
   130  		"",
   131  		"",
   132  	},
   133  	{`
   134  ld -T ld.script -X --warn-common -nopie -o bsd ${SYSTEM_HEAD} vers.o ${OBJS}
   135  ld: error: undefined symbol: __stack_smash_handler
   136  >>> referenced by bktr_card.c:0 (/kernel/sys/dev/pci/bktr/bktr_card.c:0)
   137  >>>               bktr_card.o:(probeCard)
   138  
   139  ld: error: undefined symbol: __stack_smash_handler
   140  >>> referenced by vnd.c:0 (/kernel/sys/dev/vnd.c:0)
   141  >>>               vnd.o:(vndencrypt)
   142  
   143  ld: error: undefined symbol: __stack_smash_handler
   144  >>> referenced by ihidev.c:0 (/kernel/sys/dev/i2c/ihidev.c:0)
   145  >>>               ihidev.o:(ihidev_attach)
   146  
   147  ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
   148  *** Error 1 in /kernel/sys/arch/amd64/compile/SYZKALLER (Makefile:991 'bsd': @echo ld -T ld.script -X --warn-commo...)
   149  `,
   150  		`ld: error: undefined symbol: __stack_smash_handler
   151  ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)`,
   152  		"",
   153  		"",
   154  	},
   155  	{`
   156  make: execvp: /gcc-5.5.0/bin/gcc: Permission denied
   157  scripts/kconfig/conf  --silentoldconfig Kconfig
   158  arch/x86/Makefile:123: stack-protector enabled but compiler support broken
   159  arch/x86/Makefile:138: CONFIG_X86_X32 enabled but no binutils support
   160  Makefile:652: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: -fstack-protector not supported by compiler
   161  make: execvp: /gcc-5.5.0/bin/gcc: Permission denied
   162    SYSTBL  arch/x86/entry/syscalls/../../include/generated/asm/syscalls_32.h
   163    SYSHDR  arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_x32.h
   164  scripts/xen-hypercalls.sh: line 7: /gcc-5.5.0/bin/gcc: Permission denied
   165    HOSTCC  scripts/mod/mk_elfconfig
   166  /bin/sh: 1: /gcc-5.5.0/bin/gcc: Permission denied
   167  scripts/Makefile.build:258: recipe for target 'scripts/mod/empty.o' failed
   168  make[2]: *** [scripts/mod/empty.o] Error 126
   169  make[2]: *** Waiting for unfinished jobs....
   170    CC      scripts/mod/devicetable-offsets.s
   171  /bin/sh: 1: /gcc-5.5.0/bin/gcc: Permission denied
   172  scripts/Makefile.build:153: recipe for target 'scripts/mod/devicetable-offsets.s' failed
   173  make[2]: *** [scripts/mod/devicetable-offsets.s] Error 126
   174    HOSTCC  scripts/selinux/mdp/mdp
   175    HOSTCC  scripts/selinux/genheaders/genheaders
   176  scripts/Makefile.build:403: recipe for target 'scripts/mod' failed
   177  make[1]: *** [scripts/mod] Error 2
   178  make[1]: *** Waiting for unfinished jobs....
   179    UPD     include/config/kernel.release
   180  Makefile:545: recipe for target 'scripts' failed
   181  make: *** [scripts] Error 2
   182  make: *** Waiting for unfinished jobs....
   183    HOSTLD  arch/x86/tools/relocs
   184  `,
   185  		`make: execvp: /gcc-5.5.0/bin/gcc: Permission denied
   186  scripts/xen-hypercalls.sh: line 7: /gcc-5.5.0/bin/gcc: Permission denied
   187  /bin/sh: 1: /gcc-5.5.0/bin/gcc: Permission denied`,
   188  		"",
   189  		"",
   190  	},
   191  	{`
   192  ./arch/x86/include/asm/nospec-branch.h:360:1: warning: data definition has no type or storage class
   193    360 | DECLARE_STATIC_KEY_FALSE(mds_user_clear);
   194        | ^~~~~~~~~~~~~~~~~~~~~~~~
   195  ./arch/x86/include/asm/nospec-branch.h:360:1: error: type defaults to ‘int’ in declaration of ‘DECLARE_STATIC_KEY_FALSE’ [-Werror=implicit-int]
   196  ./arch/x86/include/asm/nospec-branch.h:360:1: warning: parameter names (without types) in function declaration
   197  ./arch/x86/include/asm/nospec-branch.h: In function ‘mds_user_clear_cpu_buffers’:
   198  ./arch/x86/include/asm/nospec-branch.h:394:6: error: implicit declaration of function ‘static_branch_likely’ [-Werror=implicit-function-declaration]
   199    394 |  if (static_branch_likely(&mds_user_clear))
   200        |      ^~~~~~~~~~~~~~~~~~~~
   201  ./arch/x86/include/asm/nospec-branch.h:394:28: error: ‘mds_user_clear’ undeclared (first use in this function)
   202    394 |  if (static_branch_likely(&mds_user_clear))
   203        |                            ^~~~~~~~~~~~~~
   204  ./arch/x86/include/asm/nospec-branch.h:394:28: note: each undeclared identifier is reported only once for each function it appears in
   205  cc1: some warnings being treated as errors
   206  Kbuild:57: recipe for target 'arch/x86/kernel/asm-offsets.s' failed
   207  make[1]: *** [arch/x86/kernel/asm-offsets.s] Error 1
   208  Makefile:1227: recipe for target 'prepare0' failed
   209  make: *** [prepare0] Error 2
   210  `, `./arch/x86/include/asm/nospec-branch.h:360:1: error: type defaults to 'int' in declaration of 'DECLARE_STATIC_KEY_FALSE' [-Werror=implicit-int]
   211  ./arch/x86/include/asm/nospec-branch.h:394:6: error: implicit declaration of function 'static_branch_likely' [-Werror=implicit-function-declaration]
   212  ./arch/x86/include/asm/nospec-branch.h:394:28: error: 'mds_user_clear' undeclared (first use in this function)`,
   213  		"/some/unrelated/path",
   214  		"arch/x86/include/asm/nospec-branch.h",
   215  	},
   216  	{`
   217    CC      fs/notify/group.o
   218    CC      lib/zlib_deflate/deftree.o
   219    CC      net/ipv4/devinet.o
   220    CC      arch/x86/kernel/apic/apic_noop.o
   221    CC      arch/x86/kernel/crash_core_64.o
   222    CC      arch/x86/kernel/machine_kexec_64.o
   223  In file included from kernel/rcu/update.c:562:
   224  kernel/rcu/tasks.h: In function ‘show_rcu_tasks_gp_kthreads’:
   225  kernel/rcu/tasks.h:1070:37: error: ‘rcu_tasks_rude’ undeclared (first use in this function); did you mean ‘rcu_tasks_qs’?
   226   1070 |  show_rcu_tasks_generic_gp_kthread(&rcu_tasks_rude, "");
   227        |                                     ^~~~~~~~~~~~~~
   228        |                                     rcu_tasks_qs
   229  kernel/rcu/tasks.h:1070:37: note: each undeclared identifier is reported only once for each function it appears in
   230  scripts/Makefile.build:267: recipe for target 'kernel/rcu/update.o' failed
   231  make[2]: *** [kernel/rcu/update.o] Error 1
   232  scripts/Makefile.build:505: recipe for target 'kernel/rcu' failed
   233  make[1]: *** [kernel/rcu] Error 2
   234  make[1]: *** Waiting for unfinished jobs....
   235    CC      net/ipv4/af_inet.o
   236    CC      crypto/blowfish_common.o
   237    CC      arch/x86/kernel/apic/ipi.o
   238    CC      sound/hda/hdac_controller.o
   239  `,
   240  		"kernel/rcu/tasks.h:1070:37: error: 'rcu_tasks_rude' undeclared (first use in this function); did you mean 'rcu_tasks_qs'?",
   241  		"",
   242  		"kernel/rcu/tasks.h",
   243  	},
   244  	{`
   245    CC      arch/x86/boot/compressed/kaslr.o
   246    AS      arch/x86/boot/compressed/mem_encrypt.o
   247    CC      arch/x86/boot/compressed/kaslr_64.o
   248    CC      arch/x86/boot/compressed/pgtable_64.o
   249    CC      arch/x86/boot/compressed/acpi.o
   250  clang-10: /home/glider/llvm-project/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:941: void {anonymous}::X86AsmParser::SwitchMode(unsigned int): Assertion 'FeatureBitset({mode}) == (STI.getFeatureBits() & AllModes)' failed.
   251  Stack dump:
   252  0.	Program arguments: /syzkaller/clang-kmsan/bin/clang-10 -cc1as -triple x86_64-unknown-linux-gnu -filetype obj -main-file-name head_64.S -target-cpu x86-64 -target-feature -mmx -target-feature -sse -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi -I ./include/uapi -I ./include/generated/uapi -fdebug-compilation-dir /syzkaller/managers/upstream-kmsan-gce/kernel -dwarf-debug-producer clang version 10.0.0 (/home/glider/llvm-project/clang c2443155a0fb245c8f17f2c1c72b6ea391e86e81) -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi -I ./include/uapi -I ./include/generated/uapi -dwarf-version=4 -mrelocation-model pic -o arch/x86/boot/compressed/head_64.o /tmp/head_64-984db4.s 
   253  clang-10: /home/glider/llvm-project/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:941: void {anonymous}::X86AsmParser::SwitchMode(unsigned int): Assertion 'FeatureBitset({mode}) == (STI.getFeatureBits() & AllModes)' failed.
   254  Stack dump:
   255  0.	Program arguments: /syzkaller/clang-kmsan/bin/clang-10 -cc1as -triple x86_64-unknown-linux-gnu -filetype obj -main-file-name mem_encrypt.S -target-cpu x86-64 -target-feature -mmx -target-feature -sse -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi -I ./include/uapi -I ./include/generated/uapi -fdebug-compilation-dir /syzkaller/managers/upstream-kmsan-gce/kernel -dwarf-debug-producer clang version 10.0.0 (/home/glider/llvm-project/clang c2443155a0fb245c8f17f2c1c72b6ea391e86e81) -I ./arch/x86/include -I ./arch/x86/include/generated -I ./include -I ./arch/x86/include/uapi -I ./arch/x86/include/generated/uapi -I ./include/uapi -I ./include/generated/uapi -dwarf-version=4 -mrelocation-model pic -o arch/x86/boot/compressed/mem_encrypt.o /tmp/mem_encrypt-3c62ac.s 
   256  /syzkaller/clang-kmsan/bin/clang-10(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x1a)[0x285af4a]
   257  /syzkaller/clang-kmsan/bin/clang-10(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x1a)[0x285af4a]
   258  /syzkaller/clang-kmsan/bin/clang-10(_ZN4llvm3sys17RunSignalHandlersEv+0x3a)[0x2858c2a]
   259  /syzkaller/clang-kmsan/bin/clang-10(_ZN4llvm3sys17RunSignalHandlersEv+0x3a)[0x2858c2a]
   260  /syzkaller/clang-kmsan/bin/clang-10[0x2858d47]
   261  /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x14fcf8ccb390]
   262  /syzkaller/clang-kmsan/bin/clang-10[0x2858d47]
   263  /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x14bb99841390]
   264  /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x14fcf7a5e428]
   265  /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x14bb985d4428]
   266  /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x14fcf7a6002a]
   267  /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x14bb985d602a]
   268  /lib/x86_64-linux-gnu/libc.so.6(+0x2dbd7)[0x14fcf7a56bd7]
   269  /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x14fcf7a56c82]
   270  /lib/x86_64-linux-gnu/libc.so.6(+0x2dbd7)[0x14bb985ccbd7]
   271  /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x14bb985ccc82]
   272  /syzkaller/clang-kmsan/bin/clang-10[0x9aa6d8]
   273  /syzkaller/clang-kmsan/bin/clang-10[0x9aa6d8]
   274  /syzkaller/clang-kmsan/bin/clang-10[0x1b094da]
   275  /syzkaller/clang-kmsan/bin/clang-10[0x1b094da]
   276  /syzkaller/clang-kmsan/bin/clang-10[0x1b0d3a1]
   277  /syzkaller/clang-kmsan/bin/clang-10[0x1b0d3a1]
   278  /syzkaller/clang-kmsan/bin/clang-10[0x257bc55]
   279  /syzkaller/clang-kmsan/bin/clang-10[0x257bc55]
   280  /syzkaller/clang-kmsan/bin/clang-10[0x257f274]
   281  /syzkaller/clang-kmsan/bin/clang-10[0xb86f8e]
   282  /syzkaller/clang-kmsan/bin/clang-10(_Z10cc1as_mainN4llvm8ArrayRefIPKcEES2_Pv+0xc3f)[0xb8ac3f]
   283  /syzkaller/clang-kmsan/bin/clang-10(main+0x18e3)[0xaeb2d3]
   284  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x14fcf7a49830]
   285  /syzkaller/clang-kmsan/bin/clang-10[0x257f274]
   286  /syzkaller/clang-kmsan/bin/clang-10[0xb7f5d9]
   287  /syzkaller/clang-kmsan/bin/clang-10[0xb86f8e]
   288  /syzkaller/clang-kmsan/bin/clang-10(_Z10cc1as_mainN4llvm8ArrayRefIPKcEES2_Pv+0xc3f)[0xb8ac3f]
   289  /syzkaller/clang-kmsan/bin/clang-10(main+0x18e3)[0xaeb2d3]
   290  /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x14bb985bf830]
   291  /syzkaller/clang-kmsan/bin/clang-10[0xb7f5d9]
   292  clang-10: error: unable to execute command: Aborted (core dumped)
   293  clang-10: error: clang integrated assembler command failed due to signal (use -v to see invocation)
   294  clang version 10.0.0 (/home/glider/llvm-project/clang c2443155a0fb245c8f17f2c1c72b6ea391e86e81)
   295  Target: x86_64-unknown-linux-gnu
   296  Thread model: posix
   297  InstalledDir: /syzkaller/clang/bin
   298  clang-10: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
   299  clang-10: error: unable to execute command: Aborted (core dumped)
   300  clang-10: error: clang integrated assembler command failed due to signal (use -v to see invocation)
   301  clang version 10.0.0 (/home/glider/llvm-project/clang c2443155a0fb245c8f17f2c1c72b6ea391e86e81)
   302  Target: x86_64-unknown-linux-gnu
   303  Thread model: posix
   304  InstalledDir: /syzkaller/clang/bin
   305  clang-10: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
   306  clang-10: note: diagnostic msg: 
   307  ********************
   308  
   309  PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
   310  Preprocessed source(s) and associated run script(s) are located at:
   311  clang-10: note: diagnostic msg: /tmp/mem_encrypt-2af6ae.S
   312  clang-10: note: diagnostic msg: /tmp/mem_encrypt-2af6ae.sh
   313  clang-10: note: diagnostic msg: 
   314  
   315  ********************
   316  scripts/Makefile.build:348: recipe for target 'arch/x86/boot/compressed/mem_encrypt.o' failed
   317  make[2]: *** [arch/x86/boot/compressed/mem_encrypt.o] Error 254
   318  make[2]: *** Waiting for unfinished jobs....
   319  clang-10: note: diagnostic msg: 
   320  ********************
   321  
   322  PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
   323  Preprocessed source(s) and associated run script(s) are located at:
   324  clang-10: note: diagnostic msg: /tmp/head_64-96b27a.S
   325  clang-10: note: diagnostic msg: /tmp/head_64-96b27a.sh
   326  clang-10: note: diagnostic msg: 
   327  
   328  ********************
   329  scripts/Makefile.build:348: recipe for target 'arch/x86/boot/compressed/head_64.o' failed
   330  make[2]: *** [arch/x86/boot/compressed/head_64.o] Error 254
   331  arch/x86/boot/Makefile:115: recipe for target 'arch/x86/boot/compressed/vmlinux' failed
   332  make[1]: *** [arch/x86/boot/compressed/vmlinux] Error 2
   333  arch/x86/Makefile:284: recipe for target 'bzImage' failed
   334  make: *** [bzImage] Error 2
   335  `,
   336  		`clang-10: error: unable to execute command: Aborted (core dumped)
   337  clang-10: error: clang integrated assembler command failed due to signal (use -v to see invocation)`,
   338  		"",
   339  		"",
   340  	},
   341  	{`
   342  scripts/kconfig/conf  --syncconfig Kconfig
   343    DESCEND  objtool
   344    CALL    scripts/atomic/check-atomics.sh
   345    CALL    scripts/checksyscalls.sh
   346    CHK     include/generated/compile.h
   347    GZIP    kernel/config_data.gz
   348    CC      kernel/configs.o
   349    AR      kernel/built-in.a
   350    GEN     .version
   351    LD      vmlinux.o
   352    MODPOST vmlinux.o
   353    MODINFO modules.builtin.modinfo
   354    GEN     modules.builtin
   355    LD      .tmp_vmlinux1
   356  arch/x86/platform/efi/efi_64.o: In function 'efi_thunk_set_virtual_address_map':
   357  /syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/arch/x86/platform/efi/efi_64.c:560: undefined reference to '__efi64_thunk'
   358  arch/x86/platform/efi/efi_64.o: In function 'efi_set_virtual_address_map':
   359  /syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/arch/x86/platform/efi/efi_64.c:902: undefined reference to 'efi_uv1_memmap_phys_prolog'
   360  /syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/arch/x86/platform/efi/efi_64.c:921: undefined reference to 'efi_uv1_memmap_phys_epilog'
   361  Makefile:1078: recipe for target 'vmlinux' failed
   362  make: *** [vmlinux] Error 1
   363  `,
   364  		`arch/x86/platform/efi/efi_64.c:560: undefined reference to '__efi64_thunk'
   365  arch/x86/platform/efi/efi_64.c:902: undefined reference to 'efi_uv1_memmap_phys_prolog'
   366  arch/x86/platform/efi/efi_64.c:921: undefined reference to 'efi_uv1_memmap_phys_epilog'`,
   367  		"/syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel",
   368  		"arch/x86/platform/efi/efi_64.c",
   369  	},
   370  	{`
   371  /syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/arch/x86/platform/efi/efi_64.c:560: undefined reference to '__efi64_thunk'
   372  `,
   373  		`arch/x86/platform/efi/efi_64.c:560: undefined reference to '__efi64_thunk'`,
   374  		"/syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/",
   375  		"arch/x86/platform/efi/efi_64.c",
   376  	},
   377  	{`
   378    CC      net/ipv6/ip6_output.o
   379    CC      security/selinux/ss/policydb.o
   380    CC      net/ipv4/route.o
   381  In file included from security/smack/smack_netfilter.c:18:
   382  ./include/linux/netfilter_ipv6.h: In function ‘nf_ipv6_br_defrag’:
   383  ./include/linux/netfilter_ipv6.h:110:9: error: implicit declaration of function ‘nf_ct_frag6_gather’ [-Werror=implicit-function-declaration]
   384    110 |  return nf_ct_frag6_gather(net, skb, user);
   385        |         ^~~~~~~~~~~~~~~~~~
   386  In file included from security/apparmor/lsm.c:27:
   387  ./include/linux/netfilter_ipv6.h: In function ‘nf_ipv6_br_defrag’:
   388  ./include/linux/netfilter_ipv6.h:110:9: error: implicit declaration of function ‘nf_ct_frag6_gather’ [-Werror=implicit-function-declaration]
   389    110 |  return nf_ct_frag6_gather(net, skb, user);
   390        |         ^~~~~~~~~~~~~~~~~~
   391  In file included from net/bridge/br_netfilter_ipv6.c:30:
   392  ./include/linux/netfilter_ipv6.h: In function ‘nf_ipv6_br_defrag’:
   393  ./include/linux/netfilter_ipv6.h:110:9: error: implicit declaration of function ‘nf_ct_frag6_gather’ [-Werror=implicit-function-declaration]
   394    110 |  return nf_ct_frag6_gather(net, skb, user);
   395        |         ^~~~~~~~~~~~~~~~~~
   396  In file included from net/bridge/br_netfilter_hooks.c:31:
   397  ./include/linux/netfilter_ipv6.h: In function ‘nf_ipv6_br_defrag’:
   398  ./include/linux/netfilter_ipv6.h:110:9: error: implicit declaration of function ‘nf_ct_frag6_gather’ [-Werror=implicit-function-declaration]
   399    110 |  return nf_ct_frag6_gather(net, skb, user);
   400        |         ^~~~~~~~~~~~~~~~~~
   401    CC      net/openvswitch/datapath.o
   402    CC      net/llc/llc_output.o
   403    CC      net/ieee802154/core.o
   404  cc1: some warnings being treated as errors
   405  scripts/Makefile.build:278: recipe for target 'security/smack/smack_netfilter.o' failed
   406  make[2]: *** [security/smack/smack_netfilter.o] Error 1
   407  scripts/Makefile.build:489: recipe for target 'security/smack' failed
   408  make[1]: *** [security/smack] Error 2
   409  make[1]: *** Waiting for unfinished jobs....
   410    CC      net/lapb/lapb_iface.o
   411    CC      net/netlabel/netlabel_domainhash.o
   412    CC      net/netlabel/netlabel_addrlist.o
   413  `,
   414  		"./include/linux/netfilter_ipv6.h:110:9: error: implicit declaration of function 'nf_ct_frag6_gather' [-Werror=implicit-function-declaration]",
   415  		"",
   416  		"include/linux/netfilter_ipv6.h",
   417  	},
   418  	{`
   419  ld: mm/slub.o: in function '__kmem_cache_create':
   420  slub.c:(.text+0x6260): multiple definition of '__kmem_cache_create'; mm/page_alloc.o:page_alloc.c:(.text+0x1970): first defined here
   421  make: *** [Makefile:1139: vmlinux] Error 1
   422  `,
   423  		"slub.c:(.text+0x6260): multiple definition of '__kmem_cache_create'; mm/page_alloc.o:page_alloc.c:(.text+0x1970): first defined here",
   424  		"",
   425  		"mm/page_alloc.c",
   426  	},
   427  	{`
   428  ld: mm/slub.o:(.bss+0x0): multiple definition of 'foobar'; mm/page_alloc.o:(.bss+0x34): first defined here
   429  make: *** [Makefile:1139: vmlinux] Error 1
   430  `,
   431  		"ld: mm/slub.o:(.bss+0x0): multiple definition of 'foobar'; mm/page_alloc.o:(.bss+0x34): first defined here",
   432  		"",
   433  		"mm/slub.c",
   434  	},
   435  	{`
   436  ld.lld: error: duplicate symbol: __kmem_cache_create
   437  >>> defined at page_alloc.c
   438  >>>            page_alloc.o:(__kmem_cache_create) in archive mm/built-in.a
   439  >>> defined at slub.c
   440  >>>            slub.o:(.text+0x6260) in archive mm/built-in.a
   441  make: *** [Makefile:1139: vmlinux] Error 1
   442  `,
   443  		"ld.lld: error: duplicate symbol: __kmem_cache_create",
   444  		"",
   445  		"", // ld.lld makes it very hard to extract the file name
   446  	},
   447  	{`
   448  ld.lld: error: duplicate symbol: foobar
   449  >>> defined at page_alloc.c
   450  >>>            page_alloc.o:(foobar) in archive mm/built-in.a
   451  >>> defined at slub.c
   452  >>>            slub.o:(.bss+0x0) in archive mm/built-in.a
   453  make: *** [Makefile:1139: vmlinux] Error 1
   454  `,
   455  		"ld.lld: error: duplicate symbol: foobar",
   456  		"",
   457  		"", // ld.lld makes it very hard to extract the file name
   458  	},
   459  	{`
   460  mm/page_alloc.o:(.data+0x1a40): multiple definition of '__kmem_cache_create'
   461  mm/slub.o:(.data+0x7a0): first defined here
   462  Makefile:1160: recipe for target 'vmlinux' failed
   463  make: *** [vmlinux] Error 1
   464  `,
   465  		"mm/page_alloc.o:(.data+0x1a40): multiple definition of '__kmem_cache_create'",
   466  		"",
   467  		"mm/page_alloc.c",
   468  	},
   469  	{`
   470    LZ4     arch/x86/boot/compressed/vmlinux.bin.lz4
   471  /bin/sh: 1: lz4: not found
   472  arch/x86/boot/compressed/Makefile:151: recipe for target 'arch/x86/boot/compressed/vmlinux.bin.lz4' failed
   473  make[2]: *** [arch/x86/boot/compressed/vmlinux.bin.lz4] Error 127
   474  make[2]: *** Deleting file 'arch/x86/boot/compressed/vmlinux.bin.lz4'
   475  make[2]: *** Waiting for unfinished jobs....
   476  arch/x86/boot/Makefile:112: recipe for target 'arch/x86/boot/compressed/vmlinux' failed
   477  make[1]: *** [arch/x86/boot/compressed/vmlinux] Error 2
   478  arch/x86/Makefile:290: recipe for target 'bzImage' failed
   479  make: *** [bzImage] Error 2
   480  `,
   481  		"/bin/sh: 1: lz4: not found",
   482  		"",
   483  		"",
   484  	},
   485  	{`
   486    HOSTCC  scripts/basic/fixdep
   487    HOSTCC  scripts/kconfig/conf.o
   488    HOSTCC  scripts/kconfig/confdata.o
   489    HOSTCC  scripts/kconfig/expr.o
   490    LEX     scripts/kconfig/lexer.lex.c
   491    YACC    scripts/kconfig/parser.tab.[ch]
   492    HOSTCC  scripts/kconfig/preprocess.o
   493    HOSTCC  scripts/kconfig/symbol.o
   494    HOSTCC  scripts/kconfig/util.o
   495    HOSTCC  scripts/kconfig/lexer.lex.o
   496    HOSTCC  scripts/kconfig/parser.tab.o
   497    HOSTLD  scripts/kconfig/conf
   498  /usr/bin/env: invalid option -- 'S'
   499  Try '/usr/bin/env --help' for more information.
   500  init/Kconfig:39: syntax error
   501  init/Kconfig:38: invalid statement
   502  scripts/kconfig/Makefile:71: recipe for target 'oldconfig' failed
   503  make[1]: *** [oldconfig] Error 1
   504  Makefile:602: recipe for target 'oldconfig' failed
   505  make: *** [oldconfig] Error 2
   506  `,
   507  		"init/Kconfig:39: syntax error\ninit/Kconfig:38: invalid statement",
   508  		"",
   509  		"init/Kconfig",
   510  	},
   511  	{`
   512    LD      vmlinux
   513    BTFIDS  vmlinux
   514  FAILED unresolved symbol dctcp_update_alpha
   515  make: *** [Makefile:1292: vmlinux] Error 255
   516  `,
   517  		"FAILED unresolved symbol dctcp_update_alpha",
   518  		"",
   519  		"",
   520  	},
   521  	{`
   522  scripts/kconfig/conf  --syncconfig Kconfig
   523  
   524  *** Error during update of the configuration.
   525  
   526  make[2]: *** [scripts/kconfig/Makefile:41: syncconfig] Error 1
   527  make[1]: *** [Makefile:545: syncconfig] Error 2
   528  make: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/kernel.release'.  Stop.
   529  make: *** Waiting for unfinished jobs....
   530  `,
   531  		"make: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/kernel.release'.  Stop.",
   532  		"",
   533  		"",
   534  	},
   535  	{`
   536  sh: 1: column: not found
   537  FAILED: host_x64/obj/tools/docsgen/clidoc_out.tar.gz
   538  ../../build/rbe/output-scanner.sh --label //tools/docsgen:invoke_clidoc\(//build/toolchain:host_x64\) host_x64/obj/tools/docsgen/clidoc_out.tar.gz -- ../../build/gn_run_binary.sh ../../prebuilt/third_party/clang/linux-x64/bin host_x64/clidoc -o host_x64/gen/tools/docsgen/sdk-docs --quiet --tarball-dir host_x64/obj/tools/docsgen/clidoc_out.tar.gz --depfile host_x64/obj/tools/docsgen/invoke_clidoc.d
   539  Error: Unable to write generate doc for "/syzkaller/managers/main/kernel/out/x64/host_x64/fpublish" to "host_x64/gen/tools/docsgen/sdk-docs"
   540  Caused by:
   541      Error running help: Unexpected non-zero error code with tool "/syzkaller/managers/main/kernel/out/x64/host_x64/fpublish"
   542                  and subcommands [].
   543  ninja: build stopped: subcommand failed.
   544  `,
   545  		`Error: Unable to write generate doc for "/syzkaller/managers/main/kernel/out/x64/host_x64/fpublish" to "host_x64/gen/tools/docsgen/sdk-docs"`,
   546  		"",
   547  		"",
   548  	},
   549  }