diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2022-02-10 18:46:54 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2022-02-25 18:57:42 +0100 |
| commit | 33f1741ccbc084ded689693774db379d52a5e32d (patch) | |
| tree | 219d967dad74c48a81b153eaa3ea33596544fd9e /tools/syz-testbed | |
| parent | aa3dbd72ed6726be5bf1bec14a2ceaca369a8063 (diff) | |
tools/syz-testbed: do Start()/Wait() instead of Run()
Otherwise there's a risk that the instance is stopped before Run() has
had a chance to be executed. This leads to a panic while doing
cmd.Signal().
Diffstat (limited to 'tools/syz-testbed')
| -rw-r--r-- | tools/syz-testbed/instance.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/syz-testbed/instance.go b/tools/syz-testbed/instance.go index bd25d55eb..888ad9ff7 100644 --- a/tools/syz-testbed/instance.go +++ b/tools/syz-testbed/instance.go @@ -38,8 +38,9 @@ func (inst *Instance) Run() error { cmd.Stderr = logfile complete := make(chan error) + cmd.Start() go func() { - complete <- cmd.Run() + complete <- cmd.Wait() }() select { |
