diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2024-10-14 12:24:32 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-10-14 19:43:15 +0000 |
| commit | 4ecf61d06a754a3980c8a38513aded6f0db9ec2b (patch) | |
| tree | 3fc8c91422b1cb9848e7cc67a736eefa50d8adca /pkg | |
| parent | 084d817847fa603dabdd081770a757e9c41f1ae7 (diff) | |
pkg/manager: list broken seeds
It's not very useful to just have the number of the broken seeds. Let's
also show their names and the reasons why they are broken.
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/manager/seeds.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg/manager/seeds.go b/pkg/manager/seeds.go index 5455684c2..80248f04c 100644 --- a/pkg/manager/seeds.go +++ b/pkg/manager/seeds.go @@ -42,8 +42,10 @@ func LoadSeeds(cfg *mgrconfig.Config, immutable bool) Seeds { type Input struct { IsSeed bool Key string + Path string Data []byte Prog *prog.Prog + Err error } procs := runtime.GOMAXPROCS(0) inputs := make(chan *Input, procs) @@ -54,7 +56,7 @@ func LoadSeeds(cfg *mgrconfig.Config, immutable bool) Seeds { go func() { defer wg.Done() for inp := range inputs { - inp.Prog, _ = LoadProg(cfg.Target, inp.Data) + inp.Prog, inp.Err = LoadProg(cfg.Target, inp.Data) outputs <- inp } }() @@ -70,7 +72,8 @@ func LoadSeeds(cfg *mgrconfig.Config, immutable bool) Seeds { Data: rec.Val, } } - seedDir := filepath.Join(cfg.Syzkaller, "sys", cfg.TargetOS, "test") + seedPath := filepath.Join("sys", cfg.TargetOS, "test") + seedDir := filepath.Join(cfg.Syzkaller, seedPath) if osutil.IsExist(seedDir) { seeds, err := os.ReadDir(seedDir) if err != nil { @@ -83,6 +86,7 @@ func LoadSeeds(cfg *mgrconfig.Config, immutable bool) Seeds { } inputs <- &Input{ IsSeed: true, + Path: filepath.Join(seedPath, seed.Name()), Data: data, } } @@ -96,6 +100,7 @@ func LoadSeeds(cfg *mgrconfig.Config, immutable bool) Seeds { if inp.Prog == nil { if inp.IsSeed { brokenSeeds++ + log.Errorf("seed %s is broken: %s", inp.Path, inp.Err) } else { brokenCorpus = append(brokenCorpus, inp.Key) } |
