Skip to content

Commit 87adaf4

Browse files
committed
syscall: mark forkAndExecInChild1 noinline
This certainly won't get inlined right now, but in the spirit of making this more robust, we have to disable inlining because inlining would defeat the purpose of separating forkAndExecInChild1 into a separate function. Updates #20732. Change-Id: I736c3f909cc42c5f5783740c2e19ba4827c7c2ec Reviewed-on: https://go-review.googlesource.com/46174 Run-TryBot: Austin Clements <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 67e5375 commit 87adaf4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/syscall/exec_linux.go

+9
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
9090
return pid, 0
9191
}
9292

93+
// forkAndExecInChild1 implements the body of forkAndExecInChild up to
94+
// the parent's post-fork path. This is a separate function so we can
95+
// separate the child's and parent's stack frames if we're using
96+
// vfork.
97+
//
98+
// This is go:noinline because the point is to keep the stack frames
99+
// of this and forkAndExecInChild separate.
100+
//
101+
//go:noinline
93102
//go:norace
94103
func forkAndExecInChild1(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr *ProcAttr, sys *SysProcAttr, pipe int) (r1 uintptr, err1 Errno, p [2]int, locked bool) {
95104
// vfork requires that the child not touch any of the parent's

0 commit comments

Comments
 (0)