| Summary: | Find/Replace/Search throw Invalid Thread Access Exception | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Mahesh Maney <mahesh.maney> | ||||
| Component: | Search | Assignee: | Platform-Search-Inbox <platform-search-inbox> | ||||
| Status: | RESOLVED WORKSFORME | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | daniel_megert, mahesh.maney | ||||
| Version: | 3.7 | Keywords: | needinfo | ||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Mahesh Maney
Created attachment 204727 [details]
Screenshots for Find-Replace exception
Something looks fishy here. It looks like some other display created the used (system) font. Can you reproduce the problem in plain Eclipse SDK Juno: http://download.eclipse.org/eclipse/downloads/drops4/S-4.2M2-201109161615/index.php ? Ping. (In reply to comment #3) > Ping. Sorry for the delay in looking Dani, I shall try it now and report back in few hours now. Works fine for me. We got back the same issue couple of days back. We do a search and immediately end up in Invalid thread access exception. I have double checked for the presence of getSystemFont() anywhere in our code, but did not find any. What could be the reason this exception ? Any help/suggestion provided is much appreciated. org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:4282) at org.eclipse.swt.SWT.error(SWT.java:4197) at org.eclipse.swt.SWT.error(SWT.java:4168) at org.eclipse.swt.widgets.Display.error(Display.java:1258) at org.eclipse.swt.widgets.Display.checkDevice(Display.java:764) at org.eclipse.swt.widgets.Display.getSystemFont(Display.java:2459) at org.eclipse.swt.widgets.Display.internal_new_GC(Display.java:2682) at org.eclipse.swt.graphics.GC.<init>(GC.java:166) at org.eclipse.swt.graphics.GC.<init>(GC.java:132) at org.eclipse.jface.layout.PixelConverter.<init>(PixelConverter.java:60) at org.eclipse.jface.layout.PixelConverter.<init>(PixelConverter.java:49) at org.eclipse.ui.internal.texteditor.SWTUtil.getButtonWidthHint(SWTUtil.java:50) at org.eclipse.ui.internal.texteditor.SWTUtil.setButtonDimensionHint(SWTUtil.java:66) at org.eclipse.ui.texteditor.FindReplaceDialog.setGridData(FindReplaceDialog.java:1535) at org.eclipse.ui.texteditor.FindReplaceDialog.createButtonSection(FindReplaceDialog.java:329) at org.eclipse.ui.texteditor.FindReplaceDialog.createContents(FindReplaceDialog.java:412) at org.eclipse.jface.window.Window.create(Window.java:431) at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089) at org.eclipse.ui.texteditor.FindReplaceDialog.create(FindReplaceDialog.java:281) at org.eclipse.ui.texteditor.FindReplaceAction$FindReplaceDialogStub.<init>(FindReplaceAction.java:100) at org.eclipse.ui.texteditor.FindReplaceAction$FindReplaceDialogStub.<init>(FindReplaceAction.java:85) at org.eclipse.ui.texteditor.FindReplaceAction.run(FindReplaceAction.java:353) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185) at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508) at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1104) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1100) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1509) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4640) at org.eclipse.swt.widgets.Canvas.WM_CHAR(Canvas.java:345) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4528) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4972) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2530) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410) (In reply to comment #6) > We got back the same issue couple of days back. We do a search and immediately > end up in Invalid thread access exception. I have double checked for the > presence of getSystemFont() anywhere in our code, but did not find any. What > could be the reason this exception ? Any help/suggestion provided is much > appreciated. You'd have to remote debug your IDE. You can then look at why the exception is thrown and from which thread/display the other font comes. You could also set a breakpoint in org.eclipse.jface.resource.FontRegistry.put(String, FontData[], boolean) and during startup, look who creates the dialog font(s). > You'd have to remote debug your IDE. See: http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Fconcepts%2Fcremdbug.htm Danni, I'm trying to get the infrastructure up for remote debugging. will post the detailed description of my finding here soon. Danni, My findings; 1. The main thread was adding fonts. 2. I had set breakpoint at org.eclipse.jface.resource.FontRegistry.put(String, FontData[],boolean) at the startup. All i found was the main thread was adding fonts. 3. I'm not sure which/what display had issues. 4. This issue occurs very intermittently. 5. One interesting observation was, I was not able to initiate the new project wizard (java project), Other than that, even if i fire the search -> File, Search -> Search, Search->java , all are failing with Invalid Thread Access Exception. 6. I tried the print dialog, and it poped without any errors. During the course of Debug, i observed that in org.eclipse.swt.widgets.Display.checkDevice(), the "thread" was a Worker thread (worker-4, for Find/Replace functionality) and Thread.currentThread() was a main thread. the condition - if (thread != Thread.currentThread ()); failed resulting in Invalid Thread Access Exception. (In reply to comment #10) > Danni, > My findings; > 1. The main thread was adding fonts. > 2. I had set breakpoint at org.eclipse.jface.resource.FontRegistry.put(String, > FontData[],boolean) at the startup. All i found was the main thread was > adding > fonts. > 3. I'm not sure which/what display had issues. > 4. This issue occurs very intermittently. > 5. One interesting observation was, I was not able to initiate the new project > wizard (java project), Other than that, even if i fire the search -> File, > Search -> Search, Search->java , all are failing with Invalid Thread Access > Exception. > 6. I tried the print dialog, and it poped without any errors. > > During the course of Debug, i observed that in > org.eclipse.swt.widgets.Display.checkDevice(), the "thread" was a Worker thread > (worker-4, for Find/Replace functionality) and Thread.currentThread() was a > main thread. the condition - if (thread != Thread.currentThread ()); failed > resulting in Invalid Thread Access Exception. Sorry, this doesn't help. We'd need to know which thread creates that same font before, or have reproducible steps, which as I understand is not available. Also, please respond to comment 2. Hello Dani, We were not able to reproduce the problem on plain Eclipse SDK Juno. |