aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/build/build_test.go
blob: 841c56962bc60ff40b35e8dd47343e6bb8afb0d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
// Copyright 2017 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

package build

import (
	"fmt"
	"os/exec"
	"strings"
	"testing"

	"github.com/google/syzkaller/pkg/osutil"
	"github.com/google/syzkaller/sys/targets"
	"github.com/stretchr/testify/assert"
)

func TestCompilerIdentity(t *testing.T) {
	t.Parallel()
	for _, compiler := range []string{"gcc", "clang", "bazel"} {
		t.Run(compiler, func(t *testing.T) {
			t.Parallel()
			if _, err := exec.LookPath(compiler); err != nil {
				t.Skipf("compiler '%v' is not found: %v", compiler, err)
			}
			id, err := compilerIdentity(compiler)
			if err != nil {
				t.Fatalf("failed: %v", err)
			}
			if id == "" {
				t.Fatalf("identity is empty")
			}
			if strings.Contains(id, "\n") {
				t.Fatalf("identity contains a new line")
			}
			// We don't know what's the right answer,
			// so just print it for manual inspection.
			t.Logf("id: '%v'", id)
		})
	}
}

func TestExtractCauseInner(t *testing.T) {
	for i, test := range rootCauseTests {
		t.Run(fmt.Sprint(i), func(t *testing.T) {
			reason, file := extractCauseInner([]byte(test.e), test.src)
			if test.reason != string(reason) {
				t.Errorf("expected:\n%s\ngot:\n%s", test.reason, reason)
			}
			if test.file != file {
				t.Errorf("expected file: %q, got: %q", test.file, file)
			}
		})
	}
}

func TestExtractRootCause(t *testing.T) {
	targetOs := targets.TestOS
	for i, test := range rootCauseTests {
		var expected error
		err := &osutil.VerboseError{Output: []byte(test.e)}
		if test.reason == "" {
			continue
		} else if test.reason == "Killed" {
			err.ExitCode = 137
			targetOs = targets.Linux
			expected = &InfraError{
				Title:  test.reason,
				Output: err.Output,
			}
		} else {
			expected = &KernelError{
				Report:     []byte(test.reason),
				Output:     err.Output,
				guiltyFile: test.file,
			}
		}
		t.Run(fmt.Sprint(i), func(t *testing.T) {
			got := extractRootCause(err, targetOs, test.src)
			if got != nil {
				assert.Equal(t, expected, got)
			}
		})
	}
}

type RootCauseTest struct {
	e      string
	reason string
	src    string
	file   string
}

// nolint: lll
var rootCauseTests = []RootCauseTest{
	{`
  LINK     /home/dvyukov/src/linux2/tools/objtool/objtool
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  HOSTCC  scripts/mod/sumversion.o
  HOSTCC  scripts/mod/file2alias.o
  HOSTLD  scripts/mod/modpost
  CC      kernel/bounds.s
  CALL    scripts/atomic/check-atomics.sh
  CC      arch/x86/kernel/asm-offsets.s
  UPD     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
`,
		"",
		"",
		"",
	},
	{`
cc -g -Werror db_break.c
sys/dev/kcov.c:93:6: error: use of undeclared identifier 'kcov_cold123'; did you mean 'kcov_cold'?
        if (kcov_cold123)
            ^~~~~~~~~~~~
            kcov_cold
sys/dev/kcov.c:65:5: note: 'kcov_cold' declared here
int kcov_cold = 1;
    ^
1 error generated.
`,
		"sys/dev/kcov.c:93:6: error: use of undeclared identifier 'kcov_cold123'; did you mean 'kcov_cold'?",
		"",
		"sys/dev/kcov.c",
	},
	{`
  CC       /tools/objtool/parse-options.o
In file included from ./scripts/gcc-plugins/gcc-common.h:119:0,
 from <stdin>:1:
/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
compilation terminated.
Cannot use CONFIG_GCC_PLUGINS: your gcc installation does not support plugins, perhaps the necessary headers are missing?
scripts/Makefile.gcc-plugins:51: recipe for target 'gcc-plugins-check' failed
make: *** [gcc-plugins-check] Error 1
make: *** Waiting for unfinished jobs....
  UPD     include/config/kernel.release
`,
		"/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",
		"",
		"",
	},
	{`
Starting local Bazel server and connecting to it...
Loading:
Loading: 0 packages loaded
Analyzing: target //runsc:runsc (1 packages loaded)
Analyzing: target //runsc:runsc (5 packages loaded)
Analyzing: target //runsc:runsc (15 packages loaded)
Analyzing: target //runsc:runsc (92 packages loaded)
Analyzing: target //runsc:runsc (99 packages loaded)
Analyzing: target //runsc:runsc (115 packages loaded)
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'
ERROR: Analysis of target '//runsc:runsc' failed; build aborted: Analysis failed
INFO: Elapsed time: 14.914s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (189 packages loaded)
`,
		`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'
ERROR: Analysis of target '//runsc:runsc' failed; build aborted: Analysis failed
FAILED: Build did NOT complete successfully (189 packages loaded)`,
		"",
		"",
	},
	{`
ld -T ld.script -X --warn-common -nopie -o bsd ${SYSTEM_HEAD} vers.o ${OBJS}
ld: error: undefined symbol: __stack_smash_handler
>>> referenced by bktr_card.c:0 (/kernel/sys/dev/pci/bktr/bktr_card.c:0)
>>>               bktr_card.o:(probeCard)

ld: error: undefined symbol: __stack_smash_handler
>>> referenced by vnd.c:0 (/kernel/sys/dev/vnd.c:0)
>>>               vnd.o:(vndencrypt)

ld: error: undefined symbol: __stack_smash_handler
>>> referenced by ihidev.c:0 (/kernel/sys/dev/i2c/ihidev.c:0)
>>>               ihidev.o:(ihidev_attach)

ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
*** Error 1 in /kernel/sys/arch/amd64/compile/SYZKALLER (Makefile:991 'bsd': @echo ld -T ld.script -X --warn-commo...)
`,
		`ld: error: undefined symbol: __stack_smash_handler
ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)`,
		"",
		"",
	},
	{`
make: execvp: /gcc-5.5.0/bin/gcc: Permission denied
scripts/kconfig/conf  --silentoldconfig Kconfig
arch/x86/Makefile:123: stack-protector enabled but compiler support broken
arch/x86/Makefile:138: CONFIG_X86_X32 enabled but no binutils support
Makefile:652: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: -fstack-protector not supported by compiler
make: execvp: /gcc-5.5.0/bin/gcc: Permission denied
  SYSTBL  arch/x86/entry/syscalls/../../include/generated/asm/syscalls_32.h
  SYSHDR  arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_x32.h
scripts/xen-hypercalls.sh: line 7: /gcc-5.5.0/bin/gcc: Permission denied
  HOSTCC  scripts/mod/mk_elfconfig
/bin/sh: 1: /gcc-5.5.0/bin/gcc: Permission denied
scripts/Makefile.build:258: recipe for target 'scripts/mod/empty.o' failed
make[2]: *** [scripts/mod/empty.o] Error 126
make[2]: *** Waiting for unfinished jobs....
  CC      scripts/mod/devicetable-offsets.s
/bin/sh: 1: /gcc-5.5.0/bin/gcc: Permission denied
scripts/Makefile.build:153: recipe for target 'scripts/mod/devicetable-offsets.s' failed
make[2]: *** [scripts/mod/devicetable-offsets.s] Error 126
  HOSTCC  scripts/selinux/mdp/mdp
  HOSTCC  scripts/selinux/genheaders/genheaders
scripts/Makefile.build:403: recipe for target 'scripts/mod' failed
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
  UPD     include/config/kernel.release
Makefile:545: recipe for target 'scripts' failed
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs....
  HOSTLD  arch/x86/tools/relocs
`,
		`make: execvp: /gcc-5.5.0/bin/gcc: Permission denied
scripts/xen-hypercalls.sh: line 7: /gcc-5.5.0/bin/gcc: Permission denied
/bin/sh: 1: /gcc-5.5.0/bin/gcc: Permission denied`,
		"",
		"",
	},
	{`
./arch/x86/include/asm/nospec-branch.h:360:1: warning: data definition has no type or storage class
  360 | DECLARE_STATIC_KEY_FALSE(mds_user_clear);
      | ^~~~~~~~~~~~~~~~~~~~~~~~
./arch/x86/include/asm/nospec-branch.h:360:1: error: type defaults to ‘int’ in declaration of ‘DECLARE_STATIC_KEY_FALSE’ [-Werror=implicit-int]
./arch/x86/include/asm/nospec-branch.h:360:1: warning: parameter names (without types) in function declaration
./arch/x86/include/asm/nospec-branch.h: In function ‘mds_user_clear_cpu_buffers’:
./arch/x86/include/asm/nospec-branch.h:394:6: error: implicit declaration of function ‘static_branch_likely’ [-Werror=implicit-function-declaration]
  394 |  if (static_branch_likely(&mds_user_clear))
      |      ^~~~~~~~~~~~~~~~~~~~
./arch/x86/include/asm/nospec-branch.h:394:28: error: ‘mds_user_clear’ undeclared (first use in this function)
  394 |  if (static_branch_likely(&mds_user_clear))
      |                            ^~~~~~~~~~~~~~
./arch/x86/include/asm/nospec-branch.h:394:28: note: each undeclared identifier is reported only once for each function it appears in
cc1: some warnings being treated as errors
Kbuild:57: recipe for target 'arch/x86/kernel/asm-offsets.s' failed
make[1]: *** [arch/x86/kernel/asm-offsets.s] Error 1
Makefile:1227: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2
`, `./arch/x86/include/asm/nospec-branch.h:360:1: error: type defaults to 'int' in declaration of 'DECLARE_STATIC_KEY_FALSE' [-Werror=implicit-int]
./arch/x86/include/asm/nospec-branch.h:394:6: error: implicit declaration of function 'static_branch_likely' [-Werror=implicit-function-declaration]
./arch/x86/include/asm/nospec-branch.h:394:28: error: 'mds_user_clear' undeclared (first use in this function)`,
		"/some/unrelated/path",
		"arch/x86/include/asm/nospec-branch.h",
	},
	{`
  CC      fs/notify/group.o
  CC      lib/zlib_deflate/deftree.o
  CC      net/ipv4/devinet.o
  CC      arch/x86/kernel/apic/apic_noop.o
  CC      arch/x86/kernel/crash_core_64.o
  CC      arch/x86/kernel/machine_kexec_64.o
In file included from kernel/rcu/update.c:562:
kernel/rcu/tasks.h: In function ‘show_rcu_tasks_gp_kthreads’:
kernel/rcu/tasks.h:1070:37: error: ‘rcu_tasks_rude’ undeclared (first use in this function); did you mean ‘rcu_tasks_qs’?
 1070 |  show_rcu_tasks_generic_gp_kthread(&rcu_tasks_rude, "");
      |                                     ^~~~~~~~~~~~~~
      |                                     rcu_tasks_qs
kernel/rcu/tasks.h:1070:37: note: each undeclared identifier is reported only once for each function it appears in
scripts/Makefile.build:267: recipe for target 'kernel/rcu/update.o' failed
make[2]: *** [kernel/rcu/update.o] Error 1
scripts/Makefile.build:505: recipe for target 'kernel/rcu' failed
make[1]: *** [kernel/rcu] Error 2
make[1]: *** Waiting for unfinished jobs....
  CC      net/ipv4/af_inet.o
  CC      crypto/blowfish_common.o
  CC      arch/x86/kernel/apic/ipi.o
  CC      sound/hda/hdac_controller.o
`,
		"kernel/rcu/tasks.h:1070:37: error: 'rcu_tasks_rude' undeclared (first use in this function); did you mean 'rcu_tasks_qs'?",
		"",
		"kernel/rcu/tasks.h",
	},
	{`
  CC      arch/x86/boot/compressed/kaslr.o
  AS      arch/x86/boot/compressed/mem_encrypt.o
  CC      arch/x86/boot/compressed/kaslr_64.o
  CC      arch/x86/boot/compressed/pgtable_64.o
  CC      arch/x86/boot/compressed/acpi.o
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.
Stack dump:
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 
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.
Stack dump:
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 
/syzkaller/clang-kmsan/bin/clang-10(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x1a)[0x285af4a]
/syzkaller/clang-kmsan/bin/clang-10(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamE+0x1a)[0x285af4a]
/syzkaller/clang-kmsan/bin/clang-10(_ZN4llvm3sys17RunSignalHandlersEv+0x3a)[0x2858c2a]
/syzkaller/clang-kmsan/bin/clang-10(_ZN4llvm3sys17RunSignalHandlersEv+0x3a)[0x2858c2a]
/syzkaller/clang-kmsan/bin/clang-10[0x2858d47]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x14fcf8ccb390]
/syzkaller/clang-kmsan/bin/clang-10[0x2858d47]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x14bb99841390]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x14fcf7a5e428]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x14bb985d4428]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x14fcf7a6002a]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x14bb985d602a]
/lib/x86_64-linux-gnu/libc.so.6(+0x2dbd7)[0x14fcf7a56bd7]
/lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x14fcf7a56c82]
/lib/x86_64-linux-gnu/libc.so.6(+0x2dbd7)[0x14bb985ccbd7]
/lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x14bb985ccc82]
/syzkaller/clang-kmsan/bin/clang-10[0x9aa6d8]
/syzkaller/clang-kmsan/bin/clang-10[0x9aa6d8]
/syzkaller/clang-kmsan/bin/clang-10[0x1b094da]
/syzkaller/clang-kmsan/bin/clang-10[0x1b094da]
/syzkaller/clang-kmsan/bin/clang-10[0x1b0d3a1]
/syzkaller/clang-kmsan/bin/clang-10[0x1b0d3a1]
/syzkaller/clang-kmsan/bin/clang-10[0x257bc55]
/syzkaller/clang-kmsan/bin/clang-10[0x257bc55]
/syzkaller/clang-kmsan/bin/clang-10[0x257f274]
/syzkaller/clang-kmsan/bin/clang-10[0xb86f8e]
/syzkaller/clang-kmsan/bin/clang-10(_Z10cc1as_mainN4llvm8ArrayRefIPKcEES2_Pv+0xc3f)[0xb8ac3f]
/syzkaller/clang-kmsan/bin/clang-10(main+0x18e3)[0xaeb2d3]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x14fcf7a49830]
/syzkaller/clang-kmsan/bin/clang-10[0x257f274]
/syzkaller/clang-kmsan/bin/clang-10[0xb7f5d9]
/syzkaller/clang-kmsan/bin/clang-10[0xb86f8e]
/syzkaller/clang-kmsan/bin/clang-10(_Z10cc1as_mainN4llvm8ArrayRefIPKcEES2_Pv+0xc3f)[0xb8ac3f]
/syzkaller/clang-kmsan/bin/clang-10(main+0x18e3)[0xaeb2d3]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x14bb985bf830]
/syzkaller/clang-kmsan/bin/clang-10[0xb7f5d9]
clang-10: error: unable to execute command: Aborted (core dumped)
clang-10: error: clang integrated assembler command failed due to signal (use -v to see invocation)
clang version 10.0.0 (/home/glider/llvm-project/clang c2443155a0fb245c8f17f2c1c72b6ea391e86e81)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /syzkaller/clang/bin
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.
clang-10: error: unable to execute command: Aborted (core dumped)
clang-10: error: clang integrated assembler command failed due to signal (use -v to see invocation)
clang version 10.0.0 (/home/glider/llvm-project/clang c2443155a0fb245c8f17f2c1c72b6ea391e86e81)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /syzkaller/clang/bin
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.
clang-10: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-10: note: diagnostic msg: /tmp/mem_encrypt-2af6ae.S
clang-10: note: diagnostic msg: /tmp/mem_encrypt-2af6ae.sh
clang-10: note: diagnostic msg: 

********************
scripts/Makefile.build:348: recipe for target 'arch/x86/boot/compressed/mem_encrypt.o' failed
make[2]: *** [arch/x86/boot/compressed/mem_encrypt.o] Error 254
make[2]: *** Waiting for unfinished jobs....
clang-10: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-10: note: diagnostic msg: /tmp/head_64-96b27a.S
clang-10: note: diagnostic msg: /tmp/head_64-96b27a.sh
clang-10: note: diagnostic msg: 

********************
scripts/Makefile.build:348: recipe for target 'arch/x86/boot/compressed/head_64.o' failed
make[2]: *** [arch/x86/boot/compressed/head_64.o] Error 254
arch/x86/boot/Makefile:115: recipe for target 'arch/x86/boot/compressed/vmlinux' failed
make[1]: *** [arch/x86/boot/compressed/vmlinux] Error 2
arch/x86/Makefile:284: recipe for target 'bzImage' failed
make: *** [bzImage] Error 2
`,
		`clang-10: error: unable to execute command: Aborted (core dumped)
clang-10: error: clang integrated assembler command failed due to signal (use -v to see invocation)`,
		"",
		"",
	},
	{`
scripts/kconfig/conf  --syncconfig Kconfig
  DESCEND  objtool
  CALL    scripts/atomic/check-atomics.sh
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  GZIP    kernel/config_data.gz
  CC      kernel/configs.o
  AR      kernel/built-in.a
  GEN     .version
  LD      vmlinux.o
  MODPOST vmlinux.o
  MODINFO modules.builtin.modinfo
  GEN     modules.builtin
  LD      .tmp_vmlinux1
arch/x86/platform/efi/efi_64.o: In function 'efi_thunk_set_virtual_address_map':
/syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/arch/x86/platform/efi/efi_64.c:560: undefined reference to '__efi64_thunk'
arch/x86/platform/efi/efi_64.o: In function 'efi_set_virtual_address_map':
/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'
/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'
Makefile:1078: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1
`,
		`arch/x86/platform/efi/efi_64.c:560: undefined reference to '__efi64_thunk'
arch/x86/platform/efi/efi_64.c:902: undefined reference to 'efi_uv1_memmap_phys_prolog'
arch/x86/platform/efi/efi_64.c:921: undefined reference to 'efi_uv1_memmap_phys_epilog'`,
		"/syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel",
		"arch/x86/platform/efi/efi_64.c",
	},
	{`
/syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/arch/x86/platform/efi/efi_64.c:560: undefined reference to '__efi64_thunk'
`,
		`arch/x86/platform/efi/efi_64.c:560: undefined reference to '__efi64_thunk'`,
		"/syzkaller/managers/upstream-linux-next-kasan-gce-root/kernel/",
		"arch/x86/platform/efi/efi_64.c",
	},
	{`
  CC      net/ipv6/ip6_output.o
  CC      security/selinux/ss/policydb.o
  CC      net/ipv4/route.o
In file included from security/smack/smack_netfilter.c:18:
./include/linux/netfilter_ipv6.h: In function ‘nf_ipv6_br_defrag’:
./include/linux/netfilter_ipv6.h:110:9: error: implicit declaration of function ‘nf_ct_frag6_gather’ [-Werror=implicit-function-declaration]
  110 |  return nf_ct_frag6_gather(net, skb, user);
      |         ^~~~~~~~~~~~~~~~~~
In file included from security/apparmor/lsm.c:27:
./include/linux/netfilter_ipv6.h: In function ‘nf_ipv6_br_defrag’:
./include/linux/netfilter_ipv6.h:110:9: error: implicit declaration of function ‘nf_ct_frag6_gather’ [-Werror=implicit-function-declaration]
  110 |  return nf_ct_frag6_gather(net, skb, user);
      |         ^~~~~~~~~~~~~~~~~~
In file included from net/bridge/br_netfilter_ipv6.c:30:
./include/linux/netfilter_ipv6.h: In function ‘nf_ipv6_br_defrag’:
./include/linux/netfilter_ipv6.h:110:9: error: implicit declaration of function ‘nf_ct_frag6_gather’ [-Werror=implicit-function-declaration]
  110 |  return nf_ct_frag6_gather(net, skb, user);
      |         ^~~~~~~~~~~~~~~~~~
In file included from net/bridge/br_netfilter_hooks.c:31:
./include/linux/netfilter_ipv6.h: In function ‘nf_ipv6_br_defrag’:
./include/linux/netfilter_ipv6.h:110:9: error: implicit declaration of function ‘nf_ct_frag6_gather’ [-Werror=implicit-function-declaration]
  110 |  return nf_ct_frag6_gather(net, skb, user);
      |         ^~~~~~~~~~~~~~~~~~
  CC      net/openvswitch/datapath.o
  CC      net/llc/llc_output.o
  CC      net/ieee802154/core.o
cc1: some warnings being treated as errors
scripts/Makefile.build:278: recipe for target 'security/smack/smack_netfilter.o' failed
make[2]: *** [security/smack/smack_netfilter.o] Error 1
scripts/Makefile.build:489: recipe for target 'security/smack' failed
make[1]: *** [security/smack] Error 2
make[1]: *** Waiting for unfinished jobs....
  CC      net/lapb/lapb_iface.o
  CC      net/netlabel/netlabel_domainhash.o
  CC      net/netlabel/netlabel_addrlist.o
`,
		"./include/linux/netfilter_ipv6.h:110:9: error: implicit declaration of function 'nf_ct_frag6_gather' [-Werror=implicit-function-declaration]",
		"",
		"include/linux/netfilter_ipv6.h",
	},
	{`
ld: mm/slub.o: in function '__kmem_cache_create':
slub.c:(.text+0x6260): multiple definition of '__kmem_cache_create'; mm/page_alloc.o:page_alloc.c:(.text+0x1970): first defined here
make: *** [Makefile:1139: vmlinux] Error 1
`,
		"slub.c:(.text+0x6260): multiple definition of '__kmem_cache_create'; mm/page_alloc.o:page_alloc.c:(.text+0x1970): first defined here",
		"",
		"mm/page_alloc.c",
	},
	{`
ld: mm/slub.o:(.bss+0x0): multiple definition of 'foobar'; mm/page_alloc.o:(.bss+0x34): first defined here
make: *** [Makefile:1139: vmlinux] Error 1
`,
		"ld: mm/slub.o:(.bss+0x0): multiple definition of 'foobar'; mm/page_alloc.o:(.bss+0x34): first defined here",
		"",
		"mm/slub.c",
	},
	{`
ld.lld: error: duplicate symbol: __kmem_cache_create
>>> defined at page_alloc.c
>>>            page_alloc.o:(__kmem_cache_create) in archive mm/built-in.a
>>> defined at slub.c
>>>            slub.o:(.text+0x6260) in archive mm/built-in.a
make: *** [Makefile:1139: vmlinux] Error 1
`,
		"ld.lld: error: duplicate symbol: __kmem_cache_create",
		"",
		"", // ld.lld makes it very hard to extract the file name
	},
	{`
ld.lld: error: duplicate symbol: foobar
>>> defined at page_alloc.c
>>>            page_alloc.o:(foobar) in archive mm/built-in.a
>>> defined at slub.c
>>>            slub.o:(.bss+0x0) in archive mm/built-in.a
make: *** [Makefile:1139: vmlinux] Error 1
`,
		"ld.lld: error: duplicate symbol: foobar",
		"",
		"", // ld.lld makes it very hard to extract the file name
	},
	{`
mm/page_alloc.o:(.data+0x1a40): multiple definition of '__kmem_cache_create'
mm/slub.o:(.data+0x7a0): first defined here
Makefile:1160: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1
`,
		"mm/page_alloc.o:(.data+0x1a40): multiple definition of '__kmem_cache_create'",
		"",
		"mm/page_alloc.c",
	},
	{`
  LZ4     arch/x86/boot/compressed/vmlinux.bin.lz4
/bin/sh: 1: lz4: not found
arch/x86/boot/compressed/Makefile:151: recipe for target 'arch/x86/boot/compressed/vmlinux.bin.lz4' failed
make[2]: *** [arch/x86/boot/compressed/vmlinux.bin.lz4] Error 127
make[2]: *** Deleting file 'arch/x86/boot/compressed/vmlinux.bin.lz4'
make[2]: *** Waiting for unfinished jobs....
arch/x86/boot/Makefile:112: recipe for target 'arch/x86/boot/compressed/vmlinux' failed
make[1]: *** [arch/x86/boot/compressed/vmlinux] Error 2
arch/x86/Makefile:290: recipe for target 'bzImage' failed
make: *** [bzImage] Error 2
`,
		"/bin/sh: 1: lz4: not found",
		"",
		"",
	},
	{`
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.[ch]
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTLD  scripts/kconfig/conf
/usr/bin/env: invalid option -- 'S'
Try '/usr/bin/env --help' for more information.
init/Kconfig:39: syntax error
init/Kconfig:38: invalid statement
scripts/kconfig/Makefile:71: recipe for target 'oldconfig' failed
make[1]: *** [oldconfig] Error 1
Makefile:602: recipe for target 'oldconfig' failed
make: *** [oldconfig] Error 2
`,
		"init/Kconfig:39: syntax error\ninit/Kconfig:38: invalid statement",
		"",
		"init/Kconfig",
	},
	{`
  LD      vmlinux
  BTFIDS  vmlinux
FAILED unresolved symbol dctcp_update_alpha
make: *** [Makefile:1292: vmlinux] Error 255
`,
		"FAILED unresolved symbol dctcp_update_alpha",
		"",
		"",
	},
	{`
scripts/kconfig/conf  --syncconfig Kconfig

*** Error during update of the configuration.

make[2]: *** [scripts/kconfig/Makefile:41: syncconfig] Error 1
make[1]: *** [Makefile:545: syncconfig] Error 2
make: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/kernel.release'.  Stop.
make: *** Waiting for unfinished jobs....
`,
		"make: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/kernel.release'.  Stop.",
		"",
		"",
	},
	{`
sh: 1: column: not found
FAILED: host_x64/obj/tools/docsgen/clidoc_out.tar.gz
../../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
Error: Unable to write generate doc for "/syzkaller/managers/main/kernel/out/x64/host_x64/fpublish" to "host_x64/gen/tools/docsgen/sdk-docs"
Caused by:
    Error running help: Unexpected non-zero error code with tool "/syzkaller/managers/main/kernel/out/x64/host_x64/fpublish"
                and subcommands [].
ninja: build stopped: subcommand failed.
`,
		`Error: Unable to write generate doc for "/syzkaller/managers/main/kernel/out/x64/host_x64/fpublish" to "host_x64/gen/tools/docsgen/sdk-docs"`,
		"",
		"",
	},
	{`
  AR      built-in.a
  AR      vmlinux.a
  LD      vmlinux.o
Killed
make[1]: *** [scripts/Makefile.vmlinux_o:61: vmlinux.o] Error 137
make[1]: *** Deleting file 'vmlinux.o'
make: *** [Makefile:1231: vmlinux_o] Error 2
`,
		"Killed",
		"",
		"",
	},
	{`
  RUSTC L rust/kernel.o
error[E0599]: no method named ` + "`data`" + ` found for struct ` + "`core::pin::Pin<kbox::Box<T, Kmalloc>>`" +
		` in the current scope
  --> rust/kernel/usb.rs:92:34
   |
92 |         T::disconnect(intf, data.data());
   |                                  ^^^^ method not found in ` + "`Pin<Box<T, Kmalloc>>`" + `

error: aborting due to 1 previous error

For more information about this error, try ` + "`rustc --explain E0599`" + `.
make[2]: *** [rust/Makefile:553: rust/kernel.o] Error 1
make[1]: *** [/syzkaller/managers/ci-upstream-rust-kasan-gce/kernel/Makefile:1308: prepare] Error 2
make: *** [Makefile:248: __sub-make] Error 2
`,
		"error[E0599]: no method named `data` found for struct `core::pin::Pin<kbox::Box<T, Kmalloc>>` in the current scope",
		"",
		"",
	},
}