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: garbage collector found invalid heap pointer #21432

Closed
dsnet opened this issue Aug 14, 2017 · 7 comments
Closed

runtime: garbage collector found invalid heap pointer #21432

dsnet opened this issue Aug 14, 2017 · 7 comments
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-NetBSD

Comments

@dsnet
Copy link
Member

dsnet commented Aug 14, 2017

Just seen in the misc-compile-netbsd builder:

cmd/trace
# expvar
runtime: garbage collector found invalid heap pointer *(0xc20875c1a8+0x0)=0xc208721000 span=0xc208714000-0xc208721000-0xc208722000 state=0
fatal error: invalid heap pointer

runtime stack:
runtime.throw(0xdfc8a3)
	/usr/local/go/src/runtime/panic.go:491 +0xad fp=0x7ffee88b5860 sp=0x7ffee88b5830
scanblock(0xc20875c1a8, 0x68, 0xbd278c)
	/usr/local/go/src/runtime/mgc0.c:378 +0x551 fp=0x7ffee88b59a0 sp=0x7ffee88b5860
scanframe(0x7ffee88b5aa8, 0x0, 0x1)
	/usr/local/go/src/runtime/mgc0.c:719 +0x164 fp=0x7ffee88b5a10 sp=0x7ffee88b59a0
runtime.gentraceback(0x437400, 0xc20875c040, 0x0, 0xc208000240, 0x0, 0x0, 0x7fffffff, 0x7ffee88b5b58, 0x0, 0x0, ...)
	/usr/local/go/src/runtime/traceback.go:311 +0x7a8 fp=0x7ffee88b5b00 sp=0x7ffee88b5a10
scanstack(0xc208000240)
	/usr/local/go/src/runtime/mgc0.c:777 +0x21c fp=0x7ffee88b5b70 sp=0x7ffee88b5b00
markroot(0xc20800e000, 0x5)
	/usr/local/go/src/runtime/mgc0.c:553 +0xe7 fp=0x7ffee88b5bd0 sp=0x7ffee88b5b70
runtime.parfordo(0xc20800e000)
	/usr/local/go/src/runtime/parfor.c:76 +0xb2 fp=0x7ffee88b5c50 sp=0x7ffee88b5bd0
gc(0x7ffee88b5d88)
	/usr/local/go/src/runtime/mgc0.c:1439 +0x25e fp=0x7ffee88b5d68 sp=0x7ffee88b5c50
runtime.gc_m()
	/usr/local/go/src/runtime/mgc0.c:1368 +0xe0 fp=0x7ffee88b5da0 sp=0x7ffee88b5d68
runtime.onM(0xe55790)
	/usr/local/go/src/runtime/asm_amd64.s:257 +0x68 fp=0x7ffee88b5da8 sp=0x7ffee88b5da0
runtime.mstart()
	/usr/local/go/src/runtime/proc.c:818 fp=0x7ffee88b5db0 sp=0x7ffee88b5da8

goroutine 1 [garbage collection]:
runtime.switchtoM()
	/usr/local/go/src/runtime/asm_amd64.s:198 fp=0xc20875c048 sp=0xc20875c040
runtime.gogc(0x7f9e00000000)
	/usr/local/go/src/runtime/malloc.go:469 +0x1cf fp=0xc20875c080 sp=0xc20875c048
runtime.mallocgc(0xd0, 0xa92560, 0x0, 0x468bf6)
	/usr/local/go/src/runtime/malloc.go:341 +0x391 fp=0xc20875c130 sp=0xc20875c080
runtime.newobject(0xa92560, 0x10)
	/usr/local/go/src/runtime/malloc.go:353 +0x49 fp=0xc20875c158 sp=0xc20875c130
runtime.evacuate(0x9eeac0, 0xc20845cf90, 0x7f)
	/usr/local/go/src/runtime/hashmap.go:830 +0x4da fp=0xc20875c218 sp=0xc20875c158
runtime.growWork(0x9eeac0, 0xc20845cf90, 0x55)
	/usr/local/go/src/runtime/hashmap.go:761 +0x8a fp=0xc20875c238 sp=0xc20875c218
runtime.mapassign1(0x9eeac0, 0xc20845cf90, 0xc20875c328, 0xc20875c318)
	/usr/local/go/src/runtime/hashmap.go:401 +0x190 fp=0xc20875c2d8 sp=0xc20875c238
bootstrap/cmd/compile/internal/types.(*Pkg).LookupOK(0xc208095130, 0xc20872b0b0, 0x26, 0xc208753920, 0x26)
	/tmp/workdir/go/src/cmd/compile/internal/types/pkg.go:96 +0x2cf fp=0xc20875c380 sp=0xc20875c2d8
bootstrap/cmd/compile/internal/types.(*Pkg).Lookup(0xc208095130, 0xc20872b0b0, 0x26, 0x2)
	/tmp/workdir/go/src/cmd/compile/internal/types/pkg.go:73 +0x3c fp=0xc20875c3b0 sp=0xc20875c380
bootstrap/cmd/compile/internal/gc.methodname(0xc208753860, 0xc2086bfa40, 0x1)
	/tmp/workdir/go/src/cmd/compile/internal/gc/dcl.go:944 +0x20a fp=0xc20875c468 sp=0xc20875c3b0
bootstrap/cmd/compile/internal/gc.(*importer).typ(0xc208072700, 0xffffffffffffff12)
	/tmp/workdir/go/src/cmd/compile/internal/gc/bimport.go:517 +0xdb0 fp=0xc20875c6a8 sp=0xc20875c468
bootstrap/cmd/compile/internal/gc.(*importer).typ(0xc208072700, 0xc2086bf920)
	/tmp/workdir/go/src/cmd/compile/internal/gc/bimport.go:563 +0x5df fp=0xc20875c8e8 sp=0xc20875c6a8
bootstrap/cmd/compile/internal/gc.(*importer).field(0xc208072700, 0xc2086c2580)
	/tmp/workdir/go/src/cmd/compile/internal/gc/bimport.go:621 +0x57 fp=0xc20875c948 sp=0xc20875c8e8
bootstrap/cmd/compile/internal/gc.(*importer).fieldList(0xc208072700, 0xc2086617a0, 0x1b, 0x1b)
	/tmp/workdir/go/src/cmd/compile/internal/gc/bimport.go:612 +0xb3 fp=0xc20875c998 sp=0xc20875c948
bootstrap/cmd/compile/internal/gc.(*importer).typ(0xc208072700, 0xc208433800)
	/tmp/workdir/go/src/cmd/compile/internal/gc/bimport.go:558 +0x689 fp=0xc20875cbd8 sp=0xc20875c998
bootstrap/cmd/compile/internal/gc.(*importer).typ(0xc208072700, 0x50000c208682e40)
	/tmp/workdir/go/src/cmd/compile/internal/gc/bimport.go:489 +0xaa2 fp=0xc20875ce18 sp=0xc20875cbd8
bootstrap/cmd/compile/internal/gc.(*importer).obj(0xc208072700, 0xfffffffffffffffd)
	/tmp/workdir/go/src/cmd/compile/internal/gc/bimport.go:342 +0xb99 fp=0xc20875cfc8 sp=0xc20875ce18
bootstrap/cmd/compile/internal/gc.Import(0xc208095130, 0xc20845b680)
	/tmp/workdir/go/src/cmd/compile/internal/gc/bimport.go:134 +0x106d fp=0xc20875d298 sp=0xc20875cfc8
bootstrap/cmd/compile/internal/gc.importfile(0xc20839c260, 0x0)
	/tmp/workdir/go/src/cmd/compile/internal/gc/main.go:1073 +0x1635 fp=0xc20875d4c8 sp=0xc20875d298
bootstrap/cmd/compile/internal/gc.(*noder).importDecl(0xc2082a52c0, 0xc20829b6e0)
	/tmp/workdir/go/src/cmd/compile/internal/gc/noder.go:196 +0xae fp=0xc20875d560 sp=0xc20875d4c8
bootstrap/cmd/compile/internal/gc.(*noder).decls(0xc2082a52c0, 0xc20805ac00, 0x37, 0x40, 0x0, 0x0, 0x0)
	/tmp/workdir/go/src/cmd/compile/internal/gc/noder.go:172 +0x389 fp=0xc20875d6a0 sp=0xc20875d560
bootstrap/cmd/compile/internal/gc.(*noder).node(0xc2082a52c0)
	/tmp/workdir/go/src/cmd/compile/internal/gc/noder.go:150 +0xd3 fp=0xc20875d7e0 sp=0xc20875d6a0
bootstrap/cmd/compile/internal/gc.parseFiles(0xc208000230, 0x1, 0x1, 0x2)
	/tmp/workdir/go/src/cmd/compile/internal/gc/noder.go:48 +0x4fb fp=0xc20875d970 sp=0xc20875d7e0
bootstrap/cmd/compile/internal/gc.Main(0xc39390)
	/tmp/workdir/go/src/cmd/compile/internal/gc/main.go:434 +0x2508 fp=0xc20875dee8 sp=0xc20875d970
