Skip to content
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

syscall: ntdll.dll errors in rtlGetNtVersionNumbers via os.StartProcess [1.17 backport] #49868

Closed
gopherbot opened this issue Nov 30, 2021 · 6 comments
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Milestone

Comments

@gopherbot
Copy link

@zx2c4 requested issue #49731 to be considered for backport to the next 1.17 minor release.

@gopherbot please backport this because it seems kind of security sensitive.

@zx2c4
Copy link
Contributor

zx2c4 commented Nov 30, 2021

f463b20

@gopherbot gopherbot added this to the Go1.17.4 milestone Nov 30, 2021
@dmitshur dmitshur added CherryPickApproved Used during the release process for point releases and removed CherryPickCandidate Used during the release process for point releases labels Dec 1, 2021
@mknyszek
Copy link
Contributor

mknyszek commented Dec 1, 2021

Hey @zx2c4 I'm considering cutting the minor release tomorrow. Will you have time to get the cherry-pick reviewed and landed?

@zx2c4
Copy link
Contributor

zx2c4 commented Dec 1, 2021

There are a lot of conflicts, I think because of the calling convention changes. I'll give it a pass now and see how simple they are to resolve.

@zx2c4
Copy link
Contributor

zx2c4 commented Dec 1, 2021

Wasn't so bad. Done with 1.17. Will do 1.16 now.

@gopherbot
Copy link
Author

Change https://golang.org/cl/368355 mentions this issue: [release-branch.go1.17] runtime: keep //go:cgo_unsafe_args arguments alive to prevent GC

@gopherbot
Copy link
Author

Closed by merging f0ee7c6 to release-branch.go1.17.

gopherbot pushed a commit that referenced this issue Dec 1, 2021
…alive to prevent GC

When syscall's DLL.FindProc calls into syscall_getprocaddress with a
byte slice pointer, we need to keep those bytes alive. Otherwise the GC
will collect the allocation, and we wind up calling `GetProcAddress` on
garbage, which showed up as various flakes in the builders. It turns out
that this problem extends to many uses of //go:cgo_unsafe_args
throughout, on all platforms. So this patch fixes the issue by keeping
non-integer pointer arguments alive through their invocation in
//go:cgo_unsafe_args functions.

Fixes #49868.
Updates #49731.

Change-Id: I93e4fbc2e8e210cb3fc53149708758bb33f2f9c7
Reviewed-on: https://go-review.googlesource.com/c/go/+/368355
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
@golang golang locked and limited conversation to collaborators Dec 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CherryPickApproved Used during the release process for point releases FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

4 participants