bisect

package
v0.0.0-...-d7f584e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 15 Imported by: 28

Documentation

Index

Constants

View Source
const MaxNumTests = 20 // number of tests we do per commit

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Trace           debugtracer.DebugTracer
	Fix             bool
	DefaultCompiler string
	CompilerType    string
	Make            string
	Linker          string
	BinDir          string
	Ccache          string
	Timeout         time.Duration
	Kernel          KernelConfig
	Syzkaller       SyzkallerConfig
	Repro           ReproConfig
	Manager         *mgrconfig.Config
	BuildSemaphore  *instance.Semaphore
	TestSemaphore   *instance.Semaphore
	BuildCPUs       int
	// CrossTree specifies whether a cross tree bisection is to take place, i.e.
	// Kernel.Commit is not reachable from Kernel.Branch.
	// In this case, bisection starts from their merge base.
	CrossTree bool
}

type KernelConfig

type KernelConfig struct {
	Repo        string
	Branch      string
	Commit      string
	CommitTitle string
	Cmdline     string
	Sysctl      string
	Config      []byte
	// Baseline configuration is used in commit bisection. If the crash doesn't reproduce
	// with baseline configuratopm config bisection is run. When triggering configuration
	// option is found provided baseline configuration is modified according the bisection
	// results. This new configuration is tested once more with current head. If crash
	// reproduces with the generated configuration original configuation is replaced with
	// this minimized one.
	BaselineConfig []byte
	Userspace      string
	// Extra commits to cherry pick to older kernel revisions.
	Backports []vcs.BackportCommit
}

type ReproConfig

type ReproConfig struct {
	Opts []byte
	Syz  []byte
	C    []byte
}

type Result

type Result struct {
	Commits    []*vcs.Commit
	Report     *report.Report
	Commit     *vcs.Commit
	Config     []byte
	NoopChange bool
	IsRelease  bool
	Confidence float64
}

Result describes bisection result: 1. if bisection is conclusive, the single cause/fix commit in Commits

  • for cause bisection report is the crash on the cause commit
  • for fix bisection report is nil
  • Commit is nil
  • NoopChange is set if the commit did not cause any change in the kernel binary (bisection result it most likely wrong)

2. Bisected to a release commit

  • if bisection is inconclusive, range of potential cause/fix commits in Commits
  • report is nil in such case

3. Commit is nil

  • if the crash still happens on the oldest release/HEAD (for cause/fix bisection correspondingly)
  • no commits in Commits
  • the crash report on the oldest release/HEAD;
  • Commit points to the oldest/latest commit where crash happens.

4. Config contains kernel config used for bisection.

func Run

func Run(cfg *Config) (*Result, error)

Run does the bisection and returns either the Result, or, if the crash is not reproduced on the start commit, an error.

type SyzkallerConfig

type SyzkallerConfig struct {
	Repo         string
	Commit       string
	Descriptions string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL