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

Bug 39223

Summary: Open/Close Project locks for several minutes
Product: [Eclipse Project] Platform Reporter: Brent Crammond <brent>
Component: UIAssignee: Veronika Irvine <veronika_irvine>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: christophe.cornu+eclipse, eclipse, Silenio_Quarti, snorthov
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:

Description Brent Crammond CLA 2003-06-23 07:40:08 EDT
Open/Close of a project locks the screen for several minutes.  I have just
upgraded to Debian 3.0, installed from Knoppix, from Suse 8.  This version of
eclipse had been work well under Suse.

The version of the libraries are all later than those specified in the SWT for
Eclipse version 2.1.

The following error gets written to the .log.

java.version=1.4.1_03
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Command-line arguments: -os linux -ws gtk -arch x86 -install
file:/home/brent/Documents/bin/eclipse/
!ENTRY org.eclipse.core.resources 4 2 Jun 23, 2003 23:02:27.283
!MESSAGE Problems occurred when invoking code from plug-in:
"org.eclipse.core.resources".
!STACK 0
org.eclipse.swt.SWTException: Invalid thread access
        at org.eclipse.swt.SWT.error(SWT.java:2350)
        at org.eclipse.swt.SWT.error(SWT.java:2280)
        at org.eclipse.swt.widgets.Widget.error(Widget.java:373)
        at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:311)
        at org.eclipse.swt.widgets.Control.isEnabled(Control.java:1929)
        at org.eclipse.swt.widgets.Display.eventProc(Display.java:608)
        at
org.eclipse.swt.internal.gtk.OS.gtk_clipboard_wait_for_contents(Native Method)
        at org.eclipse.swt.dnd.Clipboard.getContents(Clipboard.java:150)
        at
org.eclipse.ui.views.navigator.PasteAction.updateSelection(PasteAction.java:162)
        at
org.eclipse.ui.actions.SelectionListenerAction.selectionChanged(SelectionListenerAction.java:208)
        at
org.eclipse.ui.views.navigator.RefactorActionGroup.updateActionBars(RefactorActionGroup.java:139)
        at
org.eclipse.ui.views.navigator.MainActionGroup.handleResourceChanged(MainActionGroup.java:107)
        at
org.eclipse.ui.views.navigator.MainActionGroup$1.resourceChanged(MainActionGroup.java:74)
        at
org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:137)
        at
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1006)
        at org.eclipse.core.runtime.Platform.run(Platform.java:413)
        at
org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:152)
        at
org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:67)
        at
org.eclipse.core.internal.resources.Workspace.broadcastChanges(Workspace.java:161)
        at
org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:892)
        at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1600)
        at
org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:85)
        at
org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:101)
Comment 1 Steve Northover CLA 2003-06-24 16:46:28 EDT
Looks like we need the new GTK 2.2 multi-display API?  The clipboard is being 
access from outside the display thread.  VI to check with CC.
Comment 2 Veronika Irvine CLA 2003-07-15 14:02:01 EDT

*** This bug has been marked as a duplicate of 33028 ***
Comment 3 Veronika Irvine CLA 2003-07-17 12:27:03 EDT
The error is in:

org.eclipse.ui.views.navigator.PasteAction.updateSelection
(PasteAction.java:162)

This is code is calling Clipboard.getContents from a thread other than the UI 
thread.  GTK runs an OS event loop when the contents of the clipboard are 
requested.  This can only be done in the UI thread.  As a result, I have added 
a check to the Clipboard API to ensure that it is being called from the UI 
thread.

In >M2, this will result in an invalid thread access exception.  Please update 
your code to call all Clipboard API from the UI thread.
Comment 4 Steve Northover CLA 2004-04-08 13:37:39 EDT
This has been fixed for a while.