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

未关闭
#611 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

ai-triaged bug
主要语言
Java
星标
409
派生
204
平均合并
1 天 13 小时
30 天内合并 PR
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:

  1. 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
  1. In Windows Cursor/VS Code, attach to 127.0.0.1:5005 (port forwarded via Remote - WSL).
  2. Set a breakpoint in any controller method.
  3. Send an HTTP request hitting that controller.
  4. Observe: request hangs but IDE never shows breakpoint. Meanwhile, jdb attach 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=*:5005 can't be used with Java 8 due to gethostbyname errors.
  • 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.

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先使用提供的 JDWP 命令、Windows VS Code 或 Cursor 以及 controller 中的断点复现 WSL2 场景,然后比较 Debugger for Java 0.58.3 和 0.58.2。使用现有 repository 入口调查 java-debug 的 attach 和断点行为。完成的标准是断点在 WSL2 中能够正确恢复,同时原生 Windows 行为不受影响。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, spring-boot, vscode
领域
devtools
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。