Skip to content

Commit d8fc408

Browse files
committed
pkg/manager: record the right base kernel crash title
When we run a reproducer on a base kernel and it crashes, we must record the crash title observed on the base kernel. Rename the field to reduce the chance of confusion in the future.
1 parent 0ae3a01 commit d8fc408

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

pkg/manager/diff.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -198,34 +198,34 @@ loop:
198198

199199
// A sanity check: the base kernel might have crashed with the same title
200200
// since the moment we have stared the reproduction / running on the repro base.
201-
crashesOnBase := dc.everCrashedBase(ctx, ret.origReport.Title)
201+
crashesOnBase := dc.everCrashedBase(ctx, ret.reproReport.Title)
202202
if ret.crashReport == nil && crashesOnBase {
203203
// Report it as error so that we could at least find it in the logs.
204-
log.Errorf("repro didn't crash base, but base itself crashed: %s", ret.origReport.Title)
204+
log.Errorf("repro didn't crash base, but base itself crashed: %s", ret.reproReport.Title)
205205
} else if ret.crashReport == nil {
206-
dc.store.BaseNotCrashed(ret.origReport.Title)
206+
dc.store.BaseNotCrashed(ret.reproReport.Title)
207207
select {
208208
case <-ctx.Done():
209209
case dc.patchedOnly <- &UniqueBug{
210-
Report: ret.origReport,
210+
Report: ret.reproReport,
211211
Repro: ret.repro,
212212
}:
213213
}
214-
log.Logf(0, "patched-only: %s", ret.origReport.Title)
214+
log.Logf(0, "patched-only: %s", ret.reproReport.Title)
215215
// Now that we know this bug only affects the patch kernel, we can spend more time
216216
// generating a minimalistic repro and a C repro.
217217
if !ret.fullRepro {
218218
reproLoop.Enqueue(&Crash{
219219
Report: &report.Report{
220-
Title: ret.origReport.Title,
220+
Title: ret.reproReport.Title,
221221
Output: ret.repro.Prog.Serialize(),
222222
},
223223
FullRepro: true,
224224
})
225225
}
226226
} else {
227-
dc.reportBaseCrash(ctx, ret.origReport)
228-
log.Logf(0, "crashes both: %s / %s", ret.origReport.Title, ret.crashReport.Title)
227+
dc.reportBaseCrash(ctx, ret.crashReport)
228+
log.Logf(0, "crashes both: %s / %s", ret.reproReport.Title, ret.crashReport.Title)
229229
}
230230
case ret := <-dc.doneRepro:
231231
// We have finished reproducing a crash from the patched instance.
@@ -717,7 +717,7 @@ type reproRunner struct {
717717
}
718718

719719
type reproRunnerResult struct {
720-
origReport *report.Report
720+
reproReport *report.Report
721721
crashReport *report.Report
722722
repro *repro.Result
723723
fullRepro bool // whether this was a full reproduction
@@ -755,7 +755,7 @@ func (rr *reproRunner) Run(ctx context.Context, r *repro.Result, fullRepro bool)
755755
rr.kernel.pool.ReserveForRun(min(cnt, pool.Total()))
756756
}()
757757

758-
ret := reproRunnerResult{origReport: r.Report, repro: r, fullRepro: fullRepro}
758+
ret := reproRunnerResult{reproReport: r.Report, repro: r, fullRepro: fullRepro}
759759
for doneRuns := 0; doneRuns < needRuns; {
760760
if ctx.Err() != nil {
761761
return
@@ -781,7 +781,7 @@ func (rr *reproRunner) Run(ctx context.Context, r *repro.Result, fullRepro bool)
781781
Opts: opts,
782782
})
783783
})
784-
logPrefix := fmt.Sprintf("attempt #%d to run %q on base", doneRuns, ret.origReport.Title)
784+
logPrefix := fmt.Sprintf("attempt #%d to run %q on base", doneRuns, ret.reproReport.Title)
785785
if errors.Is(runErr, context.Canceled) {
786786
// Just exit without sending anything over the channel.
787787
log.Logf(1, "%s: aborting due to context cancelation", logPrefix)

0 commit comments

Comments
 (0)