-
Notifications
You must be signed in to change notification settings - Fork 648
Cannot debug or debug test with Remote-WSL #2505
Comments
Note that I have resolved the gcc-5 problem, it is related to the fact that I was setting my path in Moving the PATH setup to ~/.bashrc fixes this problem. But I am still not able to debug, the dlv process just hangs indefinitely. Delve does not seem to support debugging in WSL right now. Related: |
I can confirm this same behavior also exists in my own testing. The Debugger just hangs with the message "API server listening at: 127.0.0.1:18198" in the Debug Console. My path settings are correct and I can execute my go program successfully using Ctrl+F5 "Start without Debugging". This issue only seems to be related to the debugger. |
It would be nice if there's someone smarter than myself who can provide a workaround for this one (if available). |
I experience the exact same issue: Works fine running w/o debugging (CTR+F5) but doesn't work with debugging (F5) |
I have run into this also. the trace: verbose everything looks good but never hits my first breakpoint in main. In the debug console, it has a link to the file I am debugging. I click on it and it says it does not exist and prompts to create it which is not right. I am using gvm (to install go 1.12.5). I am trying to debug kubernetes/kubectl. Works fine w/o debugging as others have stated. I am currently comparing the debug session with debugging directly on ubuntu 18.04. Also if you change the launch.json settings to include trace: verbose and logOutput: true you will see that the debugger fails because it can't find the source file for the breakpoint. running wsl on win 10 - 1803. |
The same problem... As far as I understand the issue should be solved by #926 . Today I installed a fresh version of VSC Insiders on my Windows 10 machine. I also installed Remote Development and Go extensions(the second one on WSL).When I try to debug it just hangs |
The same problem when i press(F5) the debugger is hang. below is my trace log
i run main.go in my workspace,it work well go version go1.12.7 linux/amd64 |
Maybe we can use gdb instead of delve, before delve works in wsl. The {
"version": "2.0.0",
"tasks": [
{
"label": "compile",
"type": "shell",
"command": "go build -gcflags=all=\"-N -l\" ${workspaceFolder}/${relativeFile}"
}
]
} {
"version": "0.2.0",
"configurations": [
{
"type": "gdb",
"request": "launch",
"name": "Launch Program",
"target": "${workspaceFolder}/${fileBasenameNoExtension}",
"cwd": "${workspaceRoot}",
"valuesFormatting": "parseText",
"preLaunchTask": "compile"
}
]
} |
Is there any news on this? Or is there something can be done as a workaround? It's so annoying that debugging is not functional when really needed. |
@wizcas I have had some success with Remote-Containers and |
@davidovich the idea is cool! I'm gonna try it definitely, as it also keep everyone's dev environment identical. Thanks! |
Still no luck in v1.38.1 |
Same problem: when I start debugger it just shows the message: |
Added verbose tracing in .vscode/launch.json configuration by setting showLog and trace properties:
Log on launch:
At this point nothing else happens. When I stop the debugger this is added to the previous log: |
same issue. is there any update? |
I am also experiencing this same behavior. VSCode hangs indefinitely when debugging via WSL Remote Connection. |
Hello everyone! Same issue here in wsl1 ubuntu 18 :( We tried @OhYee native debugger approach but the result was a very poor debugging experience: lag, interruptions, no information about struct contents... By now I will be using containers where debugging is working great and building a go dev container was a very simple task:
Also, people say that using wsl2 solves the problem. |
+me, same problem |
Same problem!!! |
Me too! |
Still in v1.39.2 |
v1.39.2 |
v1.39.2 |
From client: setBreakpoints({"source":{"name":"main.go","path":"/mnt/d/work/wf/go/src/github.com/lcl101/mytest/test1/main.go"},"lines":[8],"breakpoints":[{"line":8}],"sourceModified":false}) |
wsl messsage: |
I don't think it will be very much helpful but I hope at least it gets some attention by saying that this still doesn't work Version: 1.40.0 (system setup) |
Same here, it worked on previous versions(not sure about the specific version numbers though), but it stopped working on the latest version. Interesting thing is that it's still working with 'Remote-SSH' Version: 1.40.0 (user setup) And this trace looks suspicious... --> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (296) Failed to create fifo\n"},"seq":26} |
why is this message showing up in default setting anyways? |
I figured out the problem. Go dlv debugger uses some system calls that are not supported in WSL1. Remember that WSL1 just uses a small Linux emulation layer while trying to translate Linux system calls to Windows. WSL2 contains a fully fledged Linux kernel with full system call compatibility. However it's currently in beta and is only available with Windows insiders build (general availability sometime in 2020). However you can install it right now by joining insiders which I highly recommend, works very well: https://docs.microsoft.com/en-us/windows/wsl/wsl2-install In WSL2 go debugging works without issues. Also you can run any Linux program natively (Docker containers, kubernetes, etc.) |
Since WSL2 is working with this, I think we can close the bug @ramya-rao-a? |
Thanks for the update @promaty! |
When I try to start a debug session (through codelens for tests or with a launch configuration, the debug session fails rapidly with this outpout (I have enabled "trace" : "log" in the launch configuration):
I installed gcc@5 with linuxbrew:
Running the above dlv command in my terminal works, which points to the PATH env var not being populated in the calling proccess.
This may be related to #2504.
The text was updated successfully, but these errors were encountered: