-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed as not planned
Closed as not planned
Copy link
Labels
Milestone
Description
What version of Go are you using (go version)?
Tested on 1.7.3, and on tip:
go version devel +b21743c Thu Nov 17 20:53:01 2016 +0000 darwin/amd64
What operating system and processor architecture are you using (go env)?
OS X El Capitan 10.11.6
go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/jnj"
GORACE=""
GOROOT="/Users/jnj/src/go"
GOTOOLDIR="/Users/jnj/src/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/jd/y9ctzjjx7278y6_lvtvgtb0m0000gn/T/go-build268919578=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
What did you do?
I was running into this issue with some window resize handling code, but this crash seems to be related to allocating textures and buffers. Here is a minimal reproducer (if I remove any of the NewBuffer or NewTexture calls, or remove win.Publish(), the program exits successfully).
https://play.golang.org/p/vsmjMKZ0-H
What did you expect to see?
Either the program successfully exits, or prints a reasonable error message.
What did you see instead?
On Go 1.7.3, the program prints "published" and then hangs indefinitely. On tip, the program prints "published" and then crashes:
published
runtime: pointer 0xc420049ea0 to unallocated span idx=0x24 span.base()=0xc420044000 span.limit=0x0 span.state=3
runtime: found in object at *(0xc420035e70+0x8)
object=0xc420035e70 k=0x621001a s.base()=0xc420034000 s.limit=0x0 s.sizeclass=0 s.elemsize=0 s.state=_MSpanStack
*(object+0) = 0x40b74c0
*(object+8) = 0xc420049ea0 <==
fatal error: found bad pointer in Go heap (incorrect use of unsafe or cgo?)
runtime stack:
runtime.throw(0x40fe5f4, 0x3e)
/Users/jnj/src/go/src/runtime/panic.go:596 +0x95
runtime.heapBitsForObject(0xc420049ea0, 0xc420035e70, 0x8, 0x417bba0, 0x0, 0x700000209748, 0x4043b39, 0x4111858)
/Users/jnj/src/go/src/runtime/mbitmap.go:433 +0x2bb
runtime.scanblock(0xc420035e70, 0x18, 0x4100866, 0xc42001f828)
/Users/jnj/src/go/src/runtime/mgcmark.go:1192 +0xea
runtime.scanframeworker(0x700000209a68, 0x700000209b58, 0xc42001f828)
/Users/jnj/src/go/src/runtime/mgcmark.go:917 +0xfc
runtime.scanstack.func1(0x700000209a68, 0x0, 0x700000209901)
/Users/jnj/src/go/src/runtime/mgcmark.go:811 +0x6e
runtime.gentraceback(0xffffffffffffffff, 0xc420035e30, 0x0, 0xc4200001a0, 0x0, 0x0, 0x7fffffff, 0x700000209c58, 0x0, 0x0, ...)
/Users/jnj/src/go/src/runtime/traceback.go:378 +0x1085
runtime.scanstack(0xc4200001a0, 0xc42001f828)
/Users/jnj/src/go/src/runtime/mgcmark.go:834 +0x265
runtime.scang(0xc4200001a0, 0xc42001f828)
/Users/jnj/src/go/src/runtime/proc.go:851 +0x209
runtime.markroot.func1()
/Users/jnj/src/go/src/runtime/mgcmark.go:256 +0x6d
runtime.systemstack(0x700000209d90)
/Users/jnj/src/go/src/runtime/asm_amd64.s:330 +0xab
runtime.markroot(0xc42001f828, 0x5)
/Users/jnj/src/go/src/runtime/mgcmark.go:261 +0x1d5
runtime.gcDrainN(0xc42001f828, 0x10000, 0x402e558)
/Users/jnj/src/go/src/runtime/mgcmark.go:1139 +0xee
runtime.gcAssistAlloc1(0xc420001ba0, 0x10000)
/Users/jnj/src/go/src/runtime/mgcmark.go:537 +0x127
runtime.gcAssistAlloc.func1()
/Users/jnj/src/go/src/runtime/mgcmark.go:451 +0x33
runtime.systemstack(0xc42001e600)
/Users/jnj/src/go/src/runtime/asm_amd64.s:314 +0x79
runtime.mstart()
/Users/jnj/src/go/src/runtime/proc.go:1102
goroutine 5 [GC assist marking]:
runtime.systemstack_switch()
/Users/jnj/src/go/src/runtime/asm_amd64.s:268 fp=0xc420039d58 sp=0xc420039d50
runtime.gcAssistAlloc(0xc420001ba0)
/Users/jnj/src/go/src/runtime/mgcmark.go:454 +0x13b fp=0xc420039d98 sp=0xc420039d58
runtime.mallocgc(0x68, 0x40e1f60, 0xc420396001, 0xa)
/Users/jnj/src/go/src/runtime/malloc.go:577 +0x9ca fp=0xc420039e38 sp=0xc420039d98
runtime.newobject(0x40e1f60, 0x300000)
/Users/jnj/src/go/src/runtime/malloc.go:801 +0x38 fp=0xc420039e68 sp=0xc420039e38
golang.org/x/exp/shiny/driver/gldriver.(*screenImpl).NewBuffer(0x418d7e0, 0x400, 0x300, 0xa, 0x0, 0x0, 0x0)
/Users/jnj/src/golang.org/x/exp/shiny/driver/gldriver/screen.go:47 +0xe5 fp=0xc420039ef8 sp=0xc420039e68
main.main.func1(0x4177a00, 0x418d7e0)
/Users/jnj/tmp/main.go:48 +0x3e4 fp=0xc420039fc0 sp=0xc420039ef8
golang.org/x/exp/shiny/driver/gldriver.driverStarted.func1()
/Users/jnj/src/golang.org/x/exp/shiny/driver/gldriver/cocoa.go:105 +0x40 fp=0xc420039fe0 sp=0xc420039fc0
runtime.goexit()
/Users/jnj/src/go/src/runtime/asm_amd64.s:2184 +0x1 fp=0xc420039fe8 sp=0xc420039fe0
created by golang.org/x/exp/shiny/driver/gldriver.driverStarted
/Users/jnj/src/golang.org/x/exp/shiny/driver/gldriver/cocoa.go:107 +0x35
goroutine 1 [syscall (scan), locked to thread]:
golang.org/x/exp/shiny/driver/gldriver._Cfunc_startDriver()
golang.org/x/exp/shiny/driver/gldriver/_obj/_cgo_gotypes.go:281 +0x41
golang.org/x/exp/shiny/driver/gldriver.main(0x40fefe8, 0x0, 0xc420049f68)
/Users/jnj/src/golang.org/x/exp/shiny/driver/gldriver/cocoa.go:98 +0x51
golang.org/x/exp/shiny/driver/gldriver.Main(0x40fefe8)
/Users/jnj/src/golang.org/x/exp/shiny/driver/gldriver/gldriver.go:26 +0x2f
golang.org/x/exp/shiny/driver.main(0x40fefe8)
/Users/jnj/src/golang.org/x/exp/shiny/driver/driver_darwin.go:15 +0x2b
golang.org/x/exp/shiny/driver.Main(0x40fefe8)
/Users/jnj/src/golang.org/x/exp/shiny/driver/driver.go:24 +0x2b
main.main()
/Users/jnj/tmp/main.go:52 +0x2d
goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/Users/jnj/src/go/src/runtime/asm_amd64.s:2184 +0x1
goroutine 6 [select, locked to thread]:
golang.org/x/exp/shiny/driver/gldriver.drawLoop(0xc420080000, 0x1)
/Users/jnj/src/golang.org/x/exp/shiny/driver/gldriver/cocoa.go:153 +0x2b9
created by golang.org/x/exp/shiny/driver/gldriver.preparedOpenGL
/Users/jnj/src/golang.org/x/exp/shiny/driver/gldriver/cocoa.go:83 +0xf4
exit status 2
Reactions are currently unavailable