runtime: large stack makes the program hang #26154
Comments
Go 1.6 crashes with a stack overflow error, as does gccgo. Go versions after 1.6 appear to just burn CPU without allocating memory. |
It looks like you're tripping across the boundary between stack-allocating and heap-allocating
When I'm going to close as not-a-bug. Definitely odd, but I'd argue that with the heap-allocated @aclements This is kind of a weird case, where the GC is collecting a single 11MB object each iteration. Probably a larger heap goal size would be useful in situations like these (although this particular situation is contrived enough to be irrelevant).
|
Perhaps the proper solution is to solve #23044 (comment). That would happen to space out these GCs, and would mean that when they did run, the cost of marking (0.72 ms in that example) would be amortized against the less frequent GC scheduling. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?kjkmacpro:tst kjk$ go version
go version go1.10.3 darwin/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/kjk/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/kjk/src/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.10.3/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.10.3/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/v_/ksw1dqvd59v790zk2wqf_t_80000gn/T/go-build146241323=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
https://play.golang.org/p/bEhVv3kwiNr
This program never finishes.
Change the buf size to [1024 * 1024 * 10] (https://play.golang.org/p/s5sf7m0qWcu) and it'll crash with stack overflow error.
It looks like runtime is bouncing system threads:
This came as part of investigating #21382
The text was updated successfully, but these errors were encountered: