Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger freezes in VSCode #108

Closed
lothas opened this issue Mar 25, 2020 · 17 comments
Closed

Debugger freezes in VSCode #108

lothas opened this issue Mar 25, 2020 · 17 comments
Assignees
Labels
bug Something isn't working

Comments

@lothas
Copy link

lothas commented Mar 25, 2020

I'm trying to debug a piece of code and experiencing a weird bug:
I run my code up to a breakpoint and then start stepping through it (with F10/F11). I sometimes hover over some variables to check the content. At any (seemingly random) point, VSCode stops stepping over the code. No error is thrown. The only thing left for me to do is stop debugging (hit the stop button) and start the run again.
debugger.vscode_f0ea2b1b-f0b2-43e2-9596-a42593fe7528.log

@karthiknadig
Copy link
Member

@lothas can you try adding "redirectOutput": false to the debug config. See if that helps.

@lothas
Copy link
Author

lothas commented Mar 26, 2020

@ftrofin
Copy link

ftrofin commented Mar 31, 2020

I have the same problem. I'm a professional developer and work with Python all day. I LOVE VS Code but debugging Python code is filling me with frustration because of this reason. It really seems random as @lothas mentioned: sometimes it happens after you step 2-3 times after hitting a breakpoint, sometimes it freezes while running (after hitting continue - not stopped in the debugger) - it's very frustrating because you wait 5 minutes for your breakpoint to get hit you step once or a few times and then nothing, the only thing you can do is just kill and start again.

It seems to have gotten worse in the last month, it went from annoying to where I can't debug anything anymore. Please, please fix this.

Configuration:
Version: 1.43.2
Commit: 0ba0ca52957102ca3527cf479571617f0de6ed50
Date: 2020-03-24T07:34:57.037Z
Electron: 7.1.11
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 18.7.0

OSX 10.14.6 (18G4032)

Extension Author (truncated) Version
bazel-code Dev 0.1.9
python ms- 2020.3.69010
cpptools ms- 0.27.0
perforce sle 3.2.0
vscode-hexdump sle 1.7.2

@TimotheusT
Copy link

Same issue here since 2 days. I attached my debugger log files. No idea what causes it. It seams totaly random but it makes debugging almost impossible.

debugpy.server-11592.log
debugger.vscode_ec37560b-f6c7-41eb-8e68-81bf4d4ee08c.log
debugpy.adapter-624.log
debugpy.launcher-9108.log
debugpy.pydevd.11592.log

@karthiknadig
Copy link
Member

@TimotheusT @ftrofin @lothas Thank you for the logs. We are trying to narrow down this issue. Here is something you can do temporarily to unblock. Add this to your user settings.
image

"python.experiments.optOutFrom": [
    "PtvsdWheels37 - experiment"
],

Re-load after adding this setting. This should get you unblocked.

@ftrofin
Copy link

ftrofin commented Mar 31, 2020

@karthiknadig Thank you for the prompt response! This is awesome! I can debug again! Thanks for providing such a quick workaround! ❤️ it!

@TimotheusT
Copy link

@karthiknadig Seems to work fine! Thank you very much!

@joao-lamaro
Copy link

@karthiknadig thank you! Finally I can debug to my heart's content!

@logicbomb421
Copy link

This is also happening to me. @karthiknadig's workaround does work for me as well too.


VSCode Info

Version: 1.43.2
Commit: 0ba0ca52957102ca3527cf479571617f0de6ed50
Date: 2020-03-24T07:34:57.037Z
Electron: 7.1.11
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.3.0

Python Extension Version: 2020.3.71113

@int19h
Copy link
Contributor

int19h commented Apr 7, 2020

Looking at the logs, the last thing that the adapter does in all cases is receive the result of an "evaluate" request from pydevd, which was failing. Normally, it should then follow by failing the corresponding request from the client, and logging it.

Also, judging by all these logs, there are a lot of entries in Watch list, many of which produce errors routinely (because the stops happen in places where the variables they reference are missing). So the recurring pattern here is that every time the IDE pauses, it re-sends all those "evaluate" to the debug adapter, which produces those errors.

Now, until recently, the adapter was logging all such failures to stderr, as well. However, VSCode was not actually reading from that stderr... so once the pipe gets filled up, the adapter is locked trying to write to it. This would explain why its logs are completely cut off at this point.

If this theory is true, then that would make it the same root cause as in #83, and the fix for that one should also apply here. The most recent insiders build of the extension has this fix already - can you please try it and see if it makes any difference?

@int19h
Copy link
Contributor

int19h commented Apr 7, 2020

Also, if you are still running into this bug, can you try this simplified repro:

def error():
    raise RuntimeError(":o" * 100000)

while True:
    pass

then add error() to Watch, and step through the loop a couple of times. Does it hang? If so, are the symptoms the same as what you were seeing when you filed the bug?

@int19h int19h transferred this issue from microsoft/vscode-python Apr 8, 2020
@int19h
Copy link
Contributor

int19h commented Apr 8, 2020

Okay, so this wasn't actually fixed by #83, because the log grabs sys.stderr before it is redirected to /dev/null.

@Amuri44
Copy link

Amuri44 commented Aug 18, 2022

@TimotheusT @ftrofin @lothas Thank you for the logs. We are trying to narrow down this issue. Here is something you can do temporarily to unblock. Add this to your user settings. image

"python.experiments.optOutFrom": [
    "PtvsdWheels37 - experiment"
],

Re-load after adding this setting. This should get you unblocked.

How is about the the code to add for debugging julia code?

@icc-jhanvillasin
Copy link

Im currently having the same issue but in AL Extension Business Central. anyone can help me ?

@SohailChohan143
Copy link

Im currently having the same issue but in AL Extension Business Central. anyone can help me ?

Same here please if you get solution pls pin me too

@icc-jhanvillasin
Copy link

anyone can help?

@SohailChohan143
Copy link

Use older veersion of VS code fix my issue "VSCodeUserSetup-x64-1.74.3"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants