diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2023-03-28 11:51:46 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2023-03-28 13:53:08 +0200 |
| commit | 7df4f03f0bca2ce51d72b78e2cfe3823733810aa (patch) | |
| tree | c7c31300f67445f37ed1486c5e5db7bd29a93e42 /pkg/subsystem/extractor.go | |
| parent | 47f3aaf18b57644f3c07714c9ce073a210f061b4 (diff) | |
pkg/subsystem: take only always present calls from repros
We're not yet perfect at eliminating unneeded calls from reproducers, so
let's make the subsystem extraction rules stricter: only take a
subsystem from the reproducer if it's present in all reproducers.
Consider more crashes (7 instead of 5) to give more opportunities to
drop an unneeded call.
Diffstat (limited to 'pkg/subsystem/extractor.go')
| -rw-r--r-- | pkg/subsystem/extractor.go | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/pkg/subsystem/extractor.go b/pkg/subsystem/extractor.go index 075c8079d..1f635c7b3 100644 --- a/pkg/subsystem/extractor.go +++ b/pkg/subsystem/extractor.go @@ -28,12 +28,27 @@ func MakeExtractor(list []*Subsystem) *Extractor { func (e *Extractor) Extract(crashes []*Crash) []*Subsystem { // First put all subsystems to the same list. subsystems := []*Subsystem{} + reproCount := 0 for _, crash := range crashes { if crash.GuiltyPath != "" { subsystems = append(subsystems, e.raw.FromPath(crash.GuiltyPath)...) } - if len(crash.SyzRepro) > 0 { - subsystems = append(subsystems, e.raw.FromProg(crash.SyzRepro)...) + if len(crash.SyzRepro) != 0 { + reproCount++ + } + } + + // If all reproducers hint at the same subsystem, take it as well. + reproSubsystems := map[*Subsystem]int{} + for _, crash := range crashes { + if len(crash.SyzRepro) == 0 { + continue + } + for _, subsystem := range e.raw.FromProg(crash.SyzRepro) { + reproSubsystems[subsystem]++ + if reproSubsystems[subsystem] == reproCount { + subsystems = append(subsystems, subsystem) + } } } |
