diff options
| author | Andrey Konovalov <andreyknvl@google.com> | 2019-04-16 16:32:04 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-05-03 08:30:36 +0200 |
| commit | 8e54d550ca021089e6426fe3a8ca7bdf6cc9735b (patch) | |
| tree | 6b1a69c8dc4fc0da813633ad16898336e24be6fa /pkg | |
| parent | 1bfa09b9672821334a7ed926244ebc39910b84f4 (diff) | |
repro: speedup bisection for flaky crashes
Limit the amount of bisection chunks to 8. Going over this value probably
means that we are bisection a flaky crash, and continuing bisection would
just take a lot of time and likely produce no result.
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/repro/repro.go | 6 | ||||
| -rw-r--r-- | pkg/repro/repro_test.go | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/pkg/repro/repro.go b/pkg/repro/repro.go index af390162b..61793ac76 100644 --- a/pkg/repro/repro.go +++ b/pkg/repro/repro.go @@ -631,6 +631,12 @@ func (ctx *context) bisectProgs(progs []*prog.LogEntry, pred func([]*prog.LogEnt guilty := [][]*prog.LogEntry{progs} again: + if len(guilty) > 8 { + // This is usually the case for flaky crashes. Continuing bisection at this + // point would just take a lot of time and likely produce no result. + ctx.reproLog(3, "bisect: too many guilty chunks, aborting") + return nil, nil + } ctx.reproLog(3, "bisect: guilty chunks: %v", chunksToStr(guilty)) for i, chunk := range guilty { if len(chunk) == 1 { diff --git a/pkg/repro/repro_test.go b/pkg/repro/repro_test.go index bc6949a97..d28ec24ac 100644 --- a/pkg/repro/repro_test.go +++ b/pkg/repro/repro_test.go @@ -60,6 +60,10 @@ func TestBisect(t *testing.T) { } return guilty == numGuilty, nil }) + if numGuilty > 8 && len(progs) == 0 { + // Bisection has been aborted. + continue + } if len(progs) != numGuilty { t.Fatalf("bisect test failed: wrong number of guilty progs: got: %v, want: %v", len(progs), numGuilty) } |
