Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 274323

Summary: JDT reports incorrect thread states if breakpoint suspends VM, and listeners votes to resume
Product: [Eclipse Project] JDT Reporter: Samantha Chan <chanskw>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: darin.eclipse, heiko.boettger
Version: 3.5   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug
Attachments:
Description Flags
patch none

Description Samantha Chan CLA 2009-04-29 11:10:44 EDT
 
Comment 1 Samantha Chan CLA 2009-04-29 11:14:27 EDT
1.  set conditional breakpoint @ function call to foo
2.  brekapoint has condition: foo(); return false;
3.  brekapoint suspends VM
4.  Breakpoint listener votes to resume when the breakpoint is hit.

The testcase does resume after the listener executes.  However, the debug view reports that all of the threads are suspended.

Testcase:

public class TracepointTest {

    /**
     * @param args
     */
    public static void main(String[] args) {
    	for (;;){
            foo();  // conditional breakpoint here:  foo(); return false;
            System.out.println("out of foo");
    	}
    }

    private static void foo()
    {
            System.out.println("hello");  // breakpoint here
    }


}
Comment 2 Samantha Chan CLA 2009-04-29 11:19:08 EDT
Correction... condition should be:
foo(); return true; 

so that the VM will suspend.
Comment 3 Darin Wright CLA 2009-04-29 12:41:42 EDT
This appears to be a timing issue. The UI is updating the new launch (with a slight delay), as the target is evaluating its condition and listener evaluation. The threads report they are suspended when rendered, although they are actually "quietly" suspended doing evaluations/voting, etc. When the vote is done, there is no refresh to the UI since the suspend was "quiet". If you double click the target, the UI refreshes showing the correct state.

Will investigate in RC1.
Comment 4 Darin Wright CLA 2009-05-08 13:37:17 EDT
There appear to be several issues around conditional breakpoints with a SUSPEND_VM policy. The same problem happens in 3.4.2 (with conditional bps, as bp listeners did not exist in the same way int 3.4.2).

The problems have to do with the fact that the internal transient suspend state is shown when rendering threads & target and updating the actions.

Additionaly, attempting to suspend a single thread does not work, as it gets quietly resumed by the breakpoint handling... as the condition evals to "false", and the vote resumes the thread, all threads are resumed. This interation has apparently never worked.
Comment 5 Darin Wright CLA 2009-05-08 13:38:13 EDT
Created attachment 134994 [details]
patch

This patch makes the threads/target/actions render as one would expect, but using the actions can get the model into a bad state.
Comment 6 Darin Wright CLA 2009-05-08 13:38:50 EDT
Since these are not new problems and the changes are far reaching I'd prefer to defer this to a later release.
Comment 7 Samantha Chan CLA 2009-05-08 13:42:01 EDT
I agree. Thanks for looking at it.
Comment 8 Eclipse Genie CLA 2019-09-04 19:11:34 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.