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

runtime: marked free object in span pointing to runtime.gopark variable #65309

Closed
Grant-Frame opened this issue Jan 26, 2024 · 2 comments
Closed
Labels
compiler/runtime Issues related to the Go compiler and/or runtime.

Comments

@Grant-Frame
Copy link

Go version

go version go1.16.12 linux/amd64

Output of go env in your module/workspace:

GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.12"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/fabric/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-build1903424306=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Ran compiled go executable and it failed with panic leading to coredump in gopark method

What did you see happen?

The go executable crashed and generated this error message

runtime: marked free object in span 0x7f9998cec878, elemsize=32 freeindex=0 (bad use of unsafe.Pointer? try -d=checkptr)
0xc00002e000 alloc marked  
...
0xc00002e540 alloc marked  
0xc00002e560 free  marked   zombie
000000c00002e560:  00c0008000a00001  0000000000000001 
000000c00002e570:  000000c00027ca80  000000c00029a400

this memory location c00002e560 is found in the error dump to point to a variable created for runtime.gopark

goroutine 12 [GC worker (idle), 2270 minutes]:
runtime.gopark(0xac54a8, 0xc00002e560, 0x1418, 0x0)
	/usr/local/go/src/runtime/proc.go:336 +0xe5 fp=0xc00038f760 sp=0xc00038f740 pc=0x446525
runtime.gcBgMarkWorker()
	/usr/local/go/src/runtime/mgc.go:1911 +0xfb fp=0xc00038f7e0 sp=0xc00038f760 pc=0x42ae9b
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:1371 +0x1 fp=0xc00038f7e8 sp=0xc00038f7e0 pc=0x47acc1
created by runtime.gcBgMarkStartWorkers
	/usr/local/go/src/runtime/mgc.go:1835 +0x37

mgc.go:1911 is this line of code

gopark(func(g *g, nodep unsafe.Pointer) bool {
    …
}, unsafe.Pointer(node), waitReasonGCWorkerIdle, traceEvGoBlock, 0)

where node is created just earlier in this function with

node := new(gcBgMarkWorkerNode)

this appears to be issue with golang runtime marking a unsafe.Pointer it created as marked free

What did you expect to see?

that the executable would not crash and point to golang runtime module.

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jan 26, 2024
@cherrymui
Copy link
Member

go version go1.16.12 linux/amd64

Go 1.16.12 is very old and no longer supported. Could you try using a more up-to-date version of Go, Go 1.21.6 or Go 1.22RC2? Thanks.

@cherrymui
Copy link
Member

Tentatively closing. Feel free to reopen if you can reproduce the failure on an up-to-date version of Go. Thanks.

@cherrymui cherrymui closed this as not planned Won't fix, can't repro, duplicate, stale Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime.
Projects
None yet
Development

No branches or pull requests

3 participants