-
Notifications
You must be signed in to change notification settings - Fork 183
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
dap hang when debug torch dataloader #438
Comments
Maybe related with this attach mode #384 ?
I checked vscode use debugpy as backend, and also works fine with |
The PR you mentioned is for |
@nbfalcon thank you for looking at this issue. But it seems my issue is related with multi-thread, maybe not related with attach mode(which seems to me only related with remote debug, that is not my case). So any idea where is wrong? is it due to dap-mode currently not support multi-thread debug? or is debugpy issue? |
I think this might be related to multi-process debugging which is triggered by the debugpyAttach message and more recently the standardised startDebugging request which is sent from the debug adapter to the debug client (dap-mode). I've noticed with recent changes to pytables loading hdf5 files via pandas causes a separate subprocess to start. This causes dap-mode to hang under Emacs because the debugpy adapter is expecting a response from client to handle the subprocess starting. It actually expects the client to start a new debug session, run through initialisation and then attach to the debugger given the connection details in the debugpyAttach/startDebugging message. I've also verified this with a simple script that spawns a separate sub process which hangs. There are issues raised against libraries such as FastAPI which would spawn processes - which refer to hanging in the debugger. Incidentally when I debug the hdf5 file open within vscode I can see the separate subprocess start and stop as I step over it. I've also tracked the message sequences that are sent and have dap-mode code that can work around the issue but I fear that some form of hierarchical debug session support will be needed within dap-mode to handle switching between debug sessions as breakpoints are triggered and sessions closed. I'm going to raise a new issue to discuss this because the implications are wider than dap-python and involve dap-mode and possibly dap-ui changes. |
Hi,
I use dap to debug python code, all works fine, but when I debug dataloader in pytorch code, it will hang.
Here is the io log after dap-next
the dataloader of torchvision will try to download dataset from internet, if it found the dataset already downloaded it will use the local dataset. In above test I already download the dataset.
I use proxy to asscess internet, it works all fine.
yes, vscode can debug corretly.
It seems this issue is related with internet, but I have no idea where is wrong?
The text was updated successfully, but these errors were encountered: