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

Bug 321249

Summary: Invalid thread access during Fading
Product: [Eclipse Project] Platform Reporter: Benjamin Muskalla <b.muskalla>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: bulrich, eclipse.felipe, remy.suen, steffen.pingel
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
SWTUtil.java none

Description Benjamin Muskalla CLA 2010-07-29 13:02:21 EDT
Mylyn SDK	3.5.0.I20100626-2300-e3x

Happend during IDE startup. No steps, sorry.


-- Error Details --
Date: Thu Jul 29 18:51:44 CEST 2010
Message: An internal error occurred during: "Fading".
Severity: Error
Product: Eclipse SDK 3.6.0.v201006080911 (org.eclipse.sdk.ide)
Plugin: org.eclipse.core.jobs
Session Data:
eclipse.buildId=I20100608-0911
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments:  -showLocation
Command-line arguments:  -os linux -ws gtk -arch x86 -showLocation


Exception Stack Trace:
org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(SWT.java:4083)
at org.eclipse.swt.SWT.error(SWT.java:3998)
at org.eclipse.swt.SWT.error(SWT.java:3969)
at org.eclipse.swt.widgets.Widget.error(Widget.java:466)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:404)
at org.eclipse.swt.widgets.Shell.setAlpha(Shell.java:1554)
at org.eclipse.mylyn.internal.commons.ui.SwtUtil$FadeJob$2.run(SwtUtil.java:137)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:179)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4294)
at org.eclipse.mylyn.internal.commons.ui.SwtUtil$FadeJob.run(SwtUtil.java:126)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 1 Steffen Pingel CLA 2010-07-29 14:44:46 EDT
Moving to platform to get some input. The code snippet looks like this:

			Display.getDefault().syncExec(new Runnable() {
				public void run() {
					if (stopped) {
						return;
					}

					if (shell.isDisposed()) {
						stopped = true;
						return;
					}

					shell.setAlpha(currentAlpha);
					...
				}
			});
			
			
Under what circumstances would the invocation of shell.setAlpha(...) cause an InvalidThreadException?
Comment 2 Felipe Heidrich CLA 2010-07-30 12:16:01 EDT
is SwtUtil$FadeJob$2.run running code in another thread ?

The code snippet in comment 1 can not be causing InvalidThreadException.
Comment 3 Steffen Pingel CLA 2010-07-30 14:46:04 EDT
Created attachment 175603 [details]
SWTUtil.java
Comment 4 Steffen Pingel CLA 2010-07-30 14:48:24 EDT
As far as I can tell, the Runnable should execute on the UI thread only. I have attached the whole class for reference.

Benjamin, just to be sure, you are running a recent version of Mylyn, right?
Comment 5 Benjamin Muskalla CLA 2010-08-04 18:08:22 EDT
Mylyn SDK	3.5.0.I20100626-2300-e3x
Comment 6 Steffen Pingel CLA 2012-01-01 17:53:23 EST
Benjamin, are you still seeing this error?
Comment 7 Benjamin Muskalla CLA 2012-01-03 10:40:32 EST
Haven't seen it in a while.
Comment 8 Steffen Pingel CLA 2012-01-03 11:28:17 EST
Thanks. I'll mark this as closed for now. Please reopen in case you run into this again.