Commit Graph

121 Commits

Author SHA1 Message Date
Dmitry Vyukov
0d63f89cab syz-ci: allow enabling bisect cause and fix jobs separately
Some backport-only kernels may only be interested in fix bisections.
Allow enabling these separately.
2019-11-27 16:40:04 +01:00
Dmitry Vyukov
4cea005389 syz-ci: TODO 2019-11-27 14:26:14 +01:00
Dmitry Vyukov
6f7be11fa1 dashboard/app: don't report bisections pointing to release commits
They should have been detected by "same binary" logic.
But the problem is that we may use different compilers
for different commits and they switch exactly at release commits.
So we can build the release with a differnet compiler than the
rest of commits and then obviously it won't be "same binary".
Detect release commits separately.

Update #1271
2019-11-27 14:05:14 +01:00
Dmitry Vyukov
30cb7f98cd pkg/bisect: detect wrong bisections
Detect bisection to merge commits and to commits that don't affect
kernel binary (comments, other arches, whitespaces, etc).
Such bisections are not reported in emails (but shown on web).

Update #1271
2019-11-07 11:07:03 +01:00
Dmitry Vyukov
424cf6e8a1 pkg/build: add build signatures
Add optional build signature for images, currently only implemented for linux.
This can be used in bisection process to detect changes that does not affect kernel.

Update #1271
2019-11-06 11:41:05 +01:00
Dmitry Vyukov
c487cd4633 pkg/build: refactor Image function arguments
Image takes too many arguments, so we need to do lots of forwarding,
adding new argumnets is painful and most OSes are not interested
in lots of arguments.
Combine all arguments into a params struct.
2019-11-06 11:41:05 +01:00
Zubin Mithra
a77e6539d9 syz-ci: send build info for failed bisections
* When fix bisections fails due to a crash on HEAD, the dashboard needs to
keep track of which commit the crash occured at. In order to do this,
send correct commit information to the dashboard.
* Modify mail_bisect_result.txt to be clearer on what
BisectResult.KernelCommit represents. Modify test in bisect_test.go to
accommodate the changes in templates.
2019-11-05 09:15:56 +01:00
Zubin Mithra
0a2d7d8293 pkg/bisect: modify Run() to return information about commit
* Modify Run() to return the commit object when a failure occurs on the
oldest tested release(for BisectCause) and latest tested
release(for BisectFix).
* Modify tests to check the returned commit object.
2019-11-05 09:15:56 +01:00
Dmitry Vyukov
45065351dd syz-ci: fix variable shadowing
gometalinter says:
syz-ci/jobs.go:516:⚠️ declaration of "rep" shadows declaration at syz-ci/jobs.go:505 (vetshadow)
2019-05-12 11:42:33 +02:00
Dmitry Vyukov
39449875b6 syz-ci: don't assume kernel config is called .config
.config is linux-ism. We have a convention that kernel config
is copied to kernel.config file. Use it.
2019-05-12 11:38:18 +02:00
Dmitry Vyukov
8f24b7d63e syz-ci: always use 10 VMs for bisection
If a manager has less then 10 VMs override it to 10 for bisection.
If a manager has only 1 VM, bisection won't end well.
2019-05-10 11:06:17 +02:00
Dmitry Vyukov
7143d0bc86 syz-ci: improve test result aggregation
If there is a crash with a report, prefer it to crashes without report.
2019-05-10 10:31:07 +02:00
Dmitry Vyukov
364acbc23b syz-ci: add tests for test result aggregation
Factor out patch testing result aggregation and add tests.
2019-05-10 10:31:07 +02:00
Dmitry Vyukov
e955ac5009 syz-ci: stricter verification of instance names 2019-04-10 15:53:23 +02:00
Dmitry Vyukov
995065ff41 syz-ci: enable bisection debugging
Temporary enable bisection debugging because there are some unexplainable things happen.
2019-04-08 18:48:45 +02:00
Dmitry Vyukov
9028d21e52 syz-ci: put build error reason into report
We inline Report in bug reports, so put the build error reason there.
Should produce much handier reports.
2019-03-29 11:14:10 +01:00
Dmitry Vyukov
742f448304 vm/gce: allow non-preemptible VMs
We are seeing some flakes during bisection and image testing.
Hard to tell what's the root cause because they are episodic.
But using non-preemptible VMs for bisection and image testing
looks good on all fronts.

Update #501
2019-03-28 13:22:37 +01:00
Dmitry Vyukov
52a20ba400 dashboard/app: properly handle build failures
Separate kernel and syzkaller build failures.
Fix logic to understand when a build is fixed:
look if kernel/syzkaller commit changes to understand
if it's a new good build or re-upload of an old build.

Fixes #1014
2019-03-25 17:00:25 +01:00
Dmitry Vyukov
4d9d915eae syz-ci: fix filling of kernel commit in bisection jobs
There is a bit of a mess: dashboard expects the start commit
in build info, but syz-ci sends the resulting cause commit.
Moreover for inconclusive bisection the commit is not filled at all.
Fill start commit in build info on start.

Update #501
2019-03-22 12:00:50 +01:00
Dmitry Vyukov
a664c187e4 syz-ci: fix a typo 2019-03-20 13:55:56 +01:00
Dmitry Vyukov
6477d5172f syz-ci: improve job loop logic
1. Prevent grabbing the next job on stop with 50% probability.
2. Don't claim jobs if another build is already in progress.

Update #501
2019-03-20 12:20:54 +01:00
Dmitry Vyukov
142c38ee4d dashboard/app: request test/bisect jobs separately
Allow separate sets of managers for patch testing and for bisection.
This makes things more flexible on syz-ci deployment side.
Remove previous hacks for bisection deployment.

Update #501
2019-03-20 12:00:34 +01:00
Dmitry Vyukov
bcbe71c80a dashboard/app, syz-ci: bisection support
This adds bulk of support for bisection to dashboard/app and syz-ci:
- APIs to send bisection jobs and accept results
- syz-ci logic to execute bisection jobs
- formatting of emails with results
- showing of results on dashboard

Some difficulties we have to overcome:
- since linux is frequently build/boot broken, lots of bisections are inconclusive,
  need to present such results too
- git bisect is poorly suitable for automation, have to resort to output parsing (is output stable?)
- git bisect turns out to fail (exit with non-0 status) when bisection is inconclusive
  (multiple potential cause commits)
- older syzkaller revisions can't be built with newer (broken) kernel header, e.g.:
  ebtables.h:197:19: error: invalid conversion from ‘void*’ to ‘ebt_entry_target*’
- newer compilers produce more warnings and break old syzkaller builds, e.g.:
  kvm.S.h:6:12: error: ‘kvm_asm64_vm86’ defined but not used [-Werror=unused-const-variable=]
- figuring relevant emails to CC from a commit is non-trivial:
  besides commit author, there can be some emails in commit tags, or not,
  which tags to use is an interesting question (some may include irrelevant emails)
  we can also run get_maintainers.pl on the commit, but this can produce too wide
  list if commit touches lots of files, it can also produce too small list,
  and then we need to resort to blame
- for inconclusive bisection we probably don't need to include emails referenced
  in the commits (there can be too many of these commits)
- need to be careful to exclude own syzbot email from commit CC list,
  now syzbot emails are referenced in some commits (Reported-by/Tested-by/etc)
  (can cause some kind of infinite recursion)
- lots of commits reference stable mailing list,
  we should not include it in CC because it's referenced for backports rather then bug reports
- since we add new Bug entity fields which we use in queries,
  whole datastore need to be upgrades to add the new field to index
- we must not discard the crash that was used for bisection
  (treat it as a reported crash)
- bisection results need 2 forms of reports:
  one when we add bisection results to already reported bug
  another when we report a bug first time with bisection results
- when reporting a bug with bisection results we need to use the crash
  that was used for bisection
- some fraction of bisections will probably fail with various errors
  and we will need some mechanism to retry bisection after the root cause is resolved
  this is not implemented yet
- linux-next is problematic for 2 reasons:
  fix bisection can't possibly run on linux-next as commits are not reachable from HEAD
  lots of commits are missing in linux-next (even in linux-next-history)
  e.g. we have some c63e9e91a254a52 which is now missing in linux-next/linux-next-history
- older kernels can't be build with fresh gcc/binutils/perl/make/glibc
  for now we have to stop at v3.9 (this only requires switching gcc several times along the way)
- kernels past v4.11 do not build with gcc 7 and 8 (undefined reference to `____ilog2_NaN')
- v4.1 and back have only compiler-gcc5.h
- v3.17 and back have only compiler-gcc4.h
- v3.6 and back do not have make olddefconfig
- compat socket calls can't be bisected past "x86/entry/syscalls: Wire up 32-bit
  direct socket calls" (v4.10) because of
  https://syzkaller.appspot.com/bug?id=b5b150e322d5f48c869bcf1528cdbee08d1421cb
- v2.6.28 and below does not work with modern make:
  *** mixed implicit and normal rules: deprecated syntax
- v3.8 build fails:
  Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at kernel/timeconst.pl line 373.
  kernel/Makefile:134: recipe for target 'kernel/timeconst.h' failed
- make 3.81 works for v2.6.28.
  3.81 almost works with current HEAD, you need to run make twice because first run spuriously fails with:
- v2.6.28 with gcc-4.9.4 broken with:
  include/linux/kvm.h:240:9: error: duplicate member ‘padding’
- but even defconfig fails:
  VDSO    arch/x86/vdso/vdso.so.dbg
  gcc: error: elf_x86_64: No such file or directory
  gcc: error: unrecognized command line option ‘-m’
  It seems that we also need old binutils.
- for v3.8 and below we need perl-5.14.4.
  Unfortunately this or any manually built perl doesn't work for later kernels:
  Can't locate strict.pm in @INC
- kernels starting from 4.14 and older are boot broken:
  https://lkml.org/lkml/2018/9/7/648
- kernels older than 4.12 are broken during netdev setup
  (fixed by commit 675c8da049fd6556eb2d6cdd745fe812752f07a8)

Update #501
2019-03-17 18:06:44 +01:00
Dmitry Vyukov
c1fd2f3b4a syz-ci: fix formatting of error message
PrependContext prepends the string rather than format.
2019-03-17 18:06:44 +01:00
Dmitry Vyukov
41c6dd359b syz-ci: add flag that allows to not start managers
For bisection testing.

Update #501
2019-03-17 18:06:44 +01:00
Dmitry Vyukov
80765640f0 syz-ci: ignore job errors on shutdown
Ctrl+C can kill a child process which will cause an error.
Ignore such errors, it's better to retry after restart then
to report a false failure.

Update #501
2019-03-17 18:06:44 +01:00
Dmitry Vyukov
8fb18735b7 syz-ci: move GOPATH/GOROOT setup to main
GOPATH/GOROOT are also needed for jobs.
Updater can be disabled with -autoupdate=0,
so move GOPATH/GOROOT setup to main.

Update #501
2019-03-17 18:06:44 +01:00
Marco Vanotti
12365b99ce syz-ci: fix error reporting for syzupdater.
syzupdater fails to report build errors because it is constructing the
dashapi client with the wrong parameters (it is mixing dashboardAddr
with dashboardClient).

This commit swaps the order of those parameters in syzupdater's
uploadBuildError function.

Fixes #1044
2019-03-08 08:07:09 +01:00
Dmitry Vyukov
a8f92d1c95 syz-ci: enhance autoupdate=0 mode
If autoupdate=0 build syzkaller binaries once if they are missing.
Even without autoupdate syzkaller binaries are required for operation.
2019-02-26 16:27:33 +01:00
Dmitry Vyukov
18107ce07f syz-ci: make some manager creation errors non-fatal
If only part of the managers failed to initialize
we still can continue running the rest.
2019-02-23 08:45:42 +01:00
Dmitry Vyukov
9b05a0a131 syz-ci: add a flag to disable auto-update
Useful for local testing.
With -autoupdate=0 syz-ci does not need syzkaller repo,
will not poll, build and update itself.
So a binary with local changes can be tested without
pushing changes to some git repo.
2019-02-22 18:40:51 +01:00
Dmitry Vyukov
59f36113ee syz-ci: don't extract fixing commits if no report email
There can be no ReportEmail is email reporting is not used,
don't poll fixing commits in such case.
2019-02-17 15:46:16 +01:00
Dmitry Vyukov
3e98cc3080 dashboard/app: poll commits info
This implements 2 features:
 - syz-ci polls a set of additional repos to discover fixing commits sooner
   (e.g. it can now discover a fixing commit in netfilter tree before
   it reaches any of the tested trees).
 - syz-ci uploads info about commits to dashboard.
   For example, a user marks a bug as fixed by commit "foo: bar".
   syz-ci will find this commit in the main namespace repo
   and upload commmit hash/date/author to dashboard. This in turn
   allows to show links to fixing commits.

Fixes #691
Fixes #610
2019-02-17 15:08:45 +01:00
Julia Hansbrough
e3bc2f2b5a syz-ci: fix error log output
This eases debugging when running syz-ci locally.
2019-01-23 11:02:31 +01:00
Dmitry Vyukov
9a689e2d3d syz-ci: extend logging in uploadBuildError 2019-01-23 10:19:27 +01:00
Dmitry Vyukov
1e30dd27ee syz-ci: run syzkaller tests without sandbox
pkg/vcs git tests fail with sandboxing as part of git
invocations is sandboxed and part is not.
2018-12-18 10:48:38 +01:00
Dmitry Vyukov
bd8b4220d5 syz-ci: upload syzkaller build errors to dashboard
Fixes #793
2018-12-18 10:33:05 +01:00
Dmitry Vyukov
057f344bb7 syz-ci: add kernel crash title to boot errors
Fixes #829
2018-12-18 09:50:08 +01:00
Dmitry Vyukov
a9cc88c19f pkg/osutil: provide better Rename
os.Rename fails for cross-device renaming (e.g. to/from tmpfs).
This is quite unpleasant. Provide own version that falls back to copying.
2018-12-17 19:09:10 +01:00
Dmitry Vyukov
2d8316b8fb syz-ci: default kernel branch to master 2018-11-21 07:17:13 +01:00
Julia Hansbrough
b08ee62aec [fuchsia] SSH fix and build invocation fix.
SSH keys are now included at the fx clean-build config.

A proper escape sequence looked weird so use a string literal to pass
that config.

Fixed some typos I found while debugging.
2018-11-16 11:58:29 -08:00
Dmitry Vyukov
07a35107a4 syz-ci: split Manager.loop function
gometalinter says the function is too complex:

syz-ci/manager.go:155:⚠️ cyclomatic complexity 30 of function (*Manager).loop() is high (> 24) (gocyclo)

Split into 2 functions.
2018-09-21 10:44:49 +02:00
Dmitry Vyukov
6cee973cb5 syz-ci: fix manager http addr
Manager http addr is usually just ":port".
Prepend "127.0.0.1" in such case.
2018-09-20 19:58:12 +02:00
Dmitry Vyukov
9a6f6af645 syz-ci: upload coverage reports to GCS
Upload coverage reports from all managers to GCS
after 6 hours of runtime (to make it more apples-to-apples).
2018-09-20 18:29:38 +02:00
Dmitry Vyukov
0415891efa syz-ci: enable net/http/pprof
Useful to have for all servers.
2018-09-20 11:22:33 +02:00
Dmitry Vyukov
3805b76483 syz-ci: make goroot optional
If not set, syz-ci will use the system go.

Update #712
2018-09-17 10:51:17 +02:00
Dmitry Vyukov
19e9088bb7 syz-ci: use gmake instead of make on openbsd
Update #712
2018-09-13 12:13:54 +02:00
Dmitry Vyukov
ff2962ae80 syz-ci: de-hardcode kernel object file names
We used to have this list in syz-ci and syz-managers.
Now we have kernel object in sys/targets, so use it instead.

Update #712
2018-09-11 15:43:55 +02:00
Dmitry Vyukov
a54c2b7b92 syz-ci: de-hardcode list of VMs that support overcommit
We currently have this list in multiple places (somewhat diverged).
Specify this "overcommit" property in VM implementations.
In particular, we also want to allow overcommit for "vmm" type.

Update #712
2018-09-11 15:33:45 +02:00
Dmitry Vyukov
5509d25c1d syz-ci: allow manager http address auto-assignment
Manually assigning http addresses is tedious and error-prone.
2018-09-06 11:15:56 +02:00