commit | 700132347e0702a3e5f100fba2752993b8de9600 | [log] [tgz] |
---|---|---|
author | Jason A. Donenfeld <Jason@zx2c4.com> | Fri Apr 02 11:45:21 2021 -0600 |
committer | Jason A. Donenfeld <Jason@zx2c4.com> | Fri Apr 02 19:21:33 2021 +0000 |
tree | d40bc0eb6e9e61e78e3c23c019a92da20b7fc423 | |
parent | 43e1dd70ce54ee5b1711930029ae5b4926f78f72 [diff] |
windows: allocate SECURITY_DESCRIPTOR with uintptr alignment This struct has pointers in it, which means checkptr expects for it to be aligned properly. When we're copying a Windows-allocated struct to a Go-allocated one, make sure that the Go allocation is aligned to the pointer size. This fixes the following checkptr splat: goroutine 29 [running]: runtime.throw(0x4f8dd9, 0x3a) C:/hostedtoolcache/windows/go/1.16.2/x64/src/runtime/panic.go:1117 +0x79 fp=0xc000041c50 sp=0xc000041c20 pc=0x2f9879 runtime.checkptrAlignment(0xc00009c180, 0x4d8a00, 0x1) C:/hostedtoolcache/windows/go/1.16.2/x64/src/runtime/checkptr.go:20 +0xc9 fp=0xc000041c80 sp=0xc000041c50 pc=0x2c4d09 golang.org/x/sys/windows.(*SECURITY_DESCRIPTOR).copySelfRelativeSecurityDescriptor(0x227284caa00, 0x2) C:/Users/runneradmin/go/pkg/mod/golang.org/x/sys@v0.0.0-20210309040221-94ec62e08169/windows/security_windows.go:1347 +0x11f fp=0xc000041ce8 sp=0xc000041c80 pc=0x467f9f golang.org/x/sys/windows.SecurityDescriptorFromString(0x4ebfb0, 0x2, 0x0, 0x0, 0x0) Change-Id: I7eb9c07e7afb7f139473b660f82a23541663ec50 Reviewed-on: https://go-review.googlesource.com/c/sys/+/306889 Trust: Jason A. Donenfeld <Jason@zx2c4.com> Trust: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This repository holds supplemental Go packages for low-level interactions with the operating system.
The easiest way to install is to run go get -u golang.org/x/sys
. You can also manually git clone the repository to $GOPATH/src/golang.org/x/sys
.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.
The main issue tracker for the sys repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/sys:” in the subject line, so it is easy to find.