microsoft / microsoft/java-debug
[WSL] Breakpoints fail to bind when attaching to JVM in WSL2 after Debugger for Java 0.58.3 update; rollback fixes
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 409
- フォーク
- 204
- 平均マージ
- 1日 13時間
- マージ済み PR(30日)
- 4
説明
Environment:
- Host OS: Windows 11, IDE: Cursor/VS Code
- Guest: WSL2 Ubuntu 22.04
- Java: OpenJDK 1.8.0_432 (Java 8)
- Extensions: Debugger for Java 0.58.3 (latest), Language Support for Java 1.47.0
- Spring Boot app running inside WSL2, debugged via JDWP attach on port 5005.
Expected:
Attaching from Windows (Cursor/VS Code) to a JDWP-enabled JVM in WSL2 stops at breakpoints in my project code.
Actual:
After updating to Debugger for Java 0.58.3 and Language Support for Java 1.47.0, attach no longer stops at breakpoints. HTTP requests hang as if the breakpoint is hit, but the IDE never jumps to the code. Attaching using jdb and setting the same breakpoints works fine, so JDWP and class debug info are good.
Rolling both extensions back (Debugger for Java 0.58.2 and Language Support for Java 1.46.0) restores proper behaviour.
Repro steps:
- Build and run the Spring Boot jar in WSL2 with JDWP:
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 \
-Dspring.profiles.active=local -Duser.timezone=UTC \
-jar build/libs/your-app.jar
- In Windows Cursor/VS Code, attach to 127.0.0.1:5005 (port forwarded via Remote - WSL).
- Set a breakpoint in any controller method.
- Send an HTTP request hitting that controller.
- Observe: request hangs but IDE never shows breakpoint. Meanwhile,
jdbattach shows that the breakpoint is hit.
Notes:
- This only occurs when the JVM runs in WSL2 and the IDE is on Windows. A colleague running everything natively on Windows (no WSL) doesn't see the problem.
address=*:5005can't be used with Java 8 due togethostbynameerrors.- This seems like a regression introduced in 0.58.3 (or 0.58.3 + language server update). Rolling back fixes the issue.
Thanks for looking into this.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、提供された JDWP コマンド、Windows VS Code または Cursor、controller の breakpoint を使って WSL2 シナリオを再現し、その後 Debugger for Java 0.58.3 と 0.58.2 を比較します。既存のリポジトリのエントリポイントを使って、java-debug の attach と breakpoint の動作を調査します。WSL2 で breakpoint が正しく再開され、ネイティブ Windows の動作に影響がないことを確認できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java, spring-boot, vscode
- 領域
- devtools
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100