-
Notifications
You must be signed in to change notification settings - Fork 18k
syscall: SyscallN always escapes the variadic argument #70197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This issue is blocking the use of |
Change https://go.dev/cl/625297 mentions this issue: |
@dmitshur @ianlancetaylor would it make sense to backport CL 623821 (if finally merged) to Go 1.22 and Go 1.23? This issue exists since the introduction of |
@qmuntal I'm a bit confused by the specifics in your question (maybe you got the wrong CL number mentioned? that one pulls in many x/sys CLs all at once), but in general, if there is a serious issue without a workaround and we can be confident the fix is narrow and safe, please create the backport issues with the rationale and we will consider it. See https://go.dev/wiki/MinorReleases#cherry-pick-cls-for-vendored-golangorgx-packages for details on a single x/sys CL can be backported to the vendored packages on 1.23/1.22 release branches. |
Wops, I linked the wrong CL. I was referring to 625297. I'll create the backport issue, thanks for the pointer. |
@gopherbot please open the backport tracking issues. |
Backport issue(s) opened: #70201 (for 1.22), #70202 (for 1.23). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases. |
Change https://go.dev/cl/630215 mentions this issue: |
Change https://go.dev/cl/630196 mentions this issue: |
syscall.SyscallN is implemented by runtime.syscall_syscalln, which makes sure that the variadic argument doesn't escape. There is no need to worry about the lifetime of the elements of the variadic argument, as the compiler will keep them live until the function returns. For #70197 Fixes #70202 Change-Id: I12991f0be12062eea68f2b103fa0a794c1b527eb Reviewed-on: https://go-review.googlesource.com/c/go/+/625297 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> (cherry picked from commit 7fff741) Reviewed-on: https://go-review.googlesource.com/c/go/+/630196 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
syscall.SyscallN is implemented by runtime.syscall_syscalln, which makes sure that the variadic argument doesn't escape. There is no need to worry about the lifetime of the elements of the variadic argument, as the compiler will keep them live until the function returns. For #70197 Fixes #70201 Change-Id: I12991f0be12062eea68f2b103fa0a794c1b527eb Reviewed-on: https://go-review.googlesource.com/c/go/+/625297 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> (cherry picked from commit 7fff741) Reviewed-on: https://go-review.googlesource.com/c/go/+/630215 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Quim Muntal <quimmuntal@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
syscall.SyscallN is implemented by runtime.syscall_syscalln, which makes sure that the variadic argument doesn't escape. There is no need to worry about the lifetime of the elements of the variadic argument, as the compiler will keep them live until the function returns. For golang#70197 Fixes golang#70202 Change-Id: I12991f0be12062eea68f2b103fa0a794c1b527eb Reviewed-on: https://go-review.googlesource.com/c/go/+/625297 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> (cherry picked from commit 7fff741) Reviewed-on: https://go-review.googlesource.com/c/go/+/630196 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
Go version
go version devel go1.24-bea9b91f0f Tue Nov 5 01:16:03 2024 +0000 windows/amd64
What did you do?
Run
go build -gcflags=-m .
What did you see happen?
The
syscall.SyscallN
variadic argument escaped to the heap.What did you expect to see?
The
syscall.SyscallN
variadic argument didn't escape to the heap, just as othersyscall.SyscalX
functions.Note that
syscall.SyscallN
is implemented byruntime.syscall_syscalln
, which makes sure that the variadic argument doesn't escape:go/src/runtime/syscall_windows.go
Line 519 in bea9b91
@golang/compiler @golang/windows
The text was updated successfully, but these errors were encountered: