-
Notifications
You must be signed in to change notification settings - Fork 646
With 0.6.85, delve does not properly close or restart. 0.6.84 Works fine. #1814
Comments
Same issue here on macOS with |
Downgrading to 0.6.84 worked for me as well. To do that download the 0.6.84 release and run the following:
You may want to add To use the extension run |
There is probably more of them like that:
|
Can someone here share a small sample code where I can try and get a repro of this? |
This appears to cause some of the issues mentioned above. package main
import (
"sync"
"time"
)
func main() {
wg := sync.WaitGroup{}
wg.Add(1)
go func() {
for {
time.Sleep(time.Second)
}
}()
wg.Wait()
} Side note: code listening on a tcp socket with a fixed port appears to make this worse as it is occasionally trying to launch two copies and one fails as the port is in use. |
I'm on windows and this happens. |
@antihax I tried your code on Windows. On ending the debug session using the stop button, debugging stops as expected. All, Whats changed between 0.6.84 and 0.6.85 is the below:
From the descriptions in this issue, it looks like the detach by delve is not getting completed. I have added a few more logs to the code to confirm this. Can folks here try the below?
Look for "HaltRequest", "DetachRequest", "DetachResponse" and "DisconnectRequest to parent" in the logs and share what you find here. |
With above code and Go-latest.vsix from cloned repo.
|
@antihax We also send a Halt request before trying to Detach for which I forgot to add logs earlier. Can you try the instructions at #1814 (comment) again? |
On first stop.
On second, no change to log but the controls go away. Both debug and dlv are still running.
|
This shows that the halt request is not getting completed by delve. I still cant repro this, so not sure what the next steps would be @aarzilli any thoughts on why the Halt request made to delve would not complete and call the given callback? |
I'd like to see the output of |
same problem with me |
@antihax I've updated the |
Hitting stop; DisconnectRequest and HaltRequest appear, but no additional RPC to dlv. Hitting second time, nothing additional.
|
I am able to get logs after the @aarzilli I log the text @antihax Do you have the latest dlv? Can you update it just to be sure? You can run |
Same thing after running the update above. |
@antihax And you are trying this with the sample code from #1814 (comment) correct? What's the version Go and VS Code you are using? And what OS? |
I am using the code above.
VS Code is:
|
@antihax I am able to repro your case if there are no breakpoints in the file. Can you try adding a breakpoint and then see if you are able to stop the debugging session properly? |
In @antihax logs I see that VSCode is sending a ListGoroutines request right after the continue command, that request is synchronous and can't be executed until continue terminates and will also block any other command from going through (including halt commands). |
I am able to reproduce the issue even with breakpoints ON. I am using a different code as follows
with breakpoint set on second last line
|
reproduce the issue:
|
Seeing this on Windows too, and it seems to be related to how build failures are handled at least on my configuration. The basic steps to reproduce are:
Tested on the latest release Code and the go-latest.vsix (commit b4c4698) from the repo - doesn't work - and with 0.6.84 linked above - works fine. Logs from both a succesful run and the logs after running unbuildable code from both versions below. No RPC logging on the 0.6.84 as the launch configuration flag doesn't work in the older plugin. Code to run:
Runs and debugs fine, repeatedly. Logs on a succesful session are as follows:
The same (build success) on 0.6.84:
After uncommenting the commented line - causing an error ('unexpected to at end of statement') while building - it is impossible to re-run the debugger. F5 seems to be completely ignored, while running from the Debug pane results in an 'There is already a debug configuration running' error message. Stop debugging is active, but does not result in anything while restarting results in the same error. Trying to terminate/stop/anything from command palette does not help either - the only workarounds seem to be a complete restart after each build failure (which is pretty much unusable) or downgrading to 0.6.84. Logs from build failure are as follows:
The same (build failure) on 0.6.84:
|
@aarzilli That explains why the halt command never makes it through. Any reason why continue wouldn't terminate? @moitias Thanks for the detailed steps. The |
The program in question is an infinite loop, if the halt doesn't make it through it will never terminate on its own. |
@aarzilli You mean the program will not terminate on its own or the |
I mean both, if the program doesn't stop somehow the continue doesn't return either.
Not sending requests while the target is running. |
I am on Mac OS and am also seeing all of the issues reported here: having to click twice to stop, processes sticking around that I have to kill on my own using Activity Monitor, and the error about debugging already running for which I have to restart VSCode. After I started seeing this I updated Delve and the Go tools, so they're current. |
I'll look into that, thanks. |
Mac OS - same issue. Downgraded to 0.6.84 :( |
This doesn't seem trivial. There is no way way for the debug adapter to know if the target is still running. Instead, I have brought back the code to kill the process manually, but only if we don't hear back from the halt request made to delve or if the detach request fails. @moitias This will fix your issue as well. Everyone here, please try the below
|
The target is running from the time you make a Command request to the time you receive a response for it. |
Thanks @aarzilli. I've included a check to not make the All, |
@ramya-rao-a the latest beta version works perfectly. |
Working here too. |
The fix is now available in the latest update (0.6.86) to the Go extension. Thanks everyone for your patience. |
Appears to still be an issue in 0.6.88 |
@Evasion Please add |
I added verbose as advised but I have not been able to recreate since then. Will update once I am able to reproduce it. |
@Evasion, if you do see it again, please log a new issue. This thread is already long :) |
Having issues on Ubuntu with Go extension 0.6.85 and delve debugger on multiple projects. Looks related to #438. This started after upgrading to 0.6.85 and works fine when downgrading to 0.6.84.
Issues:
There is already a debug configuration "Launch" running.
when there is nothing running. Have to restart vscode to fix.launch.json
debug.log (DisconnectRequest appears after first stop request, nothing after second)
Both delve and debugged process are still running.
The text was updated successfully, but these errors were encountered: