-
Notifications
You must be signed in to change notification settings - Fork 137
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 gets stuck with python code #274
Comments
I'm pretty sure this is #108 - we have a fix for that, but it's only available in the insiders version of the extension. Can you give it a try? |
Hi, I am unfortunately also affected by this bug. I tried the opt-out solution suggested in #108 but it doesn't fix the issue for me. The debugger randomly stops responding / hangs / freezes at times, which also affects the debug console. I will be happy to provide you with any and all information that may be helpful in fixing this. I love VS code but this debugging issue is really annoying, since the only thing that seems to help is to stop and restart the debugging process entirely....but that only helps temporarily. Please specify which information I can provide to help. |
@int19h Like @Pabosik, I also still experience the issue after using the fix in #108. Is there already an update on this issue? I tried using the weekly insider as well as adding the following lines to the settings.json file:
I also tried using the following settings:
|
Can you please show the output of |
@int19h Thanks a lot for the very fast response. The debugpy version seems to be
|
Thank you! Since this is definitely the version with the fix for the other issue that caused similar symptoms, this must be something else. Can you please add: "logToFile": true to your launch.json config, and try to repro it again, then share the logs it'll create? They are placed in the folder where the extension is installed, and have names matching |
@int19h I again tried to debug a python script with the While I was debugging, I also noticed the freeze only happens when I try to interact with the variables using the debug console or variable browser. Secondly, the debugger always gives a |
Looking at the larger log, I'm seeing three expression evaluations being submitted in rapid succession for these expressions:
Could the first one just be very long-running? It would block basically everything else in the debugger if so. The debug server log seems to indicate that it was still working on that when it got the request to stop debugging. (Unfortunately, VSCode Debug Console UX for long-running evals is confusing - it shows the prompt for the next expression as soon as it submits the previous one to the debugger; it does not wait for evaluation to complete.) |
@int19h Thanks a lot for the explanation. The
|
If the library you're using requires multiple threads running concurrently to operate - e.g. if any of those |
@int19h Thanks for point me to that issue. I will look into it. |
As it seems that the issue is during the evaluate, so, I think the changes done in: #157 may enable to shed more info in this issue... there still isn't a release with that version, but if you'd like to check it with the master, it'd be nice to know if it does actually improve the situation in your use case. To use the master do the following: Clone this repo:
Then, in your launch config add:
and debug your app... if things turn out as I expect, it should print a message to the |
@fabioz Thanks for your response. I will check your it when I am working again on the project discussed in this issue (in about 2 weeks). |
@fabloz I was able to perform the steps you proposed and with the new version of Example python scriptsis_scalar.py module import torch
import numpy as np
def is_scalar(obj):
"""Recursive function that checks whether a input
Args:
obj (object): Object for which you want to check if it is a scalar.
Returns:
boole: Boolean specifying whether the object is a scalar.
"""
# Check if obj is scalar
if type(obj) in [int, float]:
return True
elif type(obj) == np.ndarray:
if obj.__len__() > 1:
return is_scalar(obj)
else:
return False
elif type(obj) == torch.Tensor:
if obj.__len__() > 1:
return is_scalar(obj)
else:
return False
elif type(obj) == str:
return obj.isnumeric()
else:
return False test_debugger.py script import numpy as np
from is_scalar import is_scalar
print(is_scalar(1), "True")
print(is_scalar([1]), "False")
print(is_scalar(np.array(2)), "True") # I'm here
pass Steps to reproduce (Also see gif)
IndexError: too many indices for array GifFull Error messageTo see the full error message go to this gist. Debugpy (old version) logsThe logs for when I'm using the old version can be found in this gist. Debugpy (new version) logsThe logs for when I'm using the new version can be found in this gist. |
Closing this one, since there are other issues tracking the remaining problems. |
Issue Type: Bug
While debugging a python script, I cannot continue stepping through the code since MSC debugger is not responding anymore, after a certain number of steps.
Also the debug console is impacted, meaning I do not get any requested content of a variable once the above happens.
At the biginning I thought the number of steps until it gets stuck is constant. Meanwhile, I observe that the number of steps I can perform within the same script, is depending also on the starting position in the code as well as well as the number / type of variables in the watch.
I first issued here: microsoft/vscode#95545, but was now guided to issue the bug directly under the python extension.
As advised, I updated to MSC version 1.4.2, but the error still persists.
So hopefully, someone can help and fix it. Thanks!
VS Code version: Code 1.41.1 (26076a4de974ead31f97692a0d32f90d735645c0, 2019-12-18T14:58:56.166Z)
OS version: Windows_NT x64 6.1.7601
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled
Extensions (3)
The text was updated successfully, but these errors were encountered: