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: stackCache = 0 seems broken #17291

Closed
binarycrusader opened this issue Sep 29, 2016 · 2 comments

Comments

Projects
None yet
5 participants
@binarycrusader
Copy link
Contributor

commented Sep 29, 2016

If runtime/stack.go:stackCache = 0, various tests found in test/ will fail unexpectedly, but all tests work when stackCache = 1 on current gate tip (Solaris amd64):

# go run run.go -- cmp.go
exit status 1
0xc420026000 0xc420026000
fatal error: bad span state

runtime stack:
runtime.throw(0x472b3a, 0xe)
        /builds/srwalker/golang/go-trunk/src/runtime/panic.go:582 +0x95
runtime.stackfree(0xc420026000, 0xc4200267e0, 0x800)
        /builds/srwalker/golang/go-trunk/src/runtime/stack.go:472 +0x184
runtime.copystack(0xc4200001a0, 0x1000, 0x1)
        /builds/srwalker/golang/go-trunk/src/runtime/stack.go:910 +0x3b8
runtime.newstack()
        /builds/srwalker/golang/go-trunk/src/runtime/stack.go:1070 +0x35b
runtime.morestack()
        /builds/srwalker/golang/go-trunk/src/runtime/asm_amd64.s:366 +0x91

goroutine 1 [copystack, locked to thread]:
runtime.init.1()
        /builds/srwalker/golang/go-trunk/src/runtime/mstats.go:408 fp=0xc420032f30 sp=0xc420032f28
runtime.init()
        /builds/srwalker/golang/go-trunk/src/runtime/write_err.go:14 +0x9b fp=0xc420032f58 sp=0xc420032f30
runtime.main()
        /builds/srwalker/golang/go-trunk/src/runtime/proc.go:141 +0xf6 fp=0xc420032fb0 sp=0xc420032f58
runtime.goexit()
        /builds/srwalker/golang/go-trunk/src/runtime/asm_amd64.s:2158 +0x1 fp=0xc420032fb8 sp=0xc420032fb0
exit status 2

FAIL    cmp.go  0.735s
    1 FAIL

In fact, setting stackCache = 0 won't even let you build packages and commands for make.bash:

##### Building packages and commands for solaris/amd64.
0xc42002a000 0xc42002a000
fatal error: bad span state

runtime stack:
runtime.throw(0x6a1a21, 0xe)
        /builds/srwalker/golang/go-trunk/src/runtime/panic.go:582 +0x95
runtime.stackfree(0xc42002a000, 0xc42002a7e0, 0x800)
        /builds/srwalker/golang/go-trunk/src/runtime/stack.go:472 +0x184
runtime.copystack(0xc4200001a0, 0x1000, 0x1)
        /builds/srwalker/golang/go-trunk/src/runtime/stack.go:910 +0x3b8
runtime.newstack()
        /builds/srwalker/golang/go-trunk/src/runtime/stack.go:1070 +0x35b
runtime.morestack()
        /builds/srwalker/golang/go-trunk/src/runtime/asm_amd64.s:366 +0x91

goroutine 1 [copystack, locked to thread]:
runtime.init.1()
        /builds/srwalker/golang/go-trunk/src/runtime/mstats.go:408 fp=0xc420036f30 sp=0xc420036f28
runtime.init()
        /builds/srwalker/golang/go-trunk/src/runtime/write_err.go:14 +0x9b fp=0xc420036f58 sp=0xc420036f30
runtime.main()
        /builds/srwalker/golang/go-trunk/src/runtime/proc.go:141 +0xf6 fp=0xc420036fb0 sp=0xc420036f58
runtime.goexit()
        /builds/srwalker/golang/go-trunk/src/runtime/asm_amd64.s:2158 +0x1 fp=0xc420036fb8 sp=0xc420036fb0

I'm currently attempting to debug stack allocation issues on the sparc64 port and was hoping to use this mechanism, but when I discovered that it didn't work on amd64 either, decided a bug might be worth filing.

And yes, this is from the correct go binary in $PATH:

go version devel +c1e06dc Thu Sep 29 20:43:04 2016 +0000 solaris/amd64

The only change in the workspace is setting stackCache = 0.

@quentinmit

This comment has been minimized.

Copy link
Contributor

commented Oct 4, 2016

@quentinmit quentinmit added this to the Go1.8 milestone Oct 4, 2016

@rsc rsc modified the milestones: Go1.9, Go1.8 Nov 11, 2016

@gopherbot

This comment has been minimized.

Copy link

commented May 18, 2017

CL https://golang.org/cl/43637 mentions this issue.

@gopherbot gopherbot closed this in 4754252 May 23, 2017

@golang golang locked and limited conversation to collaborators May 23, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.