-
Notifications
You must be signed in to change notification settings - Fork 645
Debugging goes into proc.go at every step #2133
Comments
Can you try running dlv from the command line, debug the same test and see if the step into/over in that case does something similar? |
We are seeing the same behaviour on different machines in our company. I'll try to test dlv from the command line later this day. |
I'm seeing the same issue, on
|
Is there a way to easily obtain the commandline that vscode is providing to dlv? That seems like it would be useful. |
@virtuald Of course. I just added a note on it at https://github.com/Microsoft/vscode-go/wiki/Debugging-Go-code-using-VS-Code#try-using-dlv-from-the-terminalcommand-line |
@ramya-rao-a I've tried running dlv from the command line. An attach from vscode to the running dlv leads to the same behaviour. Stepping into/out goes into proc.go |
Same here, and it's very slow for it to Step into/over, or showing Variables in the debug tab.
|
Inspecting the |
@anphung Is your problem also about every step in going into the proc.go file or is it just about slowness? |
It's both. Actually, it jumps into proc.go for around several seconds (the time varies). If just wait for several seconds then it'll jump back to the next line that it supposed to jump in the first place. |
Thats an interesting find. There is no official way to disable global vars, but can you try the below
Check if this solves the problem of slowness |
That's faster. It still jumps into proc.go sometime, but jumps out immediately (not several seconds anymore). |
Digging a little deeper, most responses from delve are too much for vscode-go (vscode-go only extracts part of the responses), such as |
@ramya-rao-a I can concur, is also very slow to step over, and I tried to reinstall dlv to no avail, I remember getting slow suddenly, months ago, I think it was an update. |
Is this only with certain code bases or even a simple hello world program? If you can provide a sample code that I can try this on, I can look deeper into what is causing the slowness as well as the jump to proc.go
@anphung When you used |
@ramya-rao-a here it is with a hello world, https://gyazo.com/a90e25806cbbf6013d4af25a1c0220c2 it doesn't seem that slow actually, but still flashes into proc.go, but it flashes, on the normal codebase it would just stop into proc.go and you need to step over it. |
With Delve RPCs give out much information, in exchange vscode only uses part of it. For example, ListGoroutines, vscode only extract id, function name from I guess vscode can't do much here, unless people build a more lightweight RPCs in Here is a sample: Set breakpoint at line 19, if you can't see the slowness or jumping to proc.go, try increase |
Thanks @mxxcx and @anphung @derekparker, @aarzilli Any thoughts on this? |
A while ago we added two parameters to ListGoroutines that allow retrieving goroutines in smaller chunks (there is however a bug, see related PR). |
For me the debug performance is fine, but the constant flipping to proc.go is really annoying. |
I experience the exact same behavior with the debugger jumping to the function "gopark" in proc.go every step I make. |
I can confirm the same jumping into |
I am experiencing the same behavior. My setup: If there's something I can do to help - let me know. It is really annoying :-| |
I tried with older versions of the Go extension and I can still see the issue which tells me that this is not due to any recent changes in the extension. If somebody here can try with older versions of dlv, then we can at least narrow down or eliminate recent changes to dlv as the reason. |
I've been experiencing slowness (sometimes extreme) and the proc.go jump while debugging for the past month or so. Using the above adjustment to disable package info, the speed is back to normal and fast and I have yet to have the proc.go jump but will continue to experiment. What are the side-effects of having this disabled? |
It seems that the extension is responsible for providing a log of the adapter protocol (VS Code doesn't supply a mechanism to log on its side) Maybe we should integrate LoggingDebugSession from the adapter module so that we can produce such a log which might help reveal the cause, if it's in the debug adapter that is. |
@ramya-rao-a It got auto closed by GitHub. This should be reopened. |
@segevfiner The master branch now uses the LoggingDebugSession. |
With the more verbose logging, it seems that the trigger for this is a (The |
Debugging VS Code a bit, it seems to me we are hitting this line in VS Code: vscode/src/vs/workbench/parts/debug/electron-browser/debugService.ts:496 and that call to We really shouldn't be reaching a code path where VS Code selects some arbitrary thread to focus, that seems like a bug in VS Code. The code there is a bit weird too, like vscode/src/vs/workbench/parts/debug/electron-browser/debugService.ts:773 with that I launched VS Code (Git build) with |
All, I have added a new property @aarzilli We already pass the current package as filter when calling @segevfiner Great insights! |
This issue has been closed automatically because it needs more information and has not had recent activity. Thank you for your contributions. |
before @ramya-rao-a 's beta (was using v0.8.0), I experienced this issue (slow-down and proc jumping between steps). I also noticed that while experiencing the slowdown, the
but that made the inspection useless 😞 then I reverted to API version 1:
which fixed it entirely, but was less than ideal. The beta fixed the issue entirely for me. I've reverted to the default |
Hello all, The jumping to proc.go issue has been fixed upstream in VS Code. Therefore, please use the latest Insiders which has the fix. For reference, microsoft/vscode#65920 was the upstream issue, and a big shout-out to @segevfiner who drilled down on the root cause and helped the VS Code team in coming up with a fix. The slowness issue is due to the recent feature of showing global variables in the variables pane. In the beta releases, I added a setting (by default: false) to control that feature and most of you saw improvements. @jhendrixMSFT figured out that this was due to a caching problem which we have now fixed. I am retaining the setting, but turning its default value to So, please install the latest beta version of this extension in VS Code Insiders and you should see improvements. If you still see the slowness, try adding |
Hello again! Turns out we didnt really turn the So folks (@joegilley, @anphung, @tcagan, @mikecowgill, @stffabi, @seanstrickland-wf, @egorse ), who saw the slowness and then saw the slowness go away (either with the beta version, or by using the workaround I mentioned in #2133 (comment)), can you please update to the latest beta version (the version should be 0.8.1-beta.11) and let me know if you still see the slowness? I really need this feedback before releasing the next update, so thanks a ton in advance! |
@ramya-rao-a I've just tried 0.8.1-beta.12 with vscode insiders. The jumps to proc.go have gone 🎉 , that's awesome... Regarding the slowness, I think it has gotten faster, but it's still slower than before |
Thanks for that feedback @stffabi! |
If there's a repro available that demonstrates the slowness it would help, maybe there's a better way we can implement this feature. |
@ramya-rao-a I just got the new update, and yes it is slower with global variables ON, I had it off, using the workaround you posted with return null, you can see bellow, it can take up to 1 second to step over, and those are simple if statements in a big codebase albeit. https://gyazo.com/b24bebc3b90c48b2ffd1f8e70fd501cf In my opinion is not unbearable slow, initially it was much slower. |
@mxxcx |
@ramya-rao-a yes, got the update for both, hence it overwrite the workaround I did when you initially posted it, thanks for the config tip. No proc.go btw, so I guess this can be closed. |
Thanks @mxxcx! Conclusion:
|
I'm using go modules, and every debug step into or step over goes into a proc.go file
gopark
function and then goes back. You can see it in this gif. https://gyazo.com/adb4a54cc467ce372a4b5595b72d150fSteps to Reproduce:
Have some test and try to debug them.
launch.json
{ "name": "Test", "type": "go", "mode": "test", "request": "launch", "remotePath": "", "port": 2346, "host": "127.0.0.1", "program": "${workspaceRoot}/test", "env": { "GOPATH": "/Users/user/golang" }, "args": ["-test.short"], "showLog": false }
The text was updated successfully, but these errors were encountered: