-
Notifications
You must be signed in to change notification settings - Fork 145
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
Hang with "redirectOutput":true and too much output #83
Comments
@oliviercwa Can you share the extension version? and also the following line from Output > Python panel? |
@ssouques @oliviercwa We will need logs to help with this. Can you add |
Since, it was quite painful, I have tried to disable all but one python extension, but the problem was still here. Then I tried to changed the console from "internalConsole" to "integratedTerminal" and the problem no longer happens. Which part of the logs do you want me to share? The log contains LOTS of confidential information include environment variables, etc. Once it freezes, I tested the state by typing "a=10" in the debugger followed by a,, debugger.vscode
No evaluation shown in the Debug window, just "a" Here is the end of the output of debugpy.pydevd:
And the end of debugpy.adapter
|
Hello, here's a way to reproduce : Regards, |
@oliviercwa @ssouques Thank you for the details. Transferring this to debugger repo. |
With "redirectOutput", we read debuggee's stdout and stderr, convert them to "output" events, and then tee them into the launcher's stdout/err. The problem is that with "internalConsole", the launcher's stdout/err is also redirected by the adapter to its stderr. If nothing is reading from there, then the entire logical pipe gets clogged eventually - i.e. it freezes once the buffers are filled up. We are kinda assuming that adapter's stderr is going to be drained by the client, but this is not guaranteed. The fix is for the adapter to stop trying to tee launcher's stdout to its stderr if "internalConsole" is in effect, and stdout is used for DAP. It should just dump it all to /dev/null. |
Just some additional information. I was actually to repro the bug even when using "integratedTerminal" or "externalTerminal". As @ssouques mentioned, it seems related to the number of data that goes through the debug output. For example, if I print a few dataframe, it hangs very rapidly. This is quite a painful bug and slow us down enormously as there are no other options but to restart. If you know of any workaround, I will take it :) ! |
@oliviercwa, does it still happen if you use |
It seems to work with |
@oliviercwa, did you have it explicitly set to true in your launch.json before? It should default to false if you have "integratedTerminal", so you should be able to just omit it. If that's not working somehow, that would be another bug. |
Set sys.stdin/out/err to os.devnull if using stdio to talk to the client, instead of redirecting stdout to stderr.
I did not have it before, so the default value was used. |
The fix is already in master - it's in the commit referenced from the message that says that issue is closed. It'll be in the next debugpy prerelease, and from there, in the next extension release. In the meantime, the suggested workaround is to use You can also use the most recent debugger bits directly from GitHub to get the fix early. Just clone this repository somewhere - say, "debugAdapterPath": "C:\git\debugpy\src\debugpy\adapter" (However, this skips building native modules that debugger uses to speed things up, so it will be a bit slower than the version packaged with the extension.) |
Hello,
I am debugging Python code in VS Code and and in the middle of the debugging session, at random time, it hangs. Everything is still responsive and you can interact with everything, but the execution is frozen and anything related to debugging does not evaluate. I try to press F5, click on the Start button, but the debugging session does not continue.
Notes:
This is very painful as prevents the ability to debug Python in good conditions.
Environment:
OS: Windows_NT x64 10.0.19041
Python: 3.7.4 64 bits
VS:
Version: 1.43.1 (user setup)
Commit: fe22a9645b44368865c0ba92e2fb881ff1afce94
Date: 2020-03-18T07:01:20.184Z
Electron: 7.1.11
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
The text was updated successfully, but these errors were encountered: