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: pointer 0xe9f4d95300 to unused region of span span.base()=0xc311776000 span. limit=0xc311778000 span.state=1 #51552

Closed
hicaoc opened this issue Mar 9, 2022 · 4 comments
Labels
WaitingForInfo

Comments

@hicaoc
Copy link

@hicaoc hicaoc commented Mar 9, 2022

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

$ go version

1.16.15

Does this issue reproduce with the latest release?

Yes, 1.17.6, 1.17.7 and 1.17.8 reproduce

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

go env Output
$ go env


centos8 linux ,x86-64

What did you do?

There are a lot of code changes that have been running normally in one production environment, and often crashed and exited in another environment.

What did you expect to see?

What did you see instead?

220308.175025 runtime: pointer 0xe9f4d95300 to unused region of span span.base()=0xc311776000 span. limit=0xc311778000 span.state=1
520308.175025 fatal error: found bad pointer in Go heap ( incorrect use of unsafe or cgo?)
220308.175025
220308.175025 runtime stack:
220308.175025 runtime.throw(0x8ee39b, 0x3e)
220308.175025 /usr/local/go/src/runtime/panic.go:1117+0x72 fp=0x7f7227ffed88 sp=0x7f7227ffed58 pc=0x43b3f2
220308.175025 runtime.badpointer(0x7f6f0ba6bae0, 0xe9f4d95300, 0x0, 0x0)
220308.175025 /usr/local/go/src/runtime/mbitmap.go:351+0x235 fp=0x7f7227ffeddo sp=0x7f7227ffed88 pc=0x418db5
220308.175025 runtime. findobiect(oxe9f4d95300, 0x0, 0x0, 0xd9b9938b00, 0x7f6ff8305d50, 0xb)
220308.175025 /usr/local/go/src/runtime/mbitmap .go: 387 +0x9b fp=0x7f7227ffee08 sp=0x7f7227ffedd0 pc=0x418e7b
220308.175025 runtime.wbbuffFlush1(0xc000043000)
220308.175025 /usr/local/go/src/runtime/mwbbuf.go:260+0xa8 fp=0x7f7227ffee60 sp=0x7f7227ffee08 pc=0x4360e8
220308.175025 runtime.wbBuffFush.func1()
220308.175025 /usr/local/go/src/runtime/mwbbuf.qo:201+0x3afp=0x7f7227ffee78sp=0x7f7227ffee60pc=0x46b69a
220308.175025 runtime.systemstack(0xc01bd82180)
220308.175025 /usr/local/go/src/runtime/asm_amd 64.s:379+0x66 fp=0x7f7227ffee80 sp=0x7f7227ffee78 pc=0x4721c6
220308.175025 runtime.mstart()
220308.175025 /usr/local/go/src/runtime/proc.go:1246 fp=0x7f7227ffee88 sp=0x7f7227ffee80 pc=0x4406c0
220308.175025

@hicaoc hicaoc changed the title runtime: untime: pointer 0xe9f4d95300 to unused region of span span.base()=0xc311776000 span. limit=0xc311778000 span.state=1 runtime: runtime: pointer 0xe9f4d95300 to unused region of span span.base()=0xc311776000 span. limit=0xc311778000 span.state=1 Mar 9, 2022
@hicaoc hicaoc changed the title runtime: runtime: pointer 0xe9f4d95300 to unused region of span span.base()=0xc311776000 span. limit=0xc311778000 span.state=1 runtime: pointer 0xe9f4d95300 to unused region of span span.base()=0xc311776000 span. limit=0xc311778000 span.state=1 Mar 9, 2022
@davecheney
Copy link
Contributor

@davecheney davecheney commented Mar 9, 2022

This looks like memory corruption. Have you tried running your program under the race detector? See https://blog.golang.org/race-detector .

@hicaoc
Copy link
Author

@hicaoc hicaoc commented Mar 9, 2022

This looks like memory corruption. Have you tried running your program under the race detector? See https://blog.golang.org/race-detector .

No, I'll try it later ,thanks

@mengzhuo mengzhuo added the WaitingForInfo label Mar 9, 2022
@hicaoc
Copy link
Author

@hicaoc hicaoc commented Mar 9, 2022

Using atomic to write shared variables alone has been around for a long time and didn't crash before.

==================
WARNING: DATA RACE
Read at 0x00c01be2fde8 by goroutine 38:
main.genTotalStats()
/home/caocheng/go/src/gameparser/dateStat.go:413 +0x5a4
main.genAppStats()
/home/caocheng/go/src/gameparser/dateStat.go:494 +0xa9
main.areatotalStatsAccount()
/home/caocheng/go/src/gameparser/stats.go:669 +0x164
main.topnStats()
/home/caocheng/go/src/gameparser/stats.go:22 +0x12e
main.parserfile()
/home/caocheng/go/src/gameparser/parserLogfile.go:166 +0x39c
main.parserlogfile.func1()
/home/caocheng/go/src/gameparser/parserLogfile.go:93 +0xd7

Previous write at 0x00c01be2fde8 by goroutine 41:
sync/atomic.StoreInt64()
/usr/local/go/src/runtime/race_amd64.s:248 +0xb
main.genTotalStats()
/home/caocheng/go/src/gameparser/dateStat.go:414 +0x87b
main.genAppStats()
/home/caocheng/go/src/gameparser/dateStat.go:494 +0xa9
main.areatotalStatsAccount()
/home/caocheng/go/src/gameparser/stats.go:669 +0x164
main.topnStats()
/home/caocheng/go/src/gameparser/stats.go:22 +0x12e
main.parserfile()
/home/caocheng/go/src/gameparser/parserLogfile.go:166 +0x39c
main.parserlogfile.func1()
/home/caocheng/go/src/gameparser/parserLogfile.go:93 +0xd7

Goroutine 38 (running) created at:
main.parserlogfile()
/home/caocheng/go/src/gameparser/parserLogfile.go:91 +0x777
main.main.func1()
/home/caocheng/go/src/gameparser/main.go:153 +0xbc

Goroutine 41 (running) created at:
main.parserlogfile()
/home/caocheng/go/src/gameparser/parserLogfile.go:91 +0x777
main.main.func1()
/home/caocheng/go/src/gameparser/main.go:153 +0xbc

Also, every time it crashes, it is found that there is a call at runtime/mwbbuf.go. The code for report.go 123 is as follows:

           r.DIP = string(res[4])
	r.Protocal = string(res[5])
	r.SPort = string(res[6])
	r.DPort = string(res[7])

220308.175025|runtime: pointer 0xe9f4d95300 to unused region of span span.base()=0xc311776000 span.limit=0xc311778000 span.state=1
220308.175025|fatal error: found bad pointer in Go heap (incorrect use of unsafe or cgo?)
220308.175025|
220308.175025|runtime stack:
220308.175025|runtime.throw(0x8ee39b, 0x3e)
220308.175025| /usr/local/go/src/runtime/panic.go:1117 +0x72 fp=0x7f7227ffed88 sp=0x7f7227ffed58 pc=0x43b3f2
220308.175025|runtime.badPointer(0x7f6f0ba6bae0, 0xe9f4d95300, 0x0, 0x0)
220308.175025| /usr/local/go/src/runtime/mbitmap.go:351 +0x235 fp=0x7f7227ffedd0 sp=0x7f7227ffed88 pc=0x418db5
220308.175025|runtime.findObject(0xe9f4d95300, 0x0, 0x0, 0xd9b9938b00, 0x7f6ff8305d50, 0xb)
220308.175025| /usr/local/go/src/runtime/mbitmap.go:387 +0x9b fp=0x7f7227ffee08 sp=0x7f7227ffedd0 pc=0x418e7b
220308.175025|runtime.wbBufFlush1(0xc000043000)
220308.175025| /usr/local/go/src/runtime/mwbbuf.go:260 +0xa8 fp=0x7f7227ffee60 sp=0x7f7227ffee08 pc=0x4360e8
220308.175025|runtime.wbBufFlush.func1()
220308.175025| /usr/local/go/src/runtime/mwbbuf.go:201 +0x3a fp=0x7f7227ffee78 sp=0x7f7227ffee60 pc=0x46b69a
220308.175025|runtime.systemstack(0xc01bd82180)
220308.175025| /usr/local/go/src/runtime/asm_amd64.s:379 +0x66 fp=0x7f7227ffee80 sp=0x7f7227ffee78 pc=0x4721c6
220308.175025|runtime.mstart()
220308.175025| /usr/local/go/src/runtime/proc.go:1246 fp=0x7f7227ffee88 sp=0x7f7227ffee80 pc=0x4406c0
220308.175025|
220308.175025|goroutine 113690 [running]:
220308.175025|runtime.systemstack_switch()
220308.175025| /usr/local/go/src/runtime/asm_amd64.s:339 fp=0xe07e9cfb88 sp=0xe07e9cfb80 pc=0x472140
220308.175025|runtime.wbBufFlush(0xd9b9939080, 0xdc6422ac20)
220308.175025| /usr/local/go/src/runtime/mwbbuf.go:200 +0x47 fp=0xe07e9cfba8 sp=0xe07e9cfb88 pc=0x435fc7
220308.175025|runtime.gcWriteBarrier(0x0, 0xe319281700, 0x5, 0xdc6422ac20, 0x5, 0x1, 0x0, 0x10, 0xe31929c820, 0x11, ...)
220308.175025| /usr/local/go/src/runtime/asm_amd64.s:1459 +0xae fp=0xe07e9cfc30 sp=0xe07e9cfba8 pc=0x47404e
220308.175025|main.decode(0xe3192816c0, 0x6f, 0x70, 0xe3192816c0, 0x6f, 0x70)
220308.175025| /home/caocheng/go/src/gameparser/report.go:123 +0x8d8 fp=0xe07e9cfd80 sp=0xe07e9cfc30 pc=0x7dfb18
220308.175025|main.parserfile(0xc5217c0962, 0x2, 0xc3267c2f99, 0xe, 0xc3267c2f99, 0x8, 0xc5217c0964, 0x4, 0xc3267c2f50, 0x6d)
220308.175025| /home/caocheng/go/src/gameparser/parserLogfile.go:157 +0x2ce fp=0xe07e9cff00 sp=0xe07e9cfd80 pc=0x7d9f6e
220308.175025|main.parserlogfile.func1(0xc52d6f6ac0, 0xc327416770, 0xc5217c0962, 0x2, 0xc3267c2f99, 0xe, 0xc3267c2f99, 0x8, 0xc5217c0964, 0x4, ...)
220308.175025| /home/caocheng/go/src/gameparser/parserLogfile.go:93 +0xbe fp=0xe07e9cff80 sp=0xe07e9cff00 pc=0x800e1e
220308.175025|runtime.goexit()
220308.175025| /usr/local/go/src/runtime/asm_amd64.s:1371 +0x1 fp=0xe07e9cff88 sp=0xe07e9cff80 pc=0x473f81
220308.175025|created by main.parserlogfile
220308.175025| /home/caocheng/go/src/gameparser/parserLogfile.go:91 +0x5fc

@davecheney
Copy link
Contributor

@davecheney davecheney commented Mar 9, 2022

Sorry to report that if your program has a data race, the results are undefined. I’m going to close this issue for the moment, please feel, once you’ve addressed the data races, to comment if your are still experiencing crashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WaitingForInfo
Projects
None yet
Development

No branches or pull requests

3 participants