go-delve / delve

Delve is a debugger for the Go programming language.
MIT License
22.99k stars 2.14k forks source link

Error when running debugger #924

Closed ignatov closed 7 years ago

ignatov commented 7 years ago

Cross post from https://youtrack.jetbrains.com/issue/GO-4132

GO-171.4694.61, JRE 1.8.0_112-release-736-b21x64 JetBrains s.r.o, OS Mac OS X(x86_64) v10.12.5 unknown, screens 1920x1080, 1440x900; Retina

I got this error message when trying debug some app

2017-07-14 14:01:04,979 [ 291487] INFO - #com.goide.dlv.DlvDebugProcess - Internal debugger error: interface conversion: dwarf.Type is dwarf.VoidType, not dwarf.StructType runtime.call32 (0x4054318) /Users/builduser/buildAgent/work/b97f8195591f35ac/go/src/runtime/asm_amd64.s:514 runtime.gopanic (0x402ab0f) /Users/builduser/buildAgent/work/b97f8195591f35ac/go/src/runtime/panic.go:489 runtime.panicdottype (0x400f171) /Users/builduser/buildAgent/work/b97f8195591f35ac/go/src/runtime/iface.go:172 github.com/derekparker/delve/pkg/proc.(Variable).loadInterface (0x428d484) /Users/builduser/buildAgent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/pkg/proc/variables.go:1542 github.com/derekparker/delve/pkg/proc.(Variable).loadValueInternal (0x42873dd) /Users/builduser/buildAgent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/pkg/proc/variables.go:860 github.com/derekparker/delve/pkg/proc.(Variable).loadValueInternal (0x4286dbc) /Users/builduser/buildAgent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/pkg/proc/variables.go:855 github.com/derekparker/delve/pkg/proc.(Variable).loadValue (0x4286a2b) /Users/builduser/buildAgent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/pkg/proc/variables.go:790 github.com/derekparker/delve/pkg/proc.(EvalScope).variablesByTag (0x428d937) /Users/builduser/buildAgent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/pkg/proc/variables.go:1722 github.com/derekparker/delve/pkg/proc.(EvalScope).LocalVariables (0x4285131) /Users/builduser/buildAgent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/pkg/proc/variables.go:612 github.com/derekparker/delve/service/debugger.(Debugger).convertStacktrace (0x42e9e9c) /Users/builduser/buildAgent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/service/debugger/debugger.go:860 github.com/derekparker/delve/service/debugger.(Debugger).Stacktrace (0x42e994c) /Users/builduser/buildAgent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/service/debugger/debugger.go:850 github.com/derekparker/delve/service/rpc2.(RPCServer).Stacktrace (0x449ec0a) /Users/builduser/buildAgent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/service/rpc2/server.go:162 runtime.call64 (0x4054398) /Users/builduser/buildAgent/work/b97f8195591f35ac/go/src/runtime/asm_amd64.s:515 reflect.Value.call (0x40abcff) /Users/builduser/buildAgent/work/b97f8195591f35ac/go/src/reflect/value.go:434 reflect.Value.Call (0x40ab2c4) /Users/builduser/buildAgent/work/b97f8195591f35ac/go/src/reflect/value.go:302 github.com/derekparker/delve/service/rpccommon.(ServerImpl).serveJSONCodec.func1 (0x44a76fe) /Users/builduser/buildAgent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/service/rpccommon/server.go:300 github.com/derekparker/delve/service/rpccommon.(*ServerImpl).serveJSONCodec (0x44a610d) /Users/builduser/buildAgent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/service/rpccommon/server.go:302 runtime.goexit (0x4056ab1) /Users/builduser/buildAgent/work/b97f8195591f35ac/go/src/runtime/asm_amd64.s:2197

aarzilli commented 7 years ago

What version of go? Is it possible to get our hands on the executable produced by dlv debug or to see the output of GNU objdump on it?

aarzilli commented 7 years ago

No user feedback.

ignatov commented 7 years ago

It's Mac OS according to the logs

2017-07-14 13:56:13,501 [      9]   INFO -        #com.intellij.idea.Main - OS: Mac OS X (10.12.5, x86_64) 

https://youtrack.jetbrains.com/issue/GO-4132

aarzilli commented 7 years ago

it could be caused by this https://github.com/golang/go/issues/22068

zolotov commented 6 years ago

@aarzilli looks like the issue is still actual. Here are the details of yet another report. Could you please take a look?

Delve version: https://github.com/derekparker/delve/commit/480fc02d507c96f1ff939254d687e946a2642290

Project: http://github.com/ethereum/go-ethereum/ Go: 1.9.3 Debugging go-ethereum/cmd/geth package OS: Mac OS X (10.13.2, x86_64) Backend: default

The result:

