Skip to content

Instantly share code, notes, and snippets.

@pciet
pciet / gist:7faa58cc143c1bfcab4f3d27f07af709
Created November 16, 2017 18:04
wichess: fatal error: sweep increased allocation count (https://github.com/pciet/wichess/issues/19)
runtime: nelems=512 nalloc=34 previous allocCount=33 nfreed=65535
fatal error: sweep increased allocation count
runtime stack:
runtime.throw(0x840ca2, 0x20)
/usr/local/go/src/runtime/panic.go:605 +0x95
runtime.(*mspan).sweep(0x7fda09d7b8e8, 0x7fda09d7b801, 0x0)
/usr/local/go/src/runtime/mgcsweep.go:298 +0x911
runtime.(*mcentral).cacheSpan(0xa6be90, 0x7fda09dc6030)
/usr/local/go/src/runtime/mcentral.go:58 +0x2cd
runtime: marking free object 0xc42060bbc0 found at *(0x0+0x0)
base=0x0 is not in the Go heap
obj=0xc42060bbc0 k=0x6210305 s.base()=0xc42060a000 s.limit=0xc42060c000 s.spanclass=6 s.elemsize=32 s.state=_MSpanInUse
*(obj+0) = 0xc4204522c0
*(obj+8) = 0x0
*(obj+16) = 0x1
*(obj+24) = 0x1
fatal error: marking free object
runtime stack:
http: panic serving [::1]:62998: runtime error: invalid memory address or nil pointer dereference
goroutine 771 [running]:
net/http.(*conn).serve.func1(0xc420088f00)
/usr/local/go/src/net/http/server.go:1697 +0xd0
panic(0x13bbe60, 0x164a3e0)
/usr/local/go/src/runtime/panic.go:491 +0x283
github.com/pciet/wichess/wichessing.Board.ActualPaths(0xc4203b8de0, 0x0, 0xc4203b8e10, 0x1, 0xc4203b8e40, 0x2, 0xc4203b8e70, 0x3, 0xc4203b8ea0, 0x4, ...)
/Users/aftermatt/Code/src/github.com/pciet/wichess/wichessing/board_moves.go:402 +0x209
github.com/pciet/wichess/wichessing.Board.MovesFromPoint(0xc4203b8de0, 0x0, 0xc4203b8e10, 0x1, 0xc4203b8e40, 0x2, 0xc4203b8e70, 0x3, 0xc4203b8ea0, 0x4, ...)
/Users/aftermatt/Code/src/github.com/pciet/wichess/wichessing/board_moves.go:215 +0x708
@pciet
pciet / gist:8189ffbb66bc46025186ceebccf2f6d6
Created November 18, 2017 19:54
go1.9.2 darwin/amd64 golang/go#22781 8 client
runtime: nelems=256 nalloc=126 previous allocCount=125 nfreed=65535
fatal error: sweep increased allocation count
runtime stack:
runtime.throw(0x143954b, 0x20)
/usr/local/go/src/runtime/panic.go:605 +0x95 fp=0x700008a95cf0 sp=0x700008a95cd0 pc=0x102be55
runtime.(*mspan).sweep(0x1a09690, 0x1a09601, 0x0)
/usr/local/go/src/runtime/mgcsweep.go:298 +0x911 fp=0x700008a95dc0 sp=0x700008a95cf0 pc=0x1021551
runtime.(*mcentral).cacheSpan(0x1661a90, 0xc420022560)
/usr/local/go/src/runtime/mcentral.go:58 +0x2cd fp=0x700008a95e08 sp=0x700008a95dc0 pc=0x101671d
@pciet
pciet / gist:8c2b29c07fd548254b1bc3b02984a0ba
Last active November 18, 2017 20:08
go1.9.2 darwin/amd64 golang/go#22781 6 client
runtime: nelems=256 nalloc=226 previous allocCount=225 nfreed=65535
fatal error: sweep increased allocation count
runtime stack:
runtime.throw(0x143954b, 0x20)
/usr/local/go/src/runtime/panic.go:605 +0x95 fp=0x700001700cf0 sp=0x700001700cd0 pc=0x102be55
runtime.(*mspan).sweep(0x1c073b8, 0x1c07301, 0x0)
/usr/local/go/src/runtime/mgcsweep.go:298 +0x911 fp=0x700001700dc0 sp=0x700001700cf0 pc=0x1021551
runtime.(*mcentral).cacheSpan(0x1661a90, 0x1c11008)
/usr/local/go/src/runtime/mcentral.go:58 +0x2cd fp=0x700001700e08 sp=0x700001700dc0 pc=0x101671d
==================
WARNING: DATA RACE
Read at 0x00c42045c278 by goroutine 11:
github.com/pciet/debuggo22781/wichessing.Board.ActualPaths()
/Users/aftermatt/Code/src/github.com/pciet/debuggo22781/wichessing/board_moves.go:498 +0x230b
github.com/pciet/debuggo22781/wichessing.Board.MovesFromPoint()
/Users/aftermatt/Code/src/github.com/pciet/debuggo22781/wichessing/board_moves.go:215 +0x9bd
github.com/pciet/debuggo22781/wichessing.Board.Moves()
/Users/aftermatt/Code/src/github.com/pciet/debuggo22781/wichessing/board_moves.go:23 +0x2e5
main.simulateClient()
@pciet
pciet / gist:8ad292c81bdae9046bf5484797b333f2
Last active November 20, 2017 21:44
debuggo22781 TruncatedAbsPathsForKind crash
runtime: nelems=170 nalloc=2 previous allocCount=1 nfreed=65535
fatal error: sweep increased allocation count
runtime stack:
runtime.throw(0x11305ff, 0x20)
/usr/local/go/src/runtime/panic.go:605 +0x95 fp=0x700002848ba8 sp=0x700002848b88 pc=0x10543b5
runtime.(*mspan).sweep(0x1fc3900, 0x1fc3900, 0x32c8ffffffff)
/usr/local/go/src/runtime/mgcsweep.go:298 +0xa6a fp=0x700002848cc0 sp=0x700002848ba8 pc=0x1049cfa
runtime.sweepone(0x11cafd0)
/usr/local/go/src/runtime/mgcsweep.go:113 +0x123 fp=0x700002848d28 sp=0x700002848cc0 pc=0x1048eb3
runtime: nelems=256 nalloc=7 previous allocCount=6 nfreed=65535
fatal error: sweep increased allocation count
runtime stack:
runtime.throw(0x11305ff, 0x20)
/usr/local/go/src/runtime/panic.go:605 +0x95 fp=0x700005f9eba8 sp=0x700005f9eb88 pc=0x10543b5
runtime.(*mspan).sweep(0x1e93088, 0x1e93000, 0x10381c8)
/usr/local/go/src/runtime/mgcsweep.go:298 +0xa6a fp=0x700005f9ecc0 sp=0x700005f9eba8 pc=0x1049cfa
runtime.sweepone(0x700005f9ed50)
/usr/local/go/src/runtime/mgcsweep.go:113 +0x123 fp=0x700005f9ed28 sp=0x700005f9ecc0 pc=0x1048eb3
@pciet
pciet / gist:6874c1af77eb41e9f135de2e29332389
Created December 8, 2017 14:38
wichess load test deadlock stack trace
goroutine 1203036 [running]:
runtime/pprof.writeGoroutineStacks(0x88ef40, 0xc423402000, 0x411ee9, 0xc420a4c2a0)
/home/pciet/sdk/go1.10beta1/src/runtime/pprof/pprof.go:648 +0xa7
runtime/pprof.writeGoroutine(0x88ef40, 0xc423402000, 0x2, 0xc42035e800, 0xc420267ad0)
/home/pciet/sdk/go1.10beta1/src/runtime/pprof/pprof.go:637 +0x44
runtime/pprof.(*Profile).WriteTo(0xa73d80, 0x88ef40, 0xc423402000, 0x2, 0xc423402000, 0x42bd04)
/home/pciet/sdk/go1.10beta1/src/runtime/pprof/pprof.go:310 +0x3d0
net/http/pprof.handler.ServeHTTP(0xc420694041, 0x9, 0x892240, 0xc423402000, 0xc421e74200)
/home/pciet/sdk/go1.10beta1/src/net/http/pprof/pprof.go:237 +0x19a
net/http/pprof.Index(0x892240, 0xc423402000, 0xc421e74200)
@pciet
pciet / gist:37b16e06ac41cfbe959c2fe6ba217a05
Created December 8, 2017 14:42
deadlock during load test excerpt
(client49) POST http://192.168.0.104:8080/competitive15: {"assignments":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}
(client34) RECV DIFF: map[0-0:(5 white) 2-1:(0 white)]
(client34) GET http://192.168.0.104:8080/moves/262?Turn=198
(client24) WAIT DIFF
(client24) RECV DIFF: map[1-3:(1 black) 2-2:(0 white)]
(client24) GET http://192.168.0.104:8080/moves/253?Turn=202
(client46) RECV DIFF: map[1-6:(30 black) 2-7:(0 white)]
(client46) GET http://192.168.0.104:8080/moves/284?Turn=62
(client40) POST 0-1 0-0 http://192.168.0.104:8080/move/247
(client67) GET http://192.168.0.104:8080/moves/266?Turn=115