Description
What version of Go are you using (go version
)?
$ go version 1.19.3
Does this issue reproduce with the latest release?
randomly hitting the issue
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go env
What did you do?
What did you expect to see?
no crash
What did you see instead?
2023-05-24T06:14:48.73477977Z stderr F runtime: pointer 0xc000deaa20 to unallocated span span.base()=0xc000dea000 span.limit=0xc000dedf00 span.state=0
2023-05-24T06:14:48.734843558Z stderr F runtime: found in object at *(0xc0013d1740+0x10)
2023-05-24T06:14:48.734853215Z stderr F object=0xc0013d1740 s.base()=0xc0013d0000 s.limit=0xc0013d2000 s.spanclass=12 s.elemsize=64 s.state=mSpanInUse
2023-05-24T06:14:48.734862311Z stderr F *(object+0) = 0x1
2023-05-24T06:14:48.734871042Z stderr F *(object+8) = 0xa3535fbc00000003
2023-05-24T06:14:48.734879522Z stderr F *(object+16) = 0xc000deaa20 <==
2023-05-24T06:14:48.734887716Z stderr F *(object+24) = 0x0
2023-05-24T06:14:48.734895799Z stderr F *(object+32) = 0x0
2023-05-24T06:14:48.734904083Z stderr F *(object+40) = 0x0
2023-05-24T06:14:48.734912191Z stderr F *(object+48) = 0x1040000c9
2023-05-24T06:14:48.734920243Z stderr F *(object+56) = 0x1
2023-05-24T06:14:48.734928762Z stderr F fatal error: found bad pointer in Go heap (incorrect use of unsafe or cgo?)
2023-05-24T06:14:48.741137861Z stderr F
2023-05-24T06:14:48.741181518Z stderr F runtime stack:
2023-05-24T06:14:48.741191442Z stderr F runtime.throw({0xf1fcd7?, 0x6?})
2023-05-24T06:14:48.741200568Z stderr F /usr/local/go/src/runtime/panic.go:1047 +0x5d fp=0x7f7555a3a878 sp=0x7f7555a3a848 pc=0x438a5d
2023-05-24T06:14:48.741208713Z stderr F runtime.badPointer(0x7f7555c72278, 0x7f7555a3a8f0?, 0xc0013d1740, 0x7f7555a3a980?)
2023-05-24T06:14:48.741227727Z stderr F /usr/local/go/src/runtime/mbitmap.go:314 +0x150 fp=0x7f7555a3a8c8 sp=0x7f7555a3a878 pc=0x416770
2023-05-24T06:14:48.741247411Z stderr F runtime.findObject(0xc00138e880?, 0x7f7555a3a968?, 0x428088?)
2023-05-24T06:14:48.741256956Z stderr F /usr/local/go/src/runtime/mbitmap.go:357 +0xa6 fp=0x7f7555a3a900 sp=0x7f7555a3a8c8 pc=0x416906
2023-05-24T06:14:48.741265471Z stderr F runtime.scanobject(0xc000053238?, 0xc000053238)
2023-05-24T06:14:48.741274074Z stderr F /usr/local/go/src/runtime/mgcmark.go:1335 +0x165 fp=0x7f7555a3a990 sp=0x7f7555a3a900 pc=0x421525
2023-05-24T06:14:48.741282381Z stderr F runtime.gcDrain(0xc000053238, 0x2)
2023-05-24T06:14:48.741318157Z stderr F /usr/local/go/src/runtime/mgcmark.go:1103 +0x1d4 fp=0x7f7555a3a9f0 sp=0x7f7555a3a990 pc=0x420d94
2023-05-24T06:14:48.741327129Z stderr F runtime.gcBgMarkWorker.func2()
2023-05-24T06:14:48.74133518Z stderr F /usr/local/go/src/runtime/mgc.go:1363 +0x157 fp=0x7f7555a3aa40 sp=0x7f7555a3a9f0 pc=0x41d517
2023-05-24T06:14:48.741343384Z stderr F runtime.systemstack()
2023-05-24T06:14:48.741359577Z stderr F /usr/local/go/src/runtime/asm_amd64.s:496 +0x49 fp=0x7f7555a3aa48 sp=0x7f7555a3aa40 pc=0x46c509
2023-05-24T06:14:48.741368966Z stderr F
in findObject() how to set debug.invalidptr to true ? will it help to debug the badpointer issue ?