Internal debugger error: interface conversion: godwarf.Type is *godwarf.VoidType, not *godwarf.StructType
runtime.call32 (0x405753a)
    /opt/teamcity-agent/work/b97f8195591f35ac/go/src/runtime/asm_amd64.s:509
runtime.gopanic (0x402ba02)
    /opt/teamcity-agent/work/b97f8195591f35ac/go/src/runtime/panic.go:491
runtime.panicdottypeE (0x4010356)
    /opt/teamcity-agent/work/b97f8195591f35ac/go/src/runtime/iface.go:172
runtime.panicdottypeI (0x40103b7)
    /opt/teamcity-agent/work/b97f8195591f35ac/go/src/runtime/iface.go:182
github.com/derekparker/delve/pkg/proc.(*Variable).loadInterface (0x4297c5d)
    /opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/pkg/proc/variables.go:1634
github.com/derekparker/delve/pkg/proc.(*Variable).loadValueInternal (0x42911b4)
    /opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/pkg/proc/variables.go:889
github.com/derekparker/delve/pkg/proc.(*Variable).loadValueInternal (0x4290a34)
    /opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/pkg/proc/variables.go:884
github.com/derekparker/delve/pkg/proc.(*Variable).loadValueInternal (0x4290e45)
    /opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/pkg/proc/variables.go:839
github.com/derekparker/delve/pkg/proc.(*Variable).loadValue (0x42907fa)
    /opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/pkg/proc/variables.go:819
github.com/derekparker/delve/pkg/proc.(*EvalScope).variablesByTag (0x4298ce7)
    /opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/pkg/proc/variables.go:1952
github.com/derekparker/delve/pkg/proc.(*EvalScope).LocalVariables (0x428e80c)
    /opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/pkg/proc/variables.go:610
github.com/derekparker/delve/service/debugger.(*Debugger).LocalVariables (0x430cb68)
    /opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/service/debugger/debugger.go:753
github.com/derekparker/delve/service/rpc2.(*RPCServer).ListLocalVars (0x44a8050)
    /opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/service/rpc2/server.go:373
runtime.call128 (0x4057651)
    /opt/teamcity-agent/work/b97f8195591f35ac/go/src/runtime/asm_amd64.s:511
reflect.Value.call (0x40b02c5)
    /opt/teamcity-agent/work/b97f8195591f35ac/go/src/reflect/value.go:434
reflect.Value.Call (0x40af8a3)
    /opt/teamcity-agent/work/b97f8195591f35ac/go/src/reflect/value.go:302
github.com/derekparker/delve/service/rpccommon.(*ServerImpl).serveJSONCodec.func1 (0x44af80d)
    /opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/service/rpccommon/server.go:299
github.com/derekparker/delve/service/rpccommon.(*ServerImpl).serveJSONCodec (0x44ae38d)
    /opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/service/rpccommon/server.go:301
runtime.goexit (0x4059d60)
    /opt/teamcity-agent/work/b97f8195591f35ac/go/src/runtime/asm_amd64.s:2337

Here is IDE/Delve conversation:

Start Dlv debug process with `--backend=default` 
2018-01-31 08:12:38,807 [41289135]  DEBUG -           #com.goide.dlv.DlvVm - OUT: {"method":"RPCServer.CreateBreakpoint","params":[{"Breakpoint":{"file":"/Users/gil/go/src/github.com/ethereum/go-ethereum/cmd/geth/main.go","line":213,"Cond":null}}],"id":1} 
2018-01-31 08:12:38,808 [41289136]  DEBUG -           #com.goide.dlv.DlvVm - OUT: {"method":"RPCServer.Command","params":[{"Name":"continue"}],"id":2} 
2018-01-31 08:12:39,097 [41289425]  DEBUG -           #com.goide.dlv.DlvVm - IN: {"id":1,"result":{"Breakpoint":{"id":1,"name":"","addr":79610335,"file":"/Users/gil/go/src/github.com/ethereum/go-ethereum/cmd/geth/main.go","line":213,"functionName":"main.geth","Cond":"","continue":false,"goroutine":false,"stacktrace":0,"LoadArgs":null,"LoadLocals":null,"hitCount":{},"totalHitCount":0}},"error":null} 
2018-01-31 08:12:39,211 [41289539]  DEBUG -           #com.goide.dlv.DlvVm - IN: {"id":2,"result":{"State":{"currentThread":{"id":322012,"pc":79610335,"file":"/Users/gil/go/src/github.com/ethereum/go-ethereum/cmd/geth/main.go","line":213,"function":{"name":"main.geth","value":79610320,"type":0,"goType":0,"optimized":true},"goroutineID":1,"breakPoint":{"id":1,"name":"","addr":79610335,"file":"/Users/gil/go/src/github.com/ethereum/go-ethereum/cmd/geth/main.go","line":213,"functionName":"main.geth","Cond":"","continue":false,"goroutine":false,"stacktrace":0,"LoadArgs":null,"LoadLocals":null,"hitCount":{"1":1},"totalHitCount":1},"breakPointInfo":{}},"currentGoroutine":{"id":1,"currentLoc":{"pc":79610335,"file":"/Users/gil/go/src/github.com/ethereum/go-ethereum/cmd/geth/main.go","line":213,"function":{"name":"main.geth","value":79610320,"type":0,"goType":0,"optimized":true}},"userCurrentLoc":{"pc":79610335,"file":"/Users/gil/go/src/github.com/ethereum/go-ethereum/cmd/geth/main.go","line":213,"function":{"name":"main.geth","value":79610320,"type":0,"goType":0,"optimized":true}},"goStatementLoc":{"pc":67510042,"file":"/usr/local/go/src/runtime/asm_amd64.s","line":182,"function":{"name":"runtime.rt0_go","value":67509536,"type":0,"goType":0,"optimized":true}},"threadID":322012},"Threads":[{"id":322015,"pc":67526795,"file":"/usr/local/go/src/runtime/sys_darwin_amd64.s","line":445,"function":{"name":"runtime.mach_semaphore_wait","value":67526784,"type":0,"goType":0,"optimized":true},"goroutineID":0,"breakPointInfo":null},{"id":322009,"pc":67526795,"file":"/usr/local/go/src/runtime/sys_darwin_amd64.s","line":445,"function":{"name":"runtime.mach_semaphore_wait","value":67526784,"type":0,"goType":0,"optimized":true},"goroutineID":0,"breakPointInfo":null},{"id":322010,"pc":67526795,"file":"/usr/local/go/src/runtime/sys_darwin_amd64.s","line":445,"function":{"name":"runtime.mach_semaphore_wait","value":67526784,"type":0,"goType":0,"optimized":true},"goroutineID":0,"breakPointInfo":null},{"id":322012,"pc":79610335,"file":"/Users/gil/go/src/github.com/ethereum/go-ethereum/cmd/geth/main.go","line":213,"function":{"name":"main.geth","value":79610320,"type":0,"goType":0,"optimized":true},"goroutineID":1,"breakPoint":{"id":1,"name":"","addr":79610335,"file":"/Users/gil/go/src/github.com/ethereum/go-ethereum/cmd/geth/main.go","line":213,"functionName":"main.geth","Cond":"","continue":false,"goroutine":false,"stacktrace":0,"LoadArgs":null,"LoadLocals":null,"hitCount":{"1":1},"totalHitCount":1},"breakPointInfo":{}},{"id":322014,"pc":67526795,"file":"/usr/local/go/src/runtime/sys_darwin_amd64.s","line":445,"function":{"name":"runtime.mach_semaphore_wait","value":67526784,"type":0,"goType":0,"optimized":true},"goroutineID":0,"breakPointInfo":null},{"id":322002,"pc":67526819,"file":"/usr/local/go/src/runtime/sys_darwin_amd64.s","line":455,"function":{"name":"runtime.mach_semaphore_timedwait","value":67526800,"type":0,"goType":0,"optimized":true},"goroutineID":0,"breakPointInfo":null},{"id":322004,"pc":140735105591234,"file":"","line":0,"goroutineID":0,"breakPointInfo":null},{"id":322005,"pc":67526795,"file":"/usr/local/go/src/runtime/sys_darwin_amd64.s","line":445,"function":{"name":"runtime.mach_semaphore_wait","value":67526784,"type":0,"goType":0,"optimized":true},"goroutineID":0,"breakPointInfo":null},{"id":322013,"pc":67526795,"file":"/usr/local/go/src/runtime/sys_darwin_amd64.s","line":445,"function":{"name":"runtime.mach_semaphore_wait","value":67526784,"type":0,"goType":0,"optimized":true},"goroutineID":0,"breakPointInfo":null},{"id":321955,"pc":67526795,"file":"/usr/local/go/src/runtime/sys_darwin_amd64.s","line":445,"function":{"name":"runtime.mach_semaphore_wait","value":67526784,"type":0,"goType":0,"optimized":true},"goroutineID":0,"breakPointInfo":null},{"id":322001,"pc":67526502,"file":"/usr/local/go/src/runtime/sys_darwin_amd64.s","line":323,"function":{"name":"runtime.usleep","value":67526448,"type":0,"goType":0,"optimized":true},"goroutineID":0,"breakPointInfo":null},{"id":322007,"pc":140735105631586,"file":"","line":0,"goroutineID":0,"breakPointInfo":null},{"id":322008,"pc":0,"file":"","line":0,"goroutineID":0,"breakPointInfo":null},{"id":322003,"pc":67526795,"file":"/usr/local/go/src/runtime/sys_darwin_amd64.s","line":445,"function":{"name":"runtime.mach_semaphore_wait","value":67526784,"type":0,"goType":0,"optimized":true},"goroutineID":0,"breakPointInfo":null},{"id":322006,"pc":140735105631586,"file":"","line":0,"goroutineID":0,"breakPointInfo":null}],"NextInProgress":false,"exited":false,"exitStatus":0,"When":""}},"error":null} 
2018-01-31 08:12:39,216 [41289544]  DEBUG -           #com.goide.dlv.DlvVm - OUT: {"method":"RPCServer.ListLocalVars","params":[{"Scope":{"GoroutineID":-1,"Frame":0},"Cfg":{"FollowPointers":true,"MaxStructFields":-1,"MaxVariableRecurse":3,"MaxStringLen":100,"MaxArrayValues":100}}],"id":3} 
2018-01-31 08:12:39,218 [41289546]  DEBUG -           #com.goide.dlv.DlvVm - OUT: {"method":"RPCServer.Stacktrace","params":[{"Id":-1,"Depth":50,"Full":true}],"id":4} 
2018-01-31 08:12:39,256 [41289584]  DEBUG -           #com.goide.dlv.DlvVm - IN: {"id":3,"result":null,"error":"Internal debugger error: interface conversion: godwarf.Type is *godwarf.VoidType, not *godwarf.StructType\nruntime.call32 (0x405753a)\n\t/opt/teamcity-agent/work/b97f8195591f35ac/go/src/runtime/asm_amd64.s:509\nruntime.gopanic (0x402ba02)\n\t/opt/teamcity-agent/work/b97f8195591f35ac/go/src/runtime/panic.go:491\nruntime.panicdottypeE (0x4010356)\n\t/opt/teamcity-agent/work/b97f8195591f35ac/go/src/runtime/iface.go:172\nruntime.panicdottypeI (0x40103b7)\n\t/opt/teamcity-agent/work/b97f8195591f35ac/go/src/runtime/iface.go:182\ngithub.com/derekparker/delve/pkg/proc.(*Variable).loadInterface (0x4297c5d)\n\t/opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/pkg/proc/variables.go:1634\ngithub.com/derekparker/delve/pkg/proc.(*Variable).loadValueInternal (0x42911b4)\n\t/opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/pkg/proc/variables.go:889\ngithub.com/derekparker/delve/pkg/proc.(*Variable).loadValueInternal (0x4290a34)\n\t/opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/pkg/proc/variables.go:884\ngithub.com/derekparker/delve/pkg/proc.(*Variable).loadValueInternal (0x4290e45)\n\t/opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/pkg/proc/variables.go:839\ngithub.com/derekparker/delve/pkg/proc.(*Variable).loadValue (0x42907fa)\n\t/opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/pkg/proc/variables.go:819\ngithub.com/derekparker/delve/pkg/proc.(*EvalScope).variablesByTag (0x4298ce7)\n\t/opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/pkg/proc/variables.go:1952\ngithub.com/derekparker/delve/pkg/proc.(*EvalScope).LocalVariables (0x428e80c)\n\t/opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/pkg/proc/variables.go:610\ngithub.com/derekparker/delve/service/debugger.(*Debugger).LocalVariables (0x430cb68)\n\t/opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/service/debugger/debugger.go:753\ngithub.com/derekparker/delve/service/rpc2.(*RPCServer).ListLocalVars (0x44a8050)\n\t/opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/service/rpc2/server.go:373\nruntime.call128 (0x4057651)\n\t/opt/teamcity-agent/work/b97f8195591f35ac/go/src/runtime/asm_amd64.s:511\nreflect.Value.call (0x40b02c5)\n\t/opt/teamcity-agent/work/b97f8195591f35ac/go/src/reflect/value.go:434\nreflect.Value.Call (0x40af8a3)\n\t/opt/teamcity-agent/work/b97f8195591f35ac/go/src/reflect/value.go:302\ngithub.com/derekparker/delve/service/rpccommon.(*ServerImpl).serveJSONCodec.func1 (0x44af80d)\n\t/opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/service/rpccommon/server.go:299\ngithub.com/derekparker/delve/service/rpccommon.(*ServerImpl).serveJSONCodec (0x44ae38d)\n\t/opt/teamcity-agent/work/b97f8195591f35ac/gopath/src/github.com/derekparker/delve/service/rpccommon/server.go:301\nruntime.goexit (0x4059d60)\n\t/opt/teamcity-agent/work/b97f8195591f35ac/go/src/runtime/asm_amd64.s:2337\n"} 
aarzilli commented 6 years ago

I still think this is caused by golang/go#22068 to be persuaded otherwise I would have to either have it reproduced on 1.10 or to see the output binary.

zolotov commented 6 years ago

@aarzilli thanks for the answer. Suddenly the error doesn't occur anymore :( It's good for the user, though.