Fix data race in syscall_test_runner.go

Fixes #1140

PiperOrigin-RevId: 279012793
This commit is contained in:
Bhasker Hariharan
2019-11-06 22:30:06 -08:00
committed by gVisor bot
parent 0c424ea731
commit 3552691137
+5 -4
View File
@@ -208,14 +208,15 @@ func runRunsc(tc gtest.TestCase, spec *specs.Spec) error {
}
log.Warningf("%s: Got signal: %v", name, s)
done := make(chan bool)
go func() {
dArgs := append(args, "-alsologtostderr=true", "debug", "--stacks", id)
dArgs := append([]string{}, args...)
dArgs = append(dArgs, "-alsologtostderr=true", "debug", "--stacks", id)
go func(dArgs []string) {
cmd := exec.Command(*runscPath, dArgs...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Run()
done <- true
}()
}(dArgs)
timeout := time.After(3 * time.Second)
select {
@@ -225,7 +226,7 @@ func runRunsc(tc gtest.TestCase, spec *specs.Spec) error {
}
log.Warningf("Send SIGTERM to the sandbox process")
dArgs := append(args, "debug",
dArgs = append(args, "debug",
fmt.Sprintf("--signal=%d", syscall.SIGTERM),
id)
cmd = exec.Command(*runscPath, dArgs...)