Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311813 - Deadlock in RuntimeProcess.terminated()
Summary: Deadlock in RuntimeProcess.terminated()
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 RC1   Edit
Assignee: Platform-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-05 20:37 EDT by John Cortell CLA
Modified: 2010-05-20 18:36 EDT (History)
3 users (show)

See Also:
darin.eclipse: review+


Attachments
call stack of blocked threads (10.18 KB, text/plain)
2010-05-05 20:37 EDT, John Cortell CLA
no flags Details
Suggested fix. (1.24 KB, patch)
2010-05-06 13:22 EDT, Pawel Piech CLA
no flags Details | Diff
screenshot of new issue or side-effect of fix (9.41 KB, image/gif)
2010-05-08 15:44 EDT, John Cortell CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Cortell CLA 2010-05-05 20:37:21 EDT
I started noticing the Debug view not properly reflecting a terminated session. Typical symptom of a DSF deadlock. I've attached a call stack of the relevant threads. Notice the involvement of the show full paths action

Steps to reproduce:
1. Launch a DSF-GDB session.
2. Terminate
3. Repeat steps 1 & 2 until Debug view "hangs" upon termination of debug session
Comment 1 John Cortell CLA 2010-05-05 20:37:52 EDT
Created attachment 167253 [details]
call stack of blocked threads
Comment 2 John Cortell CLA 2010-05-05 20:55:23 EDT
See similar bug # 291342
Comment 3 Pawel Piech CLA 2010-05-06 13:21:27 EDT
I think this bug is another fallout from fixing bug 261837.  We should not be calling IProcess.exitValue() inside a sync. section.
Comment 4 Pawel Piech CLA 2010-05-06 13:22:21 EDT
Created attachment 167347 [details]
Suggested fix.

This patch just takes the call to IProcess.exitValue() outside the sync section.
Comment 5 Pawel Piech CLA 2010-05-06 13:24:41 EDT
(In reply to comment #0)
> I started noticing the Debug view not properly reflecting a terminated session.
> Typical symptom of a DSF deadlock. I've attached a call stack of the relevant
> threads. Notice the involvement of the show full paths action
> 
> Steps to reproduce:
> 1. Launch a DSF-GDB session.
> 2. Terminate
> 3. Repeat steps 1 & 2 until Debug view "hangs" upon termination of debug
> session

I actually am not able to reproduce this on my system.  John, could you verify the fix?  Also, the trace does not include the DSF session thread.  Is there a reason why the exitValue() query not completing?
Comment 6 Pawel Piech CLA 2010-05-06 13:26:23 EDT
Oh wait, I just noticed the bug title again, where does the show full paths action come in?
Comment 7 John Cortell CLA 2010-05-06 14:16:00 EDT
(In reply to comment #6)
> Oh wait, I just noticed the bug title again, where does the show full paths
> action come in?

The main thread has ShowFullPathsAction.selectionChanged() in its callstack
Comment 8 John Cortell CLA 2010-05-06 14:18:22 EDT
(In reply to comment #5)
> (In reply to comment #0)
> > I started noticing the Debug view not properly reflecting a terminated session.
> > Typical symptom of a DSF deadlock. I've attached a call stack of the relevant
> > threads. Notice the involvement of the show full paths action
> > 
> > Steps to reproduce:
> > 1. Launch a DSF-GDB session.
> > 2. Terminate
> > 3. Repeat steps 1 & 2 until Debug view "hangs" upon termination of debug
> > session
> 
> I actually am not able to reproduce this on my system.  John, could you verify
> the fix?  Also, the trace does not include the DSF session thread.  Is there a
> reason why the exitValue() query not completing?

Sorry. I guess I accidentally closed that thread before taking the threads snapshot. The deadlock was happening frequently at home (50%). I don't know that I'll be able to reproduce it at the office. I'll try again tonight before the fix to get you the dsf thread, then I'll apply your proposed fix and see if it fixes it.
Comment 9 Pawel Piech CLA 2010-05-07 12:51:15 EDT
I believe I need to commit the fix today for RC1.  Darin do you think the risk in this fix is acceptable?
Comment 10 John Cortell CLA 2010-05-07 12:55:55 EDT
(In reply to comment #9)
> I believe I need to commit the fix today for RC1.  Darin do you think the risk
> in this fix is acceptable?

Pawel, I forgot to test this last night. I can get you an answer this evening.
Comment 11 Darin Wright CLA 2010-05-07 12:59:34 EDT
(In reply to comment #9)
> I believe I need to commit the fix today for RC1.  Darin do you think the risk
> in this fix is acceptable?

The RC1 build is Thursday, May 13.
Comment 12 Pawel Piech CLA 2010-05-07 13:12:19 EDT
(In reply to comment #11)
> The RC1 build is Thursday, May 13.
Thanks!  In that case we can deal with it early next week.
Comment 13 John Cortell CLA 2010-05-08 15:43:53 EDT
(In reply to comment #8)
I can no longer reproduce the deadlock after applying the fix (which, btw, froze the GUI). However I'm either seeing a side effect of the change or a different problem. A terminated session is intermittently not going away correctly. See the attached screenshot. This is after 15 debug-and-terminate iterations, and a trailing "Remove All Terminated Launches" action invocation.
Comment 14 John Cortell CLA 2010-05-08 15:44:56 EDT
Created attachment 167609 [details]
screenshot of new issue or side-effect of fix
Comment 15 Navid Mehregani CLA 2010-05-10 11:31:45 EDT
I'm also able to reproduce this issue.  I haven't tried out Pawel's patch yet.  

Note that I'm seeing the "Remove All Terminated Launches" problem noted in comment#13 *without* applying the patch.  Hence it's not a side effect of the attached patch.  It's a separate problem and I've filed bug#312267 to keep track of it.
Comment 16 Darin Wright CLA 2010-05-10 11:41:37 EDT
Patch looks good to me. +1
Comment 17 Pawel Piech CLA 2010-05-10 13:19:24 EDT
(In reply to comment #13)
> A terminated session is intermittently not going away
> correctly. See the attached screenshot. This is after 15 debug-and-terminate
> iterations, and a trailing "Remove All Terminated Launches" action invocation.
In your screenshot the inferior process is not shown as terminated (though in Navid's they are).  Can you select and terminate the inferior prcesses?  

The outcome is definitely better than the original bug symptoms so I went ahead and committed the fix.  We can track the other symptoms in bug 312267.  Thanks.
Comment 18 Pawel Piech CLA 2010-05-10 13:19:41 EDT
Already reviewed.
Comment 19 John Cortell CLA 2010-05-20 18:28:55 EDT
(In reply to comment #13)
> (In reply to comment #8)
> I can no longer reproduce the deadlock after applying the fix (which, btw,
> froze the GUI). However I'm either seeing a side effect of the change or a
> different problem. A terminated session is intermittently not going away
> correctly. See the attached screenshot. This is after 15 debug-and-terminate
> iterations, and a trailing "Remove All Terminated Launches" action invocation.

I can no longer reproduce this side-issue. I've tried about 60 launches, using Mingw 6.8 and 7.0 and Cygwin 6.8 and haven't seen the issue once. Whatever it was has almost certainly been fixed since the reproducibility rate was about 30% when I reported it.
Comment 20 Pawel Piech CLA 2010-05-20 18:36:05 EDT
(In reply to comment #19)
> I can no longer reproduce this side-issue. I've tried about 60 launches, using
> Mingw 6.8 and 7.0 and Cygwin 6.8 and haven't seen the issue once. Whatever it
> was has almost certainly been fixed since the reproducibility rate was about
> 30% when I reported it.
This was most likely due to bug 312813.  Thanks John.