microsoft / vscode-js-debug

A DAP-compatible JavaScript debugger. Used in VS Code, VS, + more
MIT License
1.67k stars 283 forks source link

Debugger hangs when setting a breakpoint in a file with japanese characters with Node.js ESM loader active #2043

Closed dgozman closed 4 months ago

dgozman commented 4 months ago

Describe the bug

The following conditions trigger the debugger/program hang:

To Reproduce

  1. Clone https://github.com/dgozman/repro-debug
  2. Open VSCode
  3. Open JavaScript Debugger Terminal
  4. Run node main.js in the debugger terminal
  5. Observe everything works and outputs "1"
  6. Place a breakpoint at テスト_example.spec.js:3
  7. Run node main.js in the debugger terminal
  8. Program and debugger hang

Log File

vscode-debugadapter-65f7bcb8.json.gz

VS Code Version:

Version: 1.91.1 Commit: f1e16e1e6214d7c44d078b1f0607b2388f29d729 Date: 2024-07-09T22:07:46.768Z Electron: 29.4.0 ElectronBuildId: 9728852 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Darwin arm64 22.6.0

Additional context

Note this requires Node.js v20+. Definitely reproduces with Node.js v20.11.1.

connor4312 commented 4 months ago

This is https://github.com/nodejs/node/issues/50516

Seems like Node.js creates a worker behind the scenes, and we try to set the breakpoint there. That then breaks its communication due to the linked bug, but we keep waiting for the worker to acknowledge the breakpoint and stall.