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

x/sys/windows: missing process working size system calls #39422

Closed
awnumar opened this issue Jun 5, 2020 · 3 comments
Closed

x/sys/windows: missing process working size system calls #39422

awnumar opened this issue Jun 5, 2020 · 3 comments

Comments

@awnumar
Copy link
Contributor

@awnumar awnumar commented Jun 5, 2020

What version of Go are you using (go version)?

$ go version
go version go1.14.3 linux/amd64

Does this issue reproduce with the latest release?

Yes. The currently exposed system calls can be seen at https://pkg.go.dev/golang.org/x/sys/windows?tab=doc

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/awn/.cache/go-build"
GOENV="/home/awn/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/awn/projects/src/go"
GOPRIVATE=""
GOPROXY="direct"
GOROOT="/usr/lib/golang"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/awn/projects/src/sys/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build786429694=/tmp/go-build -gno-record-gcc-switches"

What did you do?

When using VirtualLock (which is available in the standard library) on Windows sometimes this fails due to the process's limit being reached. See awnumar/memcall#3 for an example.

The workaround for this in the docs is to call SetProcessWorkingSetSize.

What did you expect to see?

The SetProcessWorkingSetSize and related system calls exposed in the x/sys/windows API.

What did you see instead?

They are not defined.

@dmitshur
Copy link
Member

@dmitshur dmitshur commented Jun 5, 2020

@dmitshur
Copy link
Member

@dmitshur dmitshur commented Jun 5, 2020

Thanks for sending a PR that'll fix this issue @awnumar.

It's expected that this issue will need to transition to the NeedsFix state before you should proceed with the change. There's more information here.

awnumar added a commit to awnumar/sys that referenced this issue Jun 8, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Jun 8, 2020

Change https://golang.org/cl/236680 mentions this issue: windows: add process working size system calls

awnumar added a commit to awnumar/sys that referenced this issue Jun 8, 2020
awnumar added a commit to awnumar/sys that referenced this issue Jun 9, 2020
awnumar added a commit to awnumar/sys that referenced this issue Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.