main.main()
	/tmp/workdir/go/src/cmd/compile/main.go:49 +0x1c5 fp=0xc20875df98 sp=0xc20875dee8
runtime.main()
	/usr/local/go/src/runtime/proc.go:63 +0xf3 fp=0xc20875dfe0 sp=0xc20875df98
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc20875dfe8 sp=0xc20875dfe0

goroutine 2 [force gc (idle)]:
runtime.gopark(0x42f220, 0xe54d70, 0xb442b0, 0xf)
	/usr/local/go/src/runtime/proc.go:130 +0x105 fp=0xc208018798 sp=0xc208018768
runtime.goparkunlock(0xe54d70, 0xb442b0, 0xf)
	/usr/local/go/src/runtime/proc.go:136 +0x48 fp=0xc2080187c0 sp=0xc208018798
runtime.forcegchelper()
	/usr/local/go/src/runtime/proc.go:99 +0xce fp=0xc2080187e0 sp=0xc2080187c0
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc2080187e8 sp=0xc2080187e0
created by runtime.init·4
	/usr/local/go/src/runtime/proc.go:87 +0x25

goroutine 3 [GC sweep wait]:
runtime.gopark(0x42f220, 0xe6bbc8, 0xb31430, 0xd)
	/usr/local/go/src/runtime/proc.go:130 +0x105 fp=0xc20801bf98 sp=0xc20801bf68
runtime.goparkunlock(0xe6bbc8, 0xb31430, 0xd)
	/usr/local/go/src/runtime/proc.go:136 +0x48 fp=0xc20801bfc0 sp=0xc20801bf98
7runtime.bgsweep()
	/usr/local/go/src/runtime/mgc0.go:98 +0xbc fp=0xc20801bfe0 sp=0xc20801bfc0
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc20801bfe8 sp=0xc20801bfe0
created by gc
	/usr/local/go/src/runtime/mgc0.c:1383

goroutine 4 [finalizer wait]:
runtime.gopark(0x42f220, 0xe6bbc0, 0xb438b0, 0xe)
	/usr/local/go/src/runtime/proc.go:130 +0x105 fp=0xc208017730 sp=0xc208017700
runtime.goparkunlock(0xe6bbc0, 0xb438b0, 0xe)
	/usr/local/go/src/runtime/proc.go:136 +0x48 fp=0xc208017758 sp=0xc208017730
runtime.runfinq()
	/usr/local/go/src/runtime/malloc.go:727 +0xba fp=0xc2080177e0 sp=0xc208017758
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc2080177e8 sp=0xc2080177e0
created by runtime.createfing
	/usr/local/go/src/runtime/malloc.go:707 +0x5e
cmd/go/internal/bug

Full log:
https://storage.googleapis.com/go-build-log/eefc42f3/misc-compile-netbsd_45aa0e79.log

\cc @aclements

@dsnet dsnet added OS-NetBSD Builders x/build issues (builders, bots, dashboards) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Aug 14, 2017
@RLH
Copy link
Contributor

RLH commented Aug 14, 2017 via email

@josharian
Copy link
Contributor

We need 1.4 to work for our tool chain, for bootstrapping.

Also, for the avoidance of doubt: This occurred early in the compiler, before backend concurrency kicks in.

@aclements
Copy link
Member

This appears to be an extremely rare failure. The only place I see it on the dashboard in the past two years is on the plan9-amd64-9front builder, which is no longer running 1.4 as a bootstrap anyway because it was too unstable on plan9.

Given that this is in the bootstrap-built compiler, I'm not particularly concerned. This can only affect the build of Go itself, so in the extremely unlikely chance that it fails in this way, you can just build again. It's also probably impossible to debug without reproducing it.

Does anyone think this is worth debugging?

@josharian
Copy link
Contributor

This can only affect the build of Go itself, so in the extremely unlikely chance that it fails in this way, you can just build again.

Good point. Yeah, let's not debug it.

@aclements
Copy link
Member

Sounds like consensus. :)

Of course, if this does start to pop up more, we should look into it.

@bradfitz
Copy link
Contributor

Um, misc-compile-netbsd runs on Linux in a Kubernetes container and cross-compiles to NetBSD.

I'd be more concerned about this.

@bradfitz
Copy link
Contributor

Oh, Go 1.4. Maybe somebody should update the bootstrap to something newer than Go 1.4. But yeah, rare. Probably not worth worrying about.

@golang golang locked and limited conversation to collaborators Aug 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-NetBSD
Projects
None yet
Development

No branches or pull requests

6 participants