-
Notifications
You must be signed in to change notification settings - Fork 49
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
Debug "step" and "resume" operations are grayed out with breakpoints in virtual threads #345
Comments
|
I'm lost. Ist this virtual threads related, how it can work on Java 17 which does not have virtual threads? Is this not related to virtual threads, what is the key difference in what you are doing & the rest of the world with working debugger? Please try to isolate the root cause of your problem. IDE update, Java update, specific code you have or whatever else. Once you have that, try to provide steps to reproduce for us so we can fix the problem, whatever it is. |
I think it's Java 21-related, or to be more sure, post-Java 17 specific. Virtual Threads were implemented from Java 19 and better, and we have preview support for it, but it's disabled. So the code being used targets Java 21 (only for the Virtual Threads part). It's not IDE. It's Java 21. Using Java 20 (OpenJDK 64-Bit Server VM Temurin-20.0.2+9 (build 20.0.2+9, mixed mode, sharing)) and "--enable-preview" (VirtualThreads are used), the break-point enables the debug operations (step/resume), but has a problem in the Debug view (one thread missing that is sitting on the same breakpoint too, but in another thread): When stepping and debugging code, the Debug view thread that is "missing": Turning off "--enable-preview" in Java 20 makes it work: We have a command line option to disable Virtual Threads, so this problem seems to become clear now. The interesting thing is that we only have one breakpoint at a time when VirtualThreads are off. So I guess somebody with more experience in this area should look at the problem (as it involves two "probably" Virtual Threads being break-point'ed, but I'm not sure). |
@iloveeclipse Yep, I thinks this is an accurate description from the tests I have performed. |
OK, could you please try to isolate some simple example that would allow us to reproduce the issue? If this is caused by virtual threads, I assume one precondition is a breakpoint in code executed by a virtual thread. Most likely you have multiple virtual threads running in one "real" thread and hitting same breakpoint one after each other, and debugger confused by that (because it would be same real thread)? |
I wonder if you can change the breakpoint to print current thread name, what you would see on console? |
We're having a multi-threaded app based on virtual threads. We're currently using Eclipse 20231201-2043 with jdt debug 3.21.200.v20231103-0755. The described behavior happens indeed when there are two suspended virtual threads. For me, it displays fine for a moment, but then after a moment one suspended thread disappears from the debug view, leaving blank lines: |
Hi @iloveeclipse, please use https://github.com/fdummert/EclipseVThreads.git as an example project that demonstrates the faulty behaviors. All three debugging blockers can be seen there: collapse of the debug view, vanishing of the suspended thread in the debug view, display of an empty line instead of the suspended thread in the debug view. A few details on how to debug are described in the readme file. |
The problem still exists. Is there any further info required for to continue on this task? At time of writing the issue is still labeled with 'needinfo'. |
Can anyone interested in Virtual threads please test #535 ? |
Eclipse 2023-12 M2, Java Temurin 21.0.1.
Microsoft Windows [Version 10.0.23580.1000]
Launching debug of a Java Application project (uses Virtual Threads in case it matters) hits a breakpoint during its startup (after running a couple of seconds) the breakpoint
System.out.println("HERE!");
is encountered. Code is compiled for Java 17.The debug operations "step" (into/over/return) and "resume" are grayed out and cannot be performed. Also note the tree view having two empty lines. It doesn't matter which thread I select in the Debug view, the operations in question are always disabled:
This problem can be reproduced all the time.
The text was updated successfully, but these errors were encountered: