Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351212 - Workspace failed to start due to Problems View getting activated outside SWT Display Thread
Summary: Workspace failed to start due to Problems View getting activated outside SWT ...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7.1   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 354490 354491
  Show dependency tree
 
Reported: 2011-07-05 12:02 EDT by Martin Oberhuber CLA
Modified: 2011-10-04 12:40 EDT (History)
3 users (show)

See Also:
emoffatt: review+


Attachments
Workspace log showing exceptions (16.52 KB, text/plain)
2011-07-05 12:02 EDT, Martin Oberhuber CLA
no flags Details
Fix (1.50 KB, patch)
2011-07-06 03:17 EDT, Dani Megert CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2011-07-05 12:02:37 EDT
Created attachment 199138 [details]
Workspace log showing exceptions

Build ID: Eclipse 3.7 (Indigo)

1-time occurrence, see attached workspace log, here is my understanding of 
what happened:
- This was an existing fairly complex Indigo install with several dropins
- I added another *.link file to dropins (adding egit) and launched
- During launch, following exception was logged (p2 race condition?)
  org.osgi.framework.BundleException: State change in progress for bundle 
- Eclipse tried to bring up the Problems View
- But that failed due to org.eclipse.swt.SWTException: Invalid thread access
- Which caused the whole Eclipse Launch to terminate.

On relaunching, everything was fine so the config itself looked OK.

I'm reporting this since I've seen similar problems with the framework trying to activate the Problems View prematurely on other occasions too.
Comment 1 Dani Megert CLA 2011-07-06 02:58:08 EDT
Any idea who tries to start the UI bundle from a non-UI thread?
Comment 2 Dani Megert CLA 2011-07-06 03:09:15 EDT
In case the bundle is started in the non-UI thread we can use asyncExec instead of timerExec.
Comment 3 Dani Megert CLA 2011-07-06 03:17:00 EDT
Created attachment 199165 [details]
Fix
Comment 4 Martin Oberhuber CLA 2011-07-06 05:17:09 EDT
Why not asyncExec in line 392 too ?

The runnable will timerExec itself repeatedly until the Workbench is up. In other cases I've seen a warning logged about "problems view has not been created yet", so potentially creating it earlier may be a good idea...
Comment 5 Dani Megert CLA 2011-07-06 06:11:49 EDT
(In reply to comment #4)
> Why not asyncExec in line 392 too ?
Because the stuff will be in the display thread/loop after the first asyncExec ;-)
Comment 6 Martin Oberhuber CLA 2011-08-08 10:41:58 EDT
Ping, could this go into 3.7.1 rc 1 ?
The sooner it's in the more often our automated testsuite will exercise it :)
Comment 7 Dani Megert CLA 2011-08-08 10:44:27 EDT
(In reply to comment #6)
> Ping, could this go into 3.7.1 rc 1 ?
> The sooner it's in the more often our automated testsuite will exercise it :)

Yes. As you know I had other priorities ;-).
Comment 8 Dani Megert CLA 2011-08-09 10:02:14 EDT
Eric, OK for 3.7.1?
Comment 9 Eric Moffatt CLA 2011-08-09 13:39:26 EDT
Looks good...

Committed in >20110809. Applied the patch.

Dani, could you do the VERIFY ?
Comment 10 Dani Megert CLA 2011-08-10 02:36:39 EDT
(In reply to comment #9)
> Looks good...
> 
> Committed in >20110809. Applied the patch.
See bug 351752 comment 8 f.

 
> Dani, could you do the VERIFY ?
Yes, will do.
Comment 11 Dani Megert CLA 2011-08-11 02:58:48 EDT
Verified for 3.7.1. in M20110810-0800.

I'm reopening this bug until we either have separate bugs for 3.8, 4.1.1 and 4.2 or we have comments in this bug confirming the commit into those branches.
Comment 12 Remy Suen CLA 2011-08-11 09:19:57 EDT
(In reply to comment #11)
> I'm reopening this bug until we either have separate bugs for 3.8, 4.1.1 and
> 4.2 or we have comments in this bug confirming the commit into those branches.

Opened bug 354490 against 3.8 and bug 354491 against 4.x. 4.1.1 and 4.2 has not split yet.
Comment 13 Remy Suen CLA 2011-08-11 09:20:14 EDT
(In reply to comment #11)
> Verified for 3.7.1. in M20110810-0800.

Resetting to VERIFIED. Thank you for verifying the fix, Dani.