Bug 171075 - Java Editor Disconnecting Debug Session
Summary: Java Editor Disconnecting Debug Session
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.2.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.2.2   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 134684 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-01-19 12:00 EST by Eckart Langhuth CLA
Modified: 2007-02-01 16:29 EST (History)
8 users (show)

See Also:


Attachments
Stack Trace / Code Snippets (3.84 KB, text/plain)
2007-01-19 12:01 EST, Eckart Langhuth CLA
no flags Details
patch (1.05 KB, patch)
2007-01-19 18:06 EST, Darin Wright CLA
no flags Details | Diff
plug-in replacement (706.33 KB, application/octet-stream)
2007-01-19 18:11 EST, Darin Wright CLA
no flags Details
updated patch (1.77 KB, patch)
2007-01-30 15:31 EST, Darin Wright CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eckart Langhuth CLA 2007-01-19 12:00:16 EST
Build ID: Build id: M20060921-0945

Steps To Reproduce:
1. As multi threading problem no easy way to reproduce
2. Provided information and stack trace should allow problem investigation


More information:

Scenario/Symptom: 
Remote debug session. Clicking into the Java Editor might lead to a disconnection to the remote VM.

Severity major although obviously a rare problem, because it makes debugging impossible in affected scenarios.
We were confronted with a debug scenario in which the problem was reproducable within minutes. 
This allowed following finding:

Involved classes
org.eclipse.jface.text.TextViewerHoverManager
org.eclipse.jdt.internal.debug.ui.JavaDebugHover
org.eclipse.jdi.internal.connect.PacketReceiveManager

What happens is:
The TextViewerHoverManager in the Java Editor tries to compute hover information content in a seperated Thread.
While debugging the JavaDebugHover is used. The implementation tries to recieves information from remote VM.
By clicking in the Java Editor a TextEvent is created.
As a result the TextViewerHoverManager tries to force the termination of the current hover information computation by interrupting the related thread.
If in this moment the JavaDebugHover is receiving remote information waiting in PacketReceiveManager the PacketReceiveManager disconnects the VM connection.

See attached text file for related stack trace and related code snippets.
Comment 1 Eckart Langhuth CLA 2007-01-19 12:01:15 EST
Created attachment 57153 [details]
Stack Trace / Code Snippets
Comment 2 Darin Wright CLA 2007-01-19 17:46:20 EST
Thanks for reporting this finding! See bug 134684. This could make many people happy.
Comment 3 Darin Wright CLA 2007-01-19 18:06:12 EST
Created attachment 57185 [details]
patch

Patch for 3.2.2 org.eclipse.jdt.debug plug-in
Comment 4 Darin Wright CLA 2007-01-19 18:11:17 EST
Created attachment 57186 [details]
plug-in replacement

Replacement plug-in to test. Please delete your old org.eclipse.jdt.debug plug-in when using this to ensure that this plug-in is used.
Comment 5 Darin Wright CLA 2007-01-19 18:11:46 EST
Note that the replacement plug-in must be unzipped.
Comment 6 Andreas Kunz CLA 2007-01-19 22:03:05 EST
Trying your plugin replacement...:
I went to the respective place in the code nine times (in three debug sessions) and then tried to reproduce the problem (usually 1-2 times, sometimes three times were sufficient to provoke it). But everything worked fine.
Crosschecking without your fixed plugin it instantly failed again the first time I tried.
I'd say this looks very good. Thanks a lot!
Comment 7 Darin Wright CLA 2007-01-30 15:31:55 EST
Created attachment 57851 [details]
updated patch

This is an updated patch. When a "wait for reply" is interrupted, the wait "breaks" and treats it the same as a timeout. When the reply packet is eventually received, we just discard it.
Comment 8 Darin Wright CLA 2007-01-30 15:33:20 EST
Marking as 3.2.2 candidate as this seems to be a large problem for some developers (see bug 134684).
Comment 9 Darin Wright CLA 2007-01-30 15:41:57 EST
CC'ing McQ and Philippe for 3.2.2 approval. The fix is a trivial, one-liner, with low risk. The problem was inadvertently introduced with the fix to bug 49115. We should only disconnect when the entire 'receive' thread is interrupted, not when a individual request is interrupted.
Comment 10 Mike Wilson CLA 2007-01-30 15:43:27 EST
+1
Comment 11 Darin Wright CLA 2007-01-30 15:44:41 EST
(Released fix to HEAD/3.3)
Comment 12 Darin Wright CLA 2007-01-30 16:03:31 EST
Released to 3.2.2. Requested re-build.
Comment 13 Darin Wright CLA 2007-01-30 16:03:47 EST
Please verify, Mike (Rennie).
Comment 14 Michael Rennie CLA 2007-02-01 13:21:30 EST
verified
Comment 15 Darin Wright CLA 2007-02-01 16:29:35 EST
*** Bug 134684 has been marked as a duplicate of this bug. ***