Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338965 - Deadlock/Hang on UI Thread
Summary: Deadlock/Hang on UI Thread
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6.2   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 critical (vote)
Target Milestone: 3.6.2+   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-04 13:29 EST by Brian Bauman CLA
Modified: 2011-12-15 15:36 EST (History)
5 users (show)

See Also:


Attachments
Sample project which reproduces the problem consistently (8.34 KB, application/zip)
2011-03-04 13:32 EST, Brian Bauman CLA
no flags Details
fix (1.71 KB, patch)
2011-03-04 16:13 EST, Silenio Quarti CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.