Skip to content

bad defer entry in panic with panic in defer #61059

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

Closed
stoksc opened this issue Jun 29, 2023 · 1 comment
Closed

bad defer entry in panic with panic in defer #61059

stoksc opened this issue Jun 29, 2023 · 1 comment

Comments

@stoksc
Copy link

stoksc commented Jun 29, 2023

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

$ go version
go version go1.20.5 darwin/arm64

Does this issue reproduce with the latest release?

Yes, I saw it on the 1.21 rc version, too.

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

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/*/Library/Caches/go-build"
GOENV="/Users/*/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/*/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/*/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.20.5"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/*/*/*/master/go.mod"
GOWORK="/Users/*/*/*/go.work"
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/jz/mf6cdns11jx9prqj65v8rjx40000gp/T/go-build2673756243=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I have a complicated code base so it is hard to pin down, but if I get a minimal repro I will update this issue. Within this code base, I have a 'hang' where execution abruptly stops because a function never returns but it also doesn't panic. I can print from a defer call at the top of a function call but not from the line after the function returns. When I attach a debugger, it ends at this line in panic.go:

if gp._defer != d {
	throw("bad defer entry in panic")
}

After which I get no panic or stderr, execution just seems to stop. I do have a panic in a defer. When I fix it everything works fine.

What did you expect to see?

A panic, I think.

What did you see instead?

Nothing, a halt.

@stoksc stoksc changed the title affected/package: bad defer entry in panic with panic in defer Jun 29, 2023
@stoksc stoksc closed this as completed Jun 29, 2023
@stoksc
Copy link
Author

stoksc commented Jun 29, 2023

Working too late, too many defers. Sorry to bother. I had a hang in a deferred call in the calling function 🤦 .

@golang golang locked and limited conversation to collaborators Jun 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants