Bug 35443 - CPU Peg and SWTException with Code Generation preference page
Summary: CPU Peg and SWTException with Code Generation preference page
Status: RESOLVED DUPLICATE of bug 31525
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.1   Edit
Hardware: PC Linux-GTK
: P2 critical (vote)
Target Milestone: ---   Edit
Assignee: Felipe Heidrich CLA Friend
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-21 02:21 EST by Michael R Head CLA Friend
Modified: 2003-04-15 23:10 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael R Head CLA Friend 2003-03-21 02:21:25 EST
Steps to reproduce:

1) get eclipse RC3 (linux gtk on a debian/sid laptop is what I got), unzip and run
2) Navigate to Window/Preferences/Java/Code Generation/Code and Comments
3) Select Types
4) wait for a moment and notice that your favorite load meter shows that the CPU
is pegged
5) click edit
6) modify the text
7) click ok
8) notice that the pattern display is not updated and CPU is still pegged
9) Click apply ok and cancel
10) notice that the prferences window doesn't go away
11) click the 'X' in the window decorations for the preferences page
12) notice that the preferences window goes away and CPU goes back down
13) exit eclipse
14) look at .metadata/.log, notice the stack trace

!SESSION Mar 21, 2003 02:15:33.672 ---------------------------------------------
java.fullversion=J2RE 1.4.0 IBM build cxia32140-20020917a (JIT enabled: jitc)
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en
Command-line arguments: -os linux -ws gtk -arch x86 -install
file:/home/burner/jdks/eclipse/eclipse/
!ENTRY org.eclipse.ui 4 4 Mar 21, 2003 02:15:33.673
!MESSAGE Unhandled exception caught in event loop.
!ENTRY org.eclipse.ui 4 0 Mar 21, 2003 02:15:33.713
!MESSAGE Widget is disposed
!STACK 0
org.eclipse.swt.SWTException: Widget is disposed
        at org.eclipse.swt.SWT.error(SWT.java:2320)
        at org.eclipse.swt.widgets.Control.getDisplay(Control.java(Compiled Code))
        at org.eclipse.swt.widgets.Control.getDisplay(Control.java(Compiled Code))
        at org.eclipse.swt.widgets.Control.getDisplay(Control.java(Compiled Code))
        at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java(Compiled Code))
        at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java(Compiled Code))
        at org.eclipse.swt.widgets.Tree.setSelection(Tree.java:894)
        at org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:226)
        at
org.eclipse.jface.viewers.AbstractTreeViewer.setSelectionToWidget(AbstractTreeViewer.java:1261)
        at
org.eclipse.jface.viewers.StructuredViewer.setSelectionToWidget(StructuredViewer.java:1053)
        at
org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:808)
        at
org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:859)
        at
org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField.refresh(TreeListDialogField.java:710)
        at
org.eclipse.jdt.internal.ui.preferences.CodeTemplateBlock.edit(CodeTemplateBlock.java:349)
        at
org.eclipse.jdt.internal.ui.preferences.CodeTemplateBlock.doButtonPressed(CodeTemplateBlock.java:332)
        at
org.eclipse.jdt.internal.ui.preferences.CodeTemplateBlock$CodeTemplateAdapter.customButtonPressed(CodeTemplateBlock.java:70)
        at
org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField.buttonPressed(TreeListDialogField.java:171)
        at
org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField.doButtonSelected(TreeListDialogField.java:386)
        at
org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField.access$2(TreeListDialogField.java:382)
        at
org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField$2.widgetSelected(TreeListDialogField.java:349)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:91)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java(Compiled
Code))
        at
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compiled Code))
        at
org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compiled Code))
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled
Code))
        at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code))
        at org.eclipse.jface.window.Window.open(Window.java:563)
        at
org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:53)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:842)
        at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:456)
        at
org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:403)
        at
org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:397)
        at
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:72)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java(Compiled
Code))
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:913)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1641)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1433)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402)
        at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
        at
org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:845)
        at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:61)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:40)
        at java.lang.reflect.Method.invoke(Method.java:335)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:291)
        at org.eclipse.core.launcher.Main.run(Main.java:747)
        at org.eclipse.core.launcher.Main.main(Main.java:583)
Comment 1 Michael R Head CLA Friend 2003-03-21 02:23:31 EST
FYI: The exception is generated when the 'X' is clicked on the window
decorations for the preferences window.
Comment 2 Michael R Head CLA Friend 2003-03-21 03:43:08 EST
This was an RC3 bug fixed in RC3a, apparently
Comment 3 Dirk Baeumer CLA Friend 2003-03-21 06:34:40 EST
Martin, also the reporter said that the problem is gone in RC3a can you please 
comnment on the stack trace. May be there is a underlying problem here.
Comment 4 Martin Aeschlimann CLA Friend 2003-03-21 08:19:17 EST
I've not seen such a stacktrace before. It's strange that the tree would be 
disposed after the edit call. My guess this is a SWT problem
Comment 5 Dirk Baeumer CLA Friend 2003-03-21 08:45:25 EST
Asking SWT if anything changed here between RC3 and RC3a
Comment 6 Veronika Irvine CLA Friend 2003-03-24 11:22:04 EST
The only changes made by SWT between RC3 and RC3a where for motif.  I think 
the stack trace does not show the full problem.  When the CPU was pegged there 
were probably exceptions thrown and caught that altered the code flow and 
resulted in referenceing a disposed tree.

Moving back to JDT UI.
Comment 7 Michael R Head CLA Friend 2003-03-24 12:23:35 EST
Yeah, if I recall correctly the stack trace occured at step 11/12, so Veronika's
probably right.
Comment 8 Dirk Baeumer CLA Friend 2003-03-24 14:14:28 EST
Veronika, I trried to track this done but I am not able to do so. Here are my findings: 
 
- it only happens under Linux-GTK. Motif, Windows and Mac don't reveal the  
  behaviour of CPU pegging and exception. 
- starting GTK in debug mode and following the steps including 4 and then  
  suspending the main thread brings the CPU back to normal. Unfortunatelly the 
  stack trace doesn't reveal what is done in main. 
- resuming main brings the CPU back to 100% 
 
The first thing we have to track down IMO is the CPU pegging since it makes the 
dialog unusable. The exception at the end doesn't really cause harm. 
 
Veronika any idea what can cause the CPU pegging. It is easy to reproduce and I 
assume you have better tools and are more familiar with GTk to figure this out. 
 
I don't want to move the PR back and forth but without help from SWT it is hard to 
find out what is going on, especially since it only happens under Linux-GTK 
Comment 9 Felipe Heidrich CLA Friend 2003-03-24 18:22:02 EST
Weird, resize the dialog during the process and the bug doesn't happen.

Comment 10 Dirk Baeumer CLA Friend 2003-03-25 05:16:52 EST
Another finding: 
 
- following steps until step 4 
- move the scroll bar of the tree widget down 
 
observe: the CPU does back to 0% and the dialog works as expected. 
Comment 11 Steve Northover CLA Friend 2003-03-25 12:51:34 EST
Dirk, please execute this in a shell, "rpm -q glib2".
Comment 12 Dirk Baeumer CLA Friend 2003-03-25 12:59:14 EST
My configuration is: 
 
atk: 1.2.0 
glib: 2.2.1 
gtk+: 2.2.1 
pango: 1.2.1 
pkgconfig: 0.15.0 
Comment 13 Dirk Baeumer CLA Friend 2003-03-25 13:07:59 EST
Note that after resizing the dialog or moving the scrollbar you have to wait 2 - 3 
seconds until the CPU goes back to 0%.  
Comment 14 Dirk Baeumer CLA Friend 2003-03-25 13:10:47 EST
Use build to reproduce: 200303241446
Comment 15 Felipe Heidrich CLA Friend 2003-03-25 14:13:01 EST
We are able to confirm that this problem occurs in GTK 2.2.x only.  Since this
is not an offically supported GTK release at this time, I'm downgrading this PR.
 Felipe is still looking at the problem.
Comment 16 Veronika Irvine CLA Friend 2003-03-26 09:38:03 EST
See also bug 31525.
Comment 17 Veronika Irvine CLA Friend 2003-03-26 16:07:09 EST

*** This bug has been marked as a duplicate of 31525 ***