-
Notifications
You must be signed in to change notification settings - Fork 645
debugging hangs with no error message #473
Comments
I seem to have the same problem. I'm working with:
Every so often,
|
@roblourens Could you take a look at this? |
This would imply that Delve returned a |
"evaluateRequest" is in the callstack, which implies that you either have a watch, or you typed something in the console. Did you do one of those? Separate issue but I noticed that evaluateRequest assumes that you have hit a breakpoint when it's run, and it errors if you have a watch or eval something in the console before the first time a breakpoint is hit. We could do something about that. |
@roblourens No, but VSCode does watch all local variables in a VARIABLES panel -- could that be related to this problem? |
It doesn't send an evaluateRequest for that, so I'm not sure where else it would have come from. |
@roblourens could command-line arguments be related to that, maybe? I get the impression a CLI-with-command-line-args is making |
Same error occurred for me
|
@derekparker Looks like delve is sending |
@cyc115 If you are able to repro consistently, then can you try to use delve from the command line and share if that works? |
@ramya-rao-a it indeed does ➜ dlv test
Type 'help' for list of commands.
(dlv) break main.main
Breakpoint 1 set at 0x1673fa3 for main.main() xxxx.go:220
(dlv) |
@ramya-rao-a Any idea how this bug can be bypassed at least for now? :) |
Does The thing is we are getting null state from delve and so the issue. We would be in a better state to fix this if we know why delve does so |
@ramya-rao-a yes |
Can you share a sample code where this repress consistently? |
@ramya-rao-a The docker/notary project seems to be failing. |
@ramya-rao-a Here is an example: https://github.com/willseward/delve-crash which I cannot debug from VsCode but I can with the command
|
@ahmedjafri I am using the same version of VS Code, the Go extension and delve as you
I am able to hit the breakpoint, step in/out/next etc. Are you on Mac, linux or Windows? |
@ramya-rao-a I'm on OSX 10.11.6. Is this remote debugging? I cloned https://github.com/willseward/delve-crash and launched the docker container with |
Local debugging on https://github.com/willseward/delve-crash does not work either: |
@ahmedjafri Not remote debugging, I tried local. @cyc115 Can you set |
As a point of reference, I can debug locally if I set a breakpoint initially and launch the debug session from vscode. After I hit the first breakpoint, I remove that breakpoint and hit continue. If I try to set that breakpoint again, it becomes unverified. |
@ahmedjafri I can repro that. The delve call here https://github.com/Microsoft/vscode-go/blob/master/src/debugAdapter/goDebug.ts#L510 doesnt seem to be returning at all. Nothing after https://github.com/Microsoft/vscode-go/blob/master/src/debugAdapter/goDebug.ts#L508 gets printed to the logs. Can you try the same with command line delve and see what you get?
|
Working as expected through dlv command line
|
That was very helpful @ahmedjafri Thanks! I can repro the exact same thing
I am guessing you did a Looking at the steps followed by the debugger, this is what is missing I believe. @roblourens Does that make sense? ( I might be way off here) |
Yes, I think in general we don't handle setting BPs while the process is active very well. The solution might be that when a breakpoint is set and Delve isn't paused, we send a SIGINT first, set the bps, and continue. Would have to experiment to say for sure. |
Yep that is me hitting |
I am having this exact issue when I have any parameters in the "buildFlags" the the launch.json.
After banging on this for some time, I found increasing the pause in the following line to something like 500+ ms before the RPC connection attempt seems to alleviate the issue and things continue as expected. https://github.com/Microsoft/vscode-go/blob/0.6.62/src/debugAdapter/goDebug.ts#L296 If I remove the Here is a dump of a trace with the build flags. I've removed some things for privacy sake.
This is where things stop. If I hit enter 2 times on the debug console, I receive the following. Also, if I don't hit enter a couple of times,
|
Guess I should note for anyone wanting to test this possible fix locally. For Windows just update that line in your local file... probably here for Windows. Linux might have a similar path.
|
@byron70 Yours is a different issue in that you want to increase the time before the connecting so that there is enough time for build. cc @roblourens for increasing the time interval int he setTimeout This current issue on the other hand is about the ability to add breakpoints when the Go program is already running. |
Other debug adapters allow you to override the timeout, and it would be easy to do that (I don't know whether there's a smarter way to detect when the build is complete) |
I'm having the same issue running from VS Code running a simple hello world using fmt.Scanf |
I think this is an issue with delve. I opened a reduction here derekparker/delve#982 It seems the headless rpc server get stuck for some reason. I've noticed that you can send various commands, they leave VSCode without problem and never get any response back. Then if you brutally kill the debugger, you see one error in the VSCode debug console about "connection closed" or something for each command that never got response. |
Multiple issues are being talked abt here, I'll try to address them here
@jgimenez @svanas I dont have the details if you used All, |
Could be related to #240 but since a long time has passed since then, could also be a new issue.
When I press the "play" button a progress indication appears but nothing happens.
I'm working with:
I can confirm running
dlv debug
, thencontinue
on my console works.I can not say it's a regression, since this is the first time I try it in this machine.
If I type anything in the debug console, an error message appears:
The text was updated successfully, but these errors were encountered: