-
Notifications
You must be signed in to change notification settings - Fork 280
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 may hang if a firewall is active #2004
Comments
Thanks for the investigation, I think this might have been the cause of another WSL bug we got recently. I'll look into a fix. |
This should be fixed in the next nightly build, please let me know whether this fixes it for your |
Hey, thanks for fixing this so fast! I think the new change might still cause some issues. FWIW, the |
Hi @connor4312 - seems like there still exists an outstanding issue that @tusharsnx describes. Is another issue tracking this or should I reopen this issue? Thanks |
reopening based on @tusharsnx's comment. |
Let's track that as a separate issue. The fix is still good for the original bug and I'm not sure I want to change it -- taking the performance hit for the pretty rare case of a higher privilege process listening on a high number port that we randomly pick. |
Describe the bug
vscode-js-debug/src/common/findOpenPortSync.ts
Line 32 in 6e29d1d
The vscode js debugger seems to use
nc
(netcat) for testing arbitrary ports to be available for the debugger to use. This works fine, except when a firewall is active on the system which can block access to ports in a way where the application would never see a reply coming back so they would just hang. In this case,nc
never receives a reply and keeps waiting for it , and the debugger blocks on that (until it eventually times out).I'm using WSL's new
networkingMode=mirrored
mode that comes with a firewall that by default blocks requests in the way I described above (no reply sent). I think it's important to wrap the call with a reasonable timeout that is also small.nc
does give an option to set a timeout with-w
option. This should be set within a range of a few seconds.To Reproduce
Steps to reproduce the behavior:
.wslconfig
:execSync()
line) in the program.NODE_OPTIONS="--inspect-brk" node ./main.js
In the background, node has started
npm config get registry
, but before the npm's node instance could run, node called the debugger code, and the debugger callednc
command that is now hung waiting for a reply. On my system, it eventually resumes after thenc
returns due to the (~2 mins) default timeout (?)VS Code:
Version: 1.88.1 (user setup)
OS: Windows_NT x64 10.0.22631
The text was updated successfully, but these errors were encountered: