aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/bisect
Commit message (Collapse)AuthorAgeFilesLines
...
* pkg/bisect: support clang for crash bisectionSpace Meyer2022-09-011-12/+13
| | | | | Before we hardcoded bisection to use gcc, now the compiler family can be configured in the bisection config.
* pkg/vcs: fetch linux upstream stable before bisectionsSpace Meyer2022-09-011-0/+5
|
* pkg/bisect: prevent crash in bisection after failed repo HEAD querySpace Meyer2022-09-011-2/+8
| | | | | | | | | | | | | | | | | | | During a bisection the call stack looks like this: Starting at env.bisect() in pkg/bisect/bisect.go bisect() -> Bisect() -> pred() -> test() -> build() Previously the `results[testRes1.com.Hash]` in pred() could run into a nil pointer deref and crash, when: * build() didn't bother to return current in certain error conditions * test() didn't handle cases where build() couldn't query current When test() returns an error, the bisection it was called from is aborted. Hence test() is expected to not simply bubble up recoverable errors, but instead return a testResult with verdict=vcs.BisectSkip. I ran into this with a linux branch, where syzkaller could not find any release tags, running into one of the cases where build() did not return current, even though it was able to obtain it.
* tools/syz-bisect: print hostname and bisection dateDenis Efremov2022-07-191-0/+6
| | | | | | | | Log bisection date and hostname of the bisecting machine for the debugging purposes. It makes more easy to check bisection problems on the bisecting host if something goes wrong. Signed-off-by: Denis Efremov <denis.e.efremov@oracle.com>
* syz-ci: remember syzkaller builds logsAleksandr Nogikh2022-06-282-18/+21
| | | | | This might help get more insight into patch testing failures, especially for old bugs.
* all: remember console output for all patch testsAleksandr Nogikh2022-06-082-17/+19
| | | | | | Currently syzbot only saves a log if there was a build/test error. Closes #3185
* all: use `t.TempDir` to create temporary test directoryEng Zer Jun2022-03-281-17/+4
| | | | | | | | | This commit replaces all `ioutil.TempDir` with `t.TempDir` in tests. The directory created by `t.TempDir` is automatically removed when the test and all its subtests complete. Reference: https://pkg.go.dev/testing#T.TempDir Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* all: capture compiler id during the build processAleksandr Nogikh2021-07-202-14/+15
| | | | | | | | | Default compilers are specified in the OS- and platform-dependent logic. It is more convenient to extract info about them during the kernel build itself, rather than during the manager object initialization. Apply the necessary changes throughout the code that is involved in building the kernels and processing information about this process.
* pkg/bisect: fix number of tests for flaky reprosDmitry Vyukov2021-02-201-1/+1
| | | | Fixes #2335
* pkg/bisect: remove unused varDmitry Vyukov2020-12-251-1/+0
| | | | Formally it's not unsed, so nothing complained.
* pkg/kconfig: store minimization resultsJouni Hogander2020-12-102-14/+6
| | | | | Store config options identified using DebugTracer. Also change bisection and configuration minimization code to use new DebugTracer.
* pkg/mgrconfig: add prog&sys.targets targets to ConfigDmitry Vyukov2020-11-302-12/+5
| | | | | | These are widely used with the config as the refactoring shows. This removes a bunch of unnecessary code. Also fixes a number of bugs where we confused Arch with VMArch.
* pkg/mgrconfig: move derived fields into separate structDmitry Vyukov2020-11-301-4/+6
| | | | | | Users should not be concerned with the internal derived fields. Move all derived fields into a separate struct before adding more. This leaves config.go as a better documentation for end users.
* pkg/bisect: add flaky flagJouni Hogander2020-11-172-7/+42
| | | | | On first test (original commit) bump up number of tests always. Also bump up number of tests if observing more good results than bad.
* pkg/kconfig: accept target when parsing KconfigDmitry Vyukov2020-10-291-1/+8
| | | | | | Kconfig depends on the target arch. Add target argument for Kconfig parsing. Resolve $(SRCARCH) properly (previously we always assumed x86_64).
* sys/targets: add OS/Arch name constsDmitry Vyukov2020-10-261-3/+4
| | | | | | | | | | | | We use strings to identify OS/Arch. These strings are duplicated throughout the code base massively. golangci-lint points to possiblity of typos and duplication. We already had to define these names in pkg/csource and disable checking for prog package. A future change triggers such warnings in another package. Add OS/Arch name consts to sys/targets so that they can be used to refer to OS/Arch. Use the consts everywhere.
* pkg/bisect: switch to kconfig.MinimizeDmitry Vyukov2020-10-212-47/+9
| | | | | | | | | | | | | | | Use the new kconfig.Minimize for config minization instead of the config-bisect.pl script. This is mostly just deleting code. Also update tests: - minimization is now supposed to test the baseline config (update "testos" stub accordingly) - minimization is not supposed to return a config that does not build (a reasonable config minimization procedure can't arrive to such config), remove test that tests this Update #2171
* pkg/vcs: add repo OptPrecious and OptDontSandbox optionsDmitry Vyukov2020-10-211-1/+1
| | | | | | | | | | The pkg/vcs code assumed that we fully manage the repo within an autonomous program. In particular it tried to repair any errors by dropping and re-creating the repo. This does not work well for command-line tools that work with a user-provided repo. Add OptPrecious for such uses. Update #2171
* pkg/bisect: add ccache optionJouni Hogander2020-09-212-2/+3
| | | | | | Add option to use ccache in kernel builds. Signed-off-by: Jouni Hogander <jouni.hoegander@partner.bmw.de>
* pkg: get and store Maintainers dataPedro Lopes2020-07-311-1/+2
| | | | | | Create a struct on pkg/vcs to store data of syzkaller email recipients and update its users. The struct contains default name, email, and a label to divide user into To and Cc when sending the emails.
* syz-ci: set Timeout for bisectionsDmitry Vyukov2020-07-121-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Timeout config param for bisections. Specify timeout in syz-ci as 8h based on the following data. Out of 1049 cause bisections that we have now: - 891 finished under 6h (84.9%) - 957 finished under 8h (91.2%) - 980 finished under 10h (93.4%) - 989 finished under 12h (94.3%) - 1011 finished under 18h (96.3%) - 1025 finished under 24h (97.7%) There is also a significant increase in errors/inconclusive bisections after ~8h. Out of 4075 fix bisections: - 4015 finished under 6h (98.5%) - 4020 finished under 8h (98.7%) - 4026 finished under 10h (98.8%) - 4032 finished under 12h (98.9%) Significant increase in errors starts after ~12h. The current timeout also take into account that bisection jobs compete with patch testing jobs (it's bad delaying patch testing). When/if bisection jobs don't compete with patch testing, it makes sense to increase this to 12-24h. Fixes #1923
* all: fix log/error text starting with capital letterDmitry Vyukov2020-07-051-1/+1
| | | | Update #1876
* pkg/bisect: fix noop change detection with config minimizationDmitry Vyukov2020-07-022-20/+39
| | | | | | Config minimization did not update test results for the starting commit. Test result for the starting commit still refered to the original config, not the minimized config that was actually used during bisection.
* pkg/bisect: improve config minimization testsDmitry Vyukov2020-07-021-3/+12
| | | | | | | Change a test to actually produce a new config as it is supposed to do during config minimization and check the resulting config. Add a regression test for the bug where we committed a broken config.
* pkg/bisect: move checking of minimized config into common codeDmitry Vyukov2020-07-021-0/+13
| | | | | That part is not linux-specific, move it to the common code. The more code we have in the common code, the more code we can test.
* pkg/bisect: don't overwrite user configurationDmitry Vyukov2020-07-021-20/+21
| | | | | We don't own this object and should not touch, it may be unexpected by the caller and may cause data races.
* pkg/bisect: test resulting configDmitry Vyukov2020-07-021-33/+47
| | | | | | One of main outputs of the config minimization is the new config, but tests don't do any single check of it. Check the resulting config (is it correct in all cases?).
* pkg/bisect: don't ignore errors during config minimizationDmitry Vyukov2020-07-022-30/+34
| | | | | | | Ignoring errors is bad. It leads to silent failures. If there is some particular error condition that is expected to happen and we want to ignore, we need to ignore that one only rather than all potenital errors in the whole process.
* pkg/bisect: minor style fix upsDmitry Vyukov2020-07-022-21/+17
|
* pkg/bisect: fix crash when all releases are brokenDmitry Vyukov2020-07-022-0/+14
| | | | Currently we crash with nil deref in this special case.
* pkg/bisect: Implement config bisectionJouni Hogander2020-07-022-22/+142
| | | | | | | | | Implement Linux kernel configuration bisection. Use bisected minimalistic configuration in commit bisection. Utilizes config_bisect.pl script from Linux kernel tree in bisection. Modify syz-bisect to read in kernel.baseline_config. This is used as a "good" configuration when bisection is run.
* Pass baseline config aroundJukka Kaartinen2020-07-021-7/+8
| | | | | | | | Add new new Syzkaller configuration option kernel_baseline_config. This option is supposed to be used by kernel configruation bisection as a "good" config" Signed-off-by: Jukka Kaartinen <jukka.kaartinen@unikie.com> Signed-off-by: Jouni Hogander <jouni.hogander@unikie.com>
* .golangci.yml: enable funlen checkerDmitry Vyukov2020-06-051-173/+174
| | | | Checks for too long functions (based on lines and statements).
* pkg/bisect: speed up testsDmitry Vyukov2020-05-181-56/+86
| | | | | | Creating new repos takes majority of test time. Reuse them across tests. With GOMAXPROCS=2 (CI) this speeds up tests from 33 sec to 7 secs.
* pkg/build: find maintainers for build errorsDmitry Vyukov2020-05-091-2/+2
| | | | | | | Extract build error source file and obtain maintainers so that we can mail the report to the right people. Update #1667
* pkg/bisect: minor refactoringDmitry Vyukov2019-12-101-3/+4
| | | | | Define the bisection predicate closure in a separate statement, it become too large over time.
* pkg/bisect: always test parent commitDmitry Vyukov2019-12-102-24/+61
| | | | Fixes #1527
* pkg/bisect: add test for #1527Dmitry Vyukov2019-12-101-2/+24
| | | | Update #1527
* dashboard/app: don't report bisections pointing to release commitsDmitry Vyukov2019-11-272-0/+21
| | | | | | | | | | | 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
* pkg/bisect: fix some off-by-onesDmitry Vyukov2019-11-272-14/+59
| | | | | | | | | | 3/4 added tests currently fail. The problem is that we don't collect results from initial bisection range detection. As the result we won't detect "same binary" for release and first commit in a release. Update #1271
* pkg/bisect: add more logging for build signaturesDmitry Vyukov2019-11-181-0/+5
| | | | | It seems that some signatures that should be equal are not (or something else is going on). Add some logging for transparency.
* pkg/bisect: detect wrong bisectionsDmitry Vyukov2019-11-072-238/+283
| | | | | | | | 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
* pkg/bisect: modify Run() to return information about commitZubin Mithra2019-11-052-65/+80
| | | | | | | * 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.
* pkg/bisect: add more tests for various possible bisection resultsZubin Mithra2019-11-041-47/+210
| | | | | | | | Add tests for the following cases(1 each for cause and fix): - bisection returns the correct commit - bisection failed due to crash not occuring on the original commit - bisection failed as crash occurs on oldest/latest commit - bisection is inconclusive
* pkg/vcs: detect old git binary that can't do bisectionDmitry Vyukov2019-10-221-0/+3
|
* pkg/vcs: make EnvForCommit return full compiler pathDmitry Vyukov2019-10-222-8/+3
| | | | | | | All callers of EnvForCommit need the compiler path, so move this logic into EnvForCommit to avoid duplication. Also simplifies tests because test impl can now return an empty compiler (which should be unused).
* pkg/bisect: add initial testing support for cause bisectionZubin Mithra2019-10-222-7/+153
| | | | | | | | | | | | | | | | | | | | | | | | (note: incomplete change) Refactor existing code as follows: * Move reusable test utility functions from git_repo_test.go to pkg/vcs/test_util.go and make them exported. * Split Run() into Run()+runImpl(). * Change type of bisect.go:env.inst to `instance.BuilderTester`. Change usage inside syz-testbuild/testbuild.go accordingly. * Move most of linux.PreviousReleaseTags() into vcs/git.go as git.previousReleaseTags(). * Allow build.CompilerIdentity to be mocked. Introduce the following changes: * instance.BuilderTester is an interface with methods BuildSyzkaller() BuildKernel() Test() NewEnv() now returns this interface. * type testEnv implements instance.BuilderTester. * type testBuilder implements builder interface. Add a entry into table inside pkg/build/build.go:getBuilder() to return testBuilder object.
* syz-ci: don't assume kernel config is called .configDmitry Vyukov2019-05-121-1/+1
| | | | | .config is linux-ism. We have a convention that kernel config is copied to kernel.config file. Use it.
* syz-ci: always use 10 VMs for bisectionDmitry Vyukov2019-05-101-3/+4
| | | | | 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.
* pkg/bisect: detect when too many instances erroredDmitry Vyukov2019-03-221-1/+6
| | | | | | | | | We currently skip a commit iff all 10 instances errored. But if, say, only 9 errored we consider it as OK, but this significnalty reduces chances of detecting flaky crashes. So skip if more than 2/3 errored. Update #501