diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2024-05-07 17:04:45 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2024-05-16 15:38:27 +0000 |
| commit | b6954dce2f21b8feb1448edaaeeefc22f5ff4944 (patch) | |
| tree | 6f4358ba6609826b614847707e180662d986f98e /pkg/ipc | |
| parent | f694ecdc179cf43429135188934eed687ae28645 (diff) | |
pkg/vminfo: run programs interactively
Use the same interfaces as the fuzzer.
Now syz-manager no longer needs to treat machine check executions
differently.
Diffstat (limited to 'pkg/ipc')
| -rw-r--r-- | pkg/ipc/ipc.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/pkg/ipc/ipc.go b/pkg/ipc/ipc.go index 826d3068d..d87cb8b0e 100644 --- a/pkg/ipc/ipc.go +++ b/pkg/ipc/ipc.go @@ -6,6 +6,7 @@ package ipc import ( "fmt" "io" + "maps" "os" "os/exec" "path/filepath" @@ -98,6 +99,14 @@ type CallInfo struct { Errno int // call errno (0 if the call was successful) } +func (ci *CallInfo) Clone() CallInfo { + ret := *ci + ret.Signal = slices.Clone(ret.Signal) + ret.Cover = slices.Clone(ret.Cover) + ret.Comps = maps.Clone(ret.Comps) + return ret +} + type ProgInfo struct { Calls []CallInfo Extra CallInfo // stores Signal and Cover collected from background threads @@ -105,6 +114,16 @@ type ProgInfo struct { Freshness int // number of programs executed in the same process before this one } +func (pi *ProgInfo) Clone() *ProgInfo { + ret := *pi + ret.Extra = ret.Extra.Clone() + ret.Calls = slices.Clone(ret.Calls) + for i, call := range ret.Calls { + ret.Calls[i] = call.Clone() + } + return &ret +} + func EmptyProgInfo(calls int) *ProgInfo { info := &ProgInfo{Calls: make([]CallInfo, calls)} for i := range info.Calls { |
