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: darwin/arm64 invalid code optimization or debugger issue? #44843

Closed
andig opened this issue Mar 7, 2021 · 4 comments
Closed

cmd/compile: darwin/arm64 invalid code optimization or debugger issue? #44843

andig opened this issue Mar 7, 2021 · 4 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@andig
Copy link
Contributor

andig commented Mar 7, 2021

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

$ go version
go version go1.16 darwin/arm64

Does this issue reproduce with the latest release?

yes

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

go env Output
$ go env
❯ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/andig/Library/Caches/go-build"
GOENV="/Users/andig/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/andig/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/andig/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/homebrew/Cellar/go/1.16/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/homebrew/Cellar/go/1.16/libexec/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.16"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/andig/htdocs/evcc/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 -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/sv/rs_453y57xj86xsbz3kw1mbc0000gn/T/go-build1160349350=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Debugging code in vscode.

What did you expect to see?

Expect errors to be caught and show error != nil.

What did you see instead?

Breakpoint triggered although err == nil:

Screenshot 2021-03-07 at 17 35 34

Afterwards executing function continues when stepping through. Seems like something is odd with either code positions in delve or compiler optimizations?

@hyangah
Copy link
Contributor

hyangah commented Mar 7, 2021

@andig can you check if you can reproduce the issue with the dlv cli? It can be go-delve/delve#2346.
cc @aarzilli

@aarzilli
Copy link
Contributor

aarzilli commented Mar 7, 2021

The value of key seems to good to be that bug but there isn't enough here to tell.

@ALTree ALTree changed the title Darwin/arm64: invalid code optimization or debugger issue? cmd/compile: darwin/arm64 invalid code optimization or debugger issue? Mar 8, 2021
@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 8, 2021
@andig
Copy link
Contributor Author

andig commented Mar 9, 2021

Delve links to #25841. Closing for time being until hit I hit it again in a more confined case, thanks for jumping in.

@andig andig closed this as completed Mar 9, 2021
@kolkov
Copy link

kolkov commented Jul 15, 2021

The same problem, but I don't get this problem with Go 1.17rc1. Thanks for JetBrains team.

@golang golang locked and limited conversation to collaborators Jul 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants