-
Notifications
You must be signed in to change notification settings - Fork 18k
fatal error: found bad pointer in Go heap (incorrect use of unsafe or cgo?) #37506
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
Comments
Can you point to what application you built? Did it fail during build or run/test? Please run |
We are building backend service written in go. build with crashes: GoVersion:go1.14 Os:linux Arch:amd64 PS. We reviewed carefully all changes between this two builds(actually it was ~100 loc) no unsafe or cgo usages were added |
Does the application in general use unsafe or cgo? |
@ALTree Not by itself, but we use thirdparties that use cgo. govendor list: |
@dFionov thanks. This will be hard to investigate without a (smallish) reproducer. The most likely explanation for the crash is incorrect unsafe or cgo usage in one of your dependencies, or a data race in your application. I assume that running it with the race detector enabled ( |
I think that Q belongs in this thread... |
This looks the same as #37688. I'll close this issue in favor of that one, so discussion can happen in one place. @dFionov, if you believe there is something different about this issue, please let us know and we can re-open and track it separately from #37688. Otherwise, feel free to use #37688 for further discussion. |
What version of Go are you using (
go version
)?1.14
Does this issue reproduce with the latest release?
Yes, and only with it
What operating system and processor architecture are you using (
go env
)?Linux 3.10.0-957.5.1.el7.x86_64 #1 SMP Fri Feb 1 14:54:57 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
What did you do?
Rebuilded application using go 1.14 instead of using 1.13
What did you expect to see?
Working app
What did you see instead?
runtime: pointer 0xc0015e1d40 to unused region of span span.base()=0xc0015de000 span.limit=0xc0015e1c80 span.state=1
runtime: found in object at *(0xc001dccbb0+0x28)
object=0xc001dccbb0 s.base()=0xc001dcc000 s.limit=0xc001dcdfa0 s.spanclass=24 s.elemsize=176 s.state=mSpanInUse
*(object+0) = 0x1010000000060
*(object+8) = 0xc0015e1778
*(object+16) = 0x924079
*(object+24) = 0x0
*(object+32) = 0x0
*(object+40) = 0xc0015e1d40 <==
*(object+48) = 0x1504a60
*(object+56) = 0xc0015e1948
*(object+64) = 0x923bb7
*(object+72) = 0x0
*(object+80) = 0x0
*(object+88) = 0x0
*(object+96) = 0x0
*(object+104) = 0x0
*(object+112) = 0x0
*(object+120) = 0x0
*(object+128) = 0x0
*(object+136) = 0x0
*(object+144) = 0x0
*(object+152) = 0x0
*(object+160) = 0x0
*(object+168) = 0x0
fatal error: found bad pointer in Go heap (incorrect use of unsafe or cgo?)
runtime stack:
runtime.throw(0x141ed7f, 0x3e)
/usr/local/go/src/runtime/panic.go:1112 +0x72 fp=0x7fb7095c0870 sp=0x7fb7095c0840 pc=0x43c0b2
runtime.badPointer(0x7fb7092abb30, 0xc0015e1d40, 0xc001dccbb0, 0x28)
/usr/local/go/src/runtime/mbitmap.go:380 +0x230 fp=0x7fb7095c08b8 sp=0x7fb7095c0870 pc=0x41c390
runtime.findObject(0xc0015e1d40, 0xc001dccbb0, 0x28, 0x7fb7303a48f0, 0xc000058698, 0x2)
/usr/local/go/src/runtime/mbitmap.go:416 +0x9b fp=0x7fb7095c08f0 sp=0x7fb7095c08b8 pc=0x41c43b
runtime.scanobject(0xc001dccbb0, 0xc000058698)
/usr/local/go/src/runtime/mgcmark.go:1274 +0x235 fp=0x7fb7095c0980 sp=0x7fb7095c08f0 pc=0x4274d5
runtime.gcDrain(0xc000058698, 0x7)
/usr/local/go/src/runtime/mgcmark.go:1032 +0x1fb fp=0x7fb7095c09d8 sp=0x7fb7095c0980 pc=0x426cdb
runtime.gcBgMarkWorker.func2()
/usr/local/go/src/runtime/mgc.go:1955 +0x169 fp=0x7fb7095c0a18 sp=0x7fb7095c09d8 pc=0x4692f9
runtime.systemstack(0x40)
/usr/local/go/src/runtime/asm_amd64.s:370 +0x66 fp=0x7fb7095c0a20 sp=0x7fb7095c0a18 pc=0x46c0c6
runtime.mstart()
/usr/local/go/src/runtime/proc.go:1041 fp=0x7fb7095c0a28 sp=0x7fb7095c0a20 pc=0x440e90
The text was updated successfully, but these errors were encountered: