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

Đang mở
#611 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

ai-triaged bug
Ngôn ngữ chính
Java
Star
409
Fork
204
Merge trung bình
1 ngày 13 giờ
Pull request đã merge (30 ngày)
4

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện kịch bản WSL2 với lệnh JDWP được cung cấp, Windows VS Code hoặc Cursor và một breakpoint trong controller, sau đó so sánh Debugger for Java 0.58.3 với 0.58.2. Điều tra hành vi attach và breakpoint của java-debug bằng các entry point hiện có trong repository. Hoàn tất khi các breakpoint tiếp tục hoạt động đúng trong WSL2, trong khi hành vi Windows native vẫn không bị ảnh hưởng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java, spring-boot, vscode
Lĩnh vực
devtools
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.