summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBhasker Hariharan <bhaskerh@google.com>2019-11-06 22:28:41 -0800
committergVisor bot <gvisor-bot@google.com>2019-11-06 22:30:06 -0800
commit3552691137284525a33d3de7e3c2d170da66c8ac (patch)
tree333bb2338dc69334d8232339bfa28d65640814bf
parent0c424ea73198866066ddc5e7047a3a357d313f46 (diff)
Fix data race in syscall_test_runner.go
Fixes #1140 PiperOrigin-RevId: 279012793
-rw-r--r--test/syscalls/syscall_test_runner.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/syscalls/syscall_test_runner.go b/test/syscalls/syscall_test_runner.go
index 856398994..7186a8ddc 100644
--- a/test/syscalls/syscall_test_runner.go
+++ b/test/syscalls/syscall_test_runner.go
@@ -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...)