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

cmd/compile: -m=2 output is missing escape information #32984

Closed
ardan-bkennedy opened this issue Jul 8, 2019 · 3 comments
Closed

cmd/compile: -m=2 output is missing escape information #32984

ardan-bkennedy opened this issue Jul 8, 2019 · 3 comments
Milestone

Comments

@ardan-bkennedy
Copy link

@ardan-bkennedy ardan-bkennedy commented Jul 8, 2019

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

$ go version
go version go1.13beta1 darwin/amd64

Does this issue reproduce with the latest release?

No, this is only happening on the 1.13beta1 release.

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/bill/Library/Caches/go-build"
GOENV="/Users/bill/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/bill/code/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/bill/code/go/src/github.com/ardanlabs/gotraining/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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/f8/nl6gsnzs1m7530bkx9ct8rzc0000gn/T/go-build144671233=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Given this code:
https://github.com/ardanlabs/gotraining/tree/master/topics/go/profiling/memcpu

I ran the following command in 1.13beta1

$ go test -bench . -gcflags -m=2

What did you expect to see?

./stream.go:83:26: &bytes.Buffer literal escapes to heap
./stream.go:83:26: 	from ~R0 (assign-pair) at ./stream.go:83:26
./stream.go:83:26: 	from input (assigned) at ./stream.go:83:8
./stream.go:83:26: 	from input (interface-converted) at ./stream.go:93:26
./stream.go:83:26: 	from io.r (assign-pair) at ./stream.go:93:26
./stream.go:83:26: 	from io.r (passed to call[argument escapes]) at ./stream.go:93:26

What did you see instead?

$ go test -bench . -gcflags -m=2
./stream.go:83:26: &bytes.Buffer literal escapes to heap
./stream.go:89:13: make([]byte, size) escapes to heap
./stream.go:93:26: input escapes to heap
./stream.go:101:27: input escapes to heap
./stream.go:113:28: input escapes to heap

Why is this a problem?

All of the information about why the escape happened is gone. This information is valuable to not guess why. The new output is not saying why and disconnects the information as well.

@ardan-bkennedy

This comment has been minimized.

Copy link
Author

@ardan-bkennedy ardan-bkennedy commented Jul 8, 2019

I'm sorry, I just now realized you had an issue 31489 for this. Maybe this can provide more details and a way to test a fix.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jul 8, 2019

@ianlancetaylor ianlancetaylor added this to the Go1.14 milestone Jul 8, 2019
@mdempsky

This comment has been minimized.

Copy link
Member

@mdempsky mdempsky commented Jul 8, 2019

Thanks for the report. As you note, this is a duplicate of #31489. I think the details there are adequate, but GitHub has cross-referenced this one anyway should it prove useful.

@mdempsky mdempsky closed this Jul 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.