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

Bug 338965

Summary: Deadlock/Hang on UI Thread
Product: [Eclipse Project] Platform Reporter: Brian Bauman <baumanbr>
Component: SWTAssignee: Silenio Quarti <Silenio_Quarti>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: baumanbr, kleind, linyunz, mukund, Silenio_Quarti
Version: 3.6.2   
Target Milestone: 3.6.2+   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Sample project which reproduces the problem consistently
none
fix none

Description Brian Bauman CLA 2011-03-04 13:29:18 EST
Build Identifier: 3.6.2

Our product recently update to SWT 3.6.2 and found a hang/deadlock on a common use case for us.  We did some digging and found it was caused by the fix for bug 322137.  

We have a Shell that we display that uses style SWT.ON_TOP.  An Eclipse action is run that calls MessageBox and the result is the user can never click on the OK button in the MessageBox.

Due to the complexity of the product, I was able to reproduce the issue by creating a sample project.  The project consists of piecing together SWT Snippet fragments, resulting in a flow that does not really make sense but does reproduce the problem.

Reproducible: Always

Steps to Reproduce:
1. Run the Snippet50.java class in the project that will be attached.
2. Note how you cannot click the OK button on the MessageBox that is displayed.
Comment 1 Brian Bauman CLA 2011-03-04 13:32:55 EST
Created attachment 190424 [details]
Sample project which reproduces the problem consistently
Comment 2 Silenio Quarti CLA 2011-03-04 16:13:35 EST
Created attachment 190444 [details]
fix

I am not really sure why RunStandardAlert() hangs if there is a kUtilityWindowClass window opened. The other dialogs (color, font, file, etc) work fine. It really seems like a bug in carbon. This patch works around this problem and should have no side effects as kFloatingWindowClass was the window group used before the fix for bug 322137. 

I will release this patch to HEAD. It also applies properly on 3.6.2 branch.

Please try it out.
Comment 3 Silenio Quarti CLA 2011-03-04 16:14:26 EST
Fixed > 20110304
Comment 4 Silenio Quarti CLA 2011-03-04 16:28:37 EST
Note that during the time the MessageBox is up, the ON_TOP shell will not stay above windows of other applications.