Debugging hangs, bad access error in logs

I'm trying to debug a Go program - running it works just fine, and I believe I was able to debug it in the past. I'm using Go 1.9.3 (also tried with 1.11.1 with similar results). The program will run just fine, but when I try to debug it hangs with something like:

API server listening at: 127.0.0.1:50165

And never completely starts up. When I enable logging and look at the logs, this is what I see:

2018-10-03 11:44:21,820 [64735190] INFO - goide.execution.GoRunningState - Start Dlv debug process with `default`
2018-10-03 11:44:21,935 [64735305] DEBUG - #com.goide.dlv.DlvVm - OUT: {"method":"RPCServer.FindLocation","params":[{"Loc":"main.main","Scope":{"GoroutineID":-1,"Frame":0}}],"id":1}
2018-10-03 11:44:21,935 [64735305] DEBUG - #com.goide.dlv.DlvVm - OUT: {"method":"RPCServer.Command","params":[{"Name":"continue"}],"id":2}
2018-10-03 11:44:22,029 [64735399] DEBUG - #com.goide.dlv.DlvVm - IN: {"id":1,"result":{"Locations":[{"pc":23412747,"file":"/(redacted)/main.go","line":12,"function":{"name":"main.main","value":23412720,"type":0,"goType":0,"optimized":false}}]},"error":null}
2018-10-03 11:44:22,045 [64735415] DEBUG - #com.goide.dlv.DlvVm - IN: {"id":2,"result":null,"error":"bad access"}
2018-10-03 11:44:22,045 [64735415] INFO - #com.goide.dlv.DlvDebugProcess - bad access
 
Any ideas as to what I'm doing wrong?
1
4 comments

Hi, I'm going to assume you are using the latest IDE release, 2018.2.3, and OSX and you are using a library like "go-stak". If you do use "go-stack", please upgrade it to the latest version as it's known to have such issues. If you are not using "go-stack", then is your code intentionally throwing a sigpanic? See the delve issue for this: https://github.com/derekparker/delve/issues/852 If none of these help, can you provide a way to reproduce this and more details? Also, I advise you to stay on Go 1.11.1 in order to get the latest improvements for debugging from Go.

0
Avatar
Permanently deleted user

Ah, go-stack was a transitive dependency and ended up being the culprit - I was able to debug after upgrading it. Thank you!

0
Avatar
Permanently deleted user

I'm seeing something similar and cannot resolve it.

Using GoLand 2018.3.2 and OS X Mojave although this occurred as well on High Sierra.

 


2019-01-11 09:40:30,621 [214248676] INFO - goide.execution.GoRunningState - Start Dlv debug process
2019-01-11 09:40:30,727 [214248782] DEBUG - #com.goide.dlv.DlvVm - OUT: {"method":"RPCServer.FindLocation","params":[{"Loc":"main.main","Scope":{"GoroutineID":-1,"Frame":0}}],"id":1}
2019-01-11 09:40:30,727 [214248782] DEBUG - #com.goide.dlv.DlvVm - OUT: {"method":"RPCServer.Command","params":[{"Name":"continue"}],"id":2}
2019-01-11 09:40:31,194 [214249249] DEBUG - #com.goide.dlv.DlvVm - IN: {"id":1,"result":{"Locations":[{"pc":87388235,"file":"/Users/brianhoffman/go/src/github.com/OpenBazaar/openbazaar-go/openbazaard.go","line":33,"function":{"name":"main.main","value":87388208,"type":0,"goType":0,"optimized":false}}]},"error":null}
2019-01-11 09:40:31,651 [214249706] DEBUG - #com.goide.dlv.DlvVm - IN: {"id":2,"result":null,"error":"bad access"}
2019-01-11 09:40:31,651 [214249706] INFO - #com.goide.dlv.DlvDebugProcess - bad access
org.jetbrains.concurrency.InternalPromiseUtil$MessageError: bad access

 

0
Avatar
Permanently deleted user

Also we have go-stack in the dependencies but it's the latest 1.8.x release and not an older one.

0

Please sign in to leave a comment.