diff options
| author | Dmitriy Vyukov <dvyukov@google.com> | 2013-07-16 15:35:03 +0400 |
|---|---|---|
| committer | Dmitriy Vyukov <dvyukov@google.com> | 2013-07-16 15:35:03 +0400 |
| commit | 63e0ddc7bf0c7523d826331ff51a551c5040b50b (patch) | |
| tree | 433d3220ad125691a340739ebc95f0f7cf51db42 /src/pkg/syscall/exec_linux.go | |
| parent | 7e270cf6c4be9ddc240c2661c18f163728cbb897 (diff) | |
| download | go-63e0ddc7bf0c7523d826331ff51a551c5040b50b.tar.xz | |
cmd/gc: do not race instrument syscall.forkAndExecInChild
Race instrumentation can allocate, switch stacks, preempt, etc.
All that is not allowed in between fork and exec.
Fixes #4840.
R=golang-dev, daniel.morsing, dave
CC=golang-dev
https://golang.org/cl/11324044
Diffstat (limited to 'src/pkg/syscall/exec_linux.go')
| -rw-r--r-- | src/pkg/syscall/exec_linux.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pkg/syscall/exec_linux.go b/src/pkg/syscall/exec_linux.go index ddd946ed20..934c657712 100644 --- a/src/pkg/syscall/exec_linux.go +++ b/src/pkg/syscall/exec_linux.go @@ -28,6 +28,7 @@ type SysProcAttr struct { // In the child, this function must not acquire any locks, because // they might have been locked at the time of the fork. This means // no rescheduling, no malloc calls, and no new stack segments. +// For the same reason compiler does not race instrument it. // The calls to RawSyscall are okay because they are assembly // functions that do not grow the stack. func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr *ProcAttr, sys *SysProcAttr, pipe int) (pid int, err Errno) { |
