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: go1.4 "fatal error: bad pointer" #12729

Closed
akavel opened this issue Sep 23, 2015 · 4 comments
Closed

runtime: go1.4 "fatal error: bad pointer" #12729

akavel opened this issue Sep 23, 2015 · 4 comments
Milestone

Comments

@akavel
Copy link
Contributor

akavel commented Sep 23, 2015

I'm aware this is for old-ish version of Go, but thought better to report than not, you can always just close it. Highly non-deterministic, this app usually runs well, but I think I've already seen it crash in a somewhat similar way once over last 1-2 months. No "import C", no "go whatever()" in code. Generally run as a parser for go test -v (got ~20MB file as input this time), tries to split it and pass into text/template. (Actually planning to open-source the particular code soon-ish, but can't just yet.)

 $ go version
go version go1.4 linux/amd64   
 $ go env
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="[CENSORED]"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"

Actual error output:

runtime: garbage collector found invalid heap pointer *(0xc20aaadcd0+0x0)=0x1 s=nil
runtime: found *(0xc20ac0b4a0+0x8) = 0xc20aaadcd0+0x0
runtime: found *(0xc20a9eed90+0x18) = 0xc20ac0b4a0+0x0
fatal error: bad pointer

runtime stack:
runtime.throw(0x6fa0f9)
    /usr/local/go/src/runtime/panic.go:491 +0xad fp=0xc20802ba90 sp=0xc20802ba60
scanblock(0xc20a9eed90, 0x48, 0x64ea68)
    /usr/local/go/src/runtime/mgc0.c:412 +0x989 fp=0xc20802bbd0 sp=0xc20802ba90
scanframe(0xc20802bcd8, 0x0, 0x1)
    /usr/local/go/src/runtime/mgc0.c:740 +0x1c2 fp=0xc20802bc40 sp=0xc20802bbd0
runtime.gentraceback(0x438060, 0xc20a9ee690, 0x0, 0xc208000120, 0x0, 0x0, 0x7fffffff, 0xc20802bd88, 0x0, 0x0, ...)
    /usr/local/go/src/runtime/traceback.go:311 +0x7a8 fp=0xc20802bd30 sp=0xc20802bc40
scanstack(0xc208000120)
    /usr/local/go/src/runtime/mgc0.c:777 +0x21c fp=0xc20802bda0 sp=0xc20802bd30
markroot(0xc208010000, 0xc200000005)
    /usr/local/go/src/runtime/mgc0.c:553 +0xe7 fp=0xc20802be00 sp=0xc20802bda0
runtime.parfordo(0xc208010000)
    /usr/local/go/src/runtime/parfor.c:76 +0xb2 fp=0xc20802be80 sp=0xc20802be00
gc(0xc20802bfb8)
    /usr/local/go/src/runtime/mgc0.c:1439 +0x25e fp=0xc20802bf98 sp=0xc20802be80
runtime.gc_m()
    /usr/local/go/src/runtime/mgc0.c:1373 +0xf7 fp=0xc20802bfd0 sp=0xc20802bf98
runtime.onM(0xc208012000)
    /usr/local/go/src/runtime/asm_amd64.s:257 +0x68 fp=0xc20802bfd8 sp=0xc20802bfd0
runtime.mstart()
    /usr/local/go/src/runtime/proc.c:818 fp=0xc20802bfe0 sp=0xc20802bfd8

goroutine 1 [garbage collection]:
runtime.switchtoM()
    /usr/local/go/src/runtime/asm_amd64.s:198 fp=0xc20a9ee698 sp=0xc20a9ee690
runtime.gogc(0xc200000000)
    /usr/local/go/src/runtime/malloc.go:469 +0x1cf fp=0xc20a9ee6d0 sp=0xc20a9ee698
runtime.mallocgc(0x1c000, 0x5dd080, 0x0, 0xc20ada8000)
    /usr/local/go/src/runtime/malloc.go:341 +0x391 fp=0xc20a9ee780 sp=0xc20a9ee6d0
runtime.newarray(0x5dd080, 0x44e, 0x6ee8)
    /usr/local/go/src/runtime/malloc.go:365 +0xc1 fp=0xc20a9ee7b8 sp=0xc20a9ee780
runtime.growslice(0x55ce20, 0xc20ada8000, 0x227, 0x227, 0x1, 0x0, 0x0, 0x0)
    /usr/local/go/src/runtime/slice.go:87 +0x2bb fp=0xc20a9ee818 sp=0xc20a9ee7b8
main.filterCaseStatus(0x1, 0xc20ad76000, 0x348, 0x627, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/akavel/gopath/src/CENSORED/tools/go2xunit2/main.go:162 +0x17e fp=0xc20a9ee990 sp=0xc20a9ee818
runtime.call128(0x65db38, 0xc20abfad20, 0x2000000048)
    /usr/local/go/src/runtime/asm_amd64.s:404 +0x54 fp=0xc20a9eea18 sp=0xc20a9ee990
reflect.Value.call(0x5aef80, 0x65db38, 0x13, 0x5f9c30, 0x4, 0xc20ac0b4a0, 0x2, 0x2, 0x0, 0x0, ...)
    /usr/local/go/src/reflect/value.go:419 +0x10e5 fp=0xc20a9eed30 sp=0xc20a9eea18
reflect.Value.Call(0x5aef80, 0x65db38, 0x13, 0xc20ac0b4a0, 0x2, 0x2, 0x0, 0x0, 0x0)
    /usr/local/go/src/reflect/value.go:296 +0xbc fp=0xc20a9eed90 sp=0xc20a9eed30
text/template.(*state).evalCall(0xc20ac08a40, 0x56d800, 0xc20ac12020, 0x59, 0x5aef80, 0x65db38, 0x13, 0x7f4662598030, 0xc20803d230, 0xc20800f2fd, ...)
    /usr/local/go/src/text/template/exec.go:567 +0xaa4 fp=0xc20a9eef88 sp=0xc20a9eed90
text/template.(*state).evalFunction(0xc20ac08a40, 0x56d800, 0xc20ac12020, 0x59, 0xc20803d260, 0x7f4662598030, 0xc20803d230, 0xc20800a4e0, 0x2, 0x2, ...)
    /usr/local/go/src/text/template/exec.go:459 +0x33b fp=0xc20a9ef0d0 sp=0xc20a9eef88
text/template.(*state).evalCommand(0xc20ac08a40, 0x56d800, 0xc20ac12020, 0x59, 0xc20803d230, 0x55ce20, 0xc20ac0b488, 0x57, 0x0, 0x0, ...)
    /usr/local/go/src/text/template/exec.go:359 +0x210 fp=0xc20a9ef200 sp=0xc20a9ef0d0
text/template.(*state).evalPipeline(0xc20ac08a40, 0x56d800, 0xc20ac12020, 0x59, 0xc2080344b0, 0x55ce20, 0xc20ac0b488, 0x57)
    /usr/local/go/src/text/template/exec.go:332 +0x1a8 fp=0xc20a9ef3a0 sp=0xc20a9ef200
text/template.(*state).walk(0xc20ac08a40, 0x56d800, 0xc20ac12020, 0x59, 0x7f466273ad38, 0xc20803d320)
    /usr/local/go/src/text/template/exec.go:167 +0x145 fp=0xc20a9ef4f0 sp=0xc20a9ef3a0
text/template.(*state).walk(0xc20ac08a40, 0x56d800, 0xc20ac12020, 0x59, 0x7f4662597fa0, 0xc20803c960)
    /usr/local/go/src/text/template/exec.go:175 +0x862 fp=0xc20a9ef640 sp=0xc20a9ef4f0
text/template.(*Template).Execute(0xc208038440, 0x7f4662597f78, 0xc20803e008, 0x56d800, 0xc20ac12020, 0x0, 0x0)
    /usr/local/go/src/text/template/exec.go:155 +0x3f2 fp=0xc20a9ef848 sp=0xc20a9ef640
main.run(0x0, 0x0)
    /home/akavel/gopath/src/CENSORED/tools/go2xunit2/main.go:141 +0xac5 fp=0xc20a9efed0 sp=0xc20a9ef848
main.main()
    /home/akavel/gopath/src/CENSORED/tools/go2xunit2/main.go:70 +0x27 fp=0xc20a9eff98 sp=0xc20a9efed0
runtime.main()
    /usr/local/go/src/runtime/proc.go:63 +0xf3 fp=0xc20a9effe0 sp=0xc20a9eff98
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc20a9effe8 sp=0xc20a9effe0

goroutine 2 [force gc (idle)]:
runtime.gopark(0x42fe60, 0x703fc0, 0x60e670, 0xf)
    /usr/local/go/src/runtime/proc.go:130 +0x105 fp=0xc20801a798 sp=0xc20801a768
runtime.goparkunlock(0x703fc0, 0x60e670, 0xf)
    /usr/local/go/src/runtime/proc.go:136 +0x48 fp=0xc20801a7c0 sp=0xc20801a798
runtime.forcegchelper()
    /usr/local/go/src/runtime/proc.go:99 +0xce fp=0xc20801a7e0 sp=0xc20801a7c0
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc20801a7e8 sp=0xc20801a7e0
created by runtime.init·4
    /usr/local/go/src/runtime/proc.go:87 +0x25

goroutine 3 [runnable]:
runtime.gopark(0x42fe60, 0x70b7a0, 0x6084f0, 0xd)
    /usr/local/go/src/runtime/proc.go:130 +0x105 fp=0xc20801df98 sp=0xc20801df68
runtime.goparkunlock(0x70b7a0, 0x6084f0, 0xd)
    /usr/local/go/src/runtime/proc.go:136 +0x48 fp=0xc20801dfc0 sp=0xc20801df98
runtime.bgsweep()
    /usr/local/go/src/runtime/mgc0.go:98 +0xbc fp=0xc20801dfe0 sp=0xc20801dfc0
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc20801dfe8 sp=0xc20801dfe0
created by gc
    /usr/local/go/src/runtime/mgc0.c:1383

goroutine 4 [finalizer wait]:
runtime.gopark(0x42fe60, 0x70b798, 0x60e010, 0xe)
    /usr/local/go/src/runtime/proc.go:130 +0x105 fp=0xc208018f30 sp=0xc208018f00
runtime.goparkunlock(0x70b798, 0x60e010, 0xe)
    /usr/local/go/src/runtime/proc.go:136 +0x48 fp=0xc208018f58 sp=0xc208018f30
runtime.runfinq()
    /usr/local/go/src/runtime/malloc.go:727 +0xba fp=0xc208018fe0 sp=0xc208018f58
runtime.goexit()
    /usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc208018fe8 sp=0xc208018fe0
created by runtime.createfing
    /usr/local/go/src/runtime/malloc.go:707 +0x5e
@bradfitz
Copy link
Contributor

/cc @aclements

@ianlancetaylor ianlancetaylor changed the title runtime/gc: go1.4 "fatal error: bad pointer" runtime: go1.4 "fatal error: bad pointer" Sep 23, 2015
@ianlancetaylor
Copy link
Member

Have you tried this with go 1.5.1?

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Sep 23, 2015
@aclements
Copy link
Member

@akavel, it's unlikely this problem carried over to Go 1.5, but if you can test on Go 1.5, we'd love to know if it still fails. Alternatively, if you need to stay on Go 1.4 and would rather just work around this, you can set GODEBUG=invalidptr=0 to disable this self-check.

@aclements
Copy link
Member

@akavel, I'm going to go ahead and close this, but please reopen if you're able to reproduce on Go 1.5 or have additional information. Thanks!

@golang golang locked and limited conversation to collaborators Oct 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants