Skip to content

Instantly share code, notes, and snippets.

@jabley
Created August 25, 2016 13:31
Show Gist options
  • Save jabley/64a4c836361bf2fc8dc4cacb83a1f159 to your computer and use it in GitHub Desktop.
Save jabley/64a4c836361bf2fc8dc4cacb83a1f159 to your computer and use it in GitHub Desktop.
Panic when trying to debug using Go 1.7
~/gocode/src/github.com/elazarl/goproxy > dlv test
Type 'help' for list of commands.
(dlv) b https.go:376
Breakpoint 1 set at 0x85ad2 for github.com/elazarl/goproxy.TLSConfigFromCA.func1 ./https.go:376
(dlv) c
> github.com/elazarl/goproxy.TLSConfigFromCA.func1() ./https.go:376 (hits goroutine(222):1 total:1)
371: return nil
372: }
373:
374: func TLSConfigFromCA(ca *tls.Certificate) func(host string, ctx *ProxyCtx) (*tls.Config, error) {
375: return func(host string, ctx *ProxyCtx) (*tls.Config, error) {
=> 376: config := *defaultTLSConfig
377: ctx.Logf("signing for %s", stripPort(host))
378: cert, err := signHost(*ca, []string{stripPort(host)})
379: if err != nil {
380: ctx.Warnf("Cannot sign host certificate with provided CA: %s", err)
381: return nil, err
(dlv) vars
panic: runtime error: makeslice: len out of range
goroutine 52 [running]:
panic(0x4483f00, 0xc4212281f0)
/opt/boxen/homebrew/Cellar/go/1.7/libexec/src/runtime/panic.go:500 +0x1a1
github.com/derekparker/delve/proc.(*Thread).readMemory(0xc4209ee500, 0xc420094000, 0xfffffffffffffff0, 0x4014918, 0xe0, 0x44ef920, 0x4129501, 0x10)
/private/tmp/delve-20160825-24426-5u4k4r/delve-0.11.0-alpha/src/github.com/derekparker/delve/proc/threads_darwin.go:112 +0x49
github.com/derekparker/delve/proc.cacheMemory(0x4722360, 0xc421e2e540, 0xc420094000, 0xfffffffffffffff0, 0x0, 0x0)
/private/tmp/delve-20160825-24426-5u4k4r/delve-0.11.0-alpha/src/github.com/derekparker/delve/proc/mem.go:42 +0xb3
github.com/derekparker/delve/proc.(*Variable).loadArrayValues(0xc421b7d180, 0x0)
/private/tmp/delve-20160825-24426-5u4k4r/delve-0.11.0-alpha/src/github.com/derekparker/delve/proc/variables.go:938 +0x2fc
github.com/derekparker/delve/proc.(*Variable).loadValueInternal(0xc421b7d180, 0x0)
/private/tmp/delve-20160825-24426-5u4k4r/delve-0.11.0-alpha/src/github.com/derekparker/delve/proc/variables.go:744 +0x740
github.com/derekparker/delve/proc.(*Variable).loadValue(0xc421b7d180)
/private/tmp/delve-20160825-24426-5u4k4r/delve-0.11.0-alpha/src/github.com/derekparker/delve/proc/variables.go:710 +0x34
github.com/derekparker/delve/proc.(*EvalScope).extractVariableFromEntry(0xc420cbdd00, 0xc421e2e2d0, 0x0, 0x0, 0x0)
/private/tmp/delve-20160825-24426-5u4k4r/delve-0.11.0-alpha/src/github.com/derekparker/delve/proc/variables.go:499 +0x73
github.com/derekparker/delve/proc.(*EvalScope).PackageVariables(0xc420cbdd00, 0xc420cbdd00, 0x0, 0x0, 0x1, 0x38)
/private/tmp/delve-20160825-24426-5u4k4r/delve-0.11.0-alpha/src/github.com/derekparker/delve/proc/variables.go:549 +0x91
github.com/derekparker/delve/service/debugger.(*Debugger).PackageVariables(0xc420071830, 0x4303, 0x0, 0x0, 0x0, 0x20, 0x20, 0xc420041a98, 0x40153e5)
/private/tmp/delve-20160825-24426-5u4k4r/delve-0.11.0-alpha/src/github.com/derekparker/delve/service/debugger/debugger.go:395 +0xfd
github.com/derekparker/delve/service/rpc.(*RPCServer).ListPackageVars(0xc4200f1360, 0x0, 0x0, 0xc420751ae0, 0x0, 0x0)
/private/tmp/delve-20160825-24426-5u4k4r/delve-0.11.0-alpha/src/github.com/derekparker/delve/service/rpc/server.go:180 +0x85
reflect.Value.call(0xc4209ac600, 0xc420084178, 0x13, 0x44ff550, 0x4, 0xc421f63ec0, 0x3, 0x3, 0x400973e, 0x401287b, ...)
/opt/boxen/homebrew/Cellar/go/1.7/libexec/src/reflect/value.go:434 +0x5c8
reflect.Value.Call(0xc4209ac600, 0xc420084178, 0x13, 0xc421f63ec0, 0x3, 0x3, 0x4009bbb, 0xc4207d6058, 0x0)
/opt/boxen/homebrew/Cellar/go/1.7/libexec/src/reflect/value.go:302 +0xa4
net/rpc.(*service).call(0xc4208130c0, 0xc420813080, 0xc42099fbc0, 0xc420171400, 0xc4209e84c0, 0x445ba00, 0xc420b3dea0, 0x198, 0x4440a60, 0xc420751ae0, ...)
/opt/boxen/homebrew/Cellar/go/1.7/libexec/src/net/rpc/server.go:383 +0x148
created by net/rpc.(*Server).ServeCodec
/opt/boxen/homebrew/Cellar/go/1.7/libexec/src/net/rpc/server.go:477 +0x421
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment