go-delve / delve

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

delve randomly detaches from process #1695

Closed dasl- closed 4 years ago

dasl- commented 4 years ago

Please answer the following before submitting your issue:

Note: Please include any substantial examples (debug session output, stacktraces, etc) as linked gists.

  1. What version of Delve are you using (dlv version)?
    Delve Debugger
    Version: 1.3.0
    Build: $Id: 2f59bfc686d60989dcef9de40b480d0a34aa2fa5 $
  2. What version of Go are you using? (go version)?
    go version go1.12.9 linux/amd64
  3. What operating system and processor architecture are you using?
    VM host: Centos 7
    Docker container running on VM: Debian GNU/Linux 9 (stretch)
    laptop running GoLand IDE: OS X

I am attaching delve to a process inside a docker container. Example: https://gist.github.com/dasl-/0752fc02e655ec4c342ea7da69c4b948

I am using the Goland IDE to connect to delve.

Firstly, it is often very slow to load local variables / call stack: delve1

Secondly, sometimes delve randomly disconnects when it is in the process of loading a local variables at a given frame in the call stack. The delve process dies and I have to reattach it and start over.

aarzilli commented 4 years ago

A log of the rpc calls would reveal which calls are slow to complete, it can be obtained with --log --log-output=rpc

dasl- commented 4 years ago

@aarzilli https://gist.github.com/dasl-/dafa5882da3a9d465593a487901e02fa

I printed the first 80 chars followed by ... followed by the last 80 chars of each line. The lines were enormous in length -- although the output is only 39 lines, the file size was ~150MB.

At the end of this output, delve disconnected itself. I am not sure why and it makes it very hard to debug my program when delve disconnects.

aarzilli commented 4 years ago

I don't see anything particularly strange in that log, except for the fact that ListLocalVars gets called three times after the program pauses. Delve could be terminating because GoLand disconnected for some reason, if it had crashed there would be a stacktrace. Another possibility is that it's getting killed by the oom killer.

leexuehan commented 4 years ago

I have met the same question often,my IDE is goland and my delve version is 1.3.2. Operating system is Linux/GNU

aarzilli commented 4 years ago

Closing, no feedback.