Skip to content

Commit

Permalink
syz-manager: still ignore log parse problems
Browse files Browse the repository at this point in the history
It seems that this error may come up in absolutely valid and reasonable
cases. Restore the special casing.
  • Loading branch information
a-nogikh committed Jul 17, 2024
1 parent 877a6ab commit 21615eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion pkg/repro/repro.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,13 @@ func Run(crashLog []byte, cfg *mgrconfig.Config, features flatrpc.Feature, repor
return ctx.run()
}

var ErrEmptyCrashLog = errors.New("no programs")

func prepareCtx(crashLog []byte, cfg *mgrconfig.Config, features flatrpc.Feature, reporter *report.Reporter,
exec execInterface) (*reproContext, error) {
entries := cfg.Target.ParseLog(crashLog)
if len(entries) == 0 {
return nil, fmt.Errorf("crash log (%d bytes) does not contain any programs", len(crashLog))
return nil, fmt.Errorf("log (%d bytes) parse failed: %w", len(crashLog), ErrEmptyCrashLog)
}
crashStart := len(crashLog)
crashTitle, crashType := "", crash.UnknownType
Expand Down
7 changes: 5 additions & 2 deletions syz-manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,11 @@ func reportReproError(err error) {
default:
}

switch err {
case repro.ErrNoVMs:
if errors.Is(err, repro.ErrEmptyCrashLog) {
// The kernel could have crashed before we executed any programs.
log.Logf(0, "repro failed: %v", err)
return
} else if errors.Is(err, repro.ErrNoVMs) {
// This error is to be expected if we're shutting down.
if shutdown {
return
Expand Down

0 comments on commit 21615eb

Please sign in to comment.