Bug 42245 - KeyPreferences Page not working
Summary: KeyPreferences Page not working
Status: RESOLVED DUPLICATE of bug 42465
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux-GTK
: P3 critical (vote)
Target Milestone: 3.0 M4   Edit
Assignee: Douglas Pollock CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 42286 42387 42432 (view as bug list)
Depends on: 42465
Blocks:
  Show dependency tree
 
Reported: 2003-08-29 06:10 EDT by Teppo Jalava CLA
Modified: 2003-09-09 09:46 EDT (History)
3 users (show)

See Also:


Attachments
The full error log. Knock yourself out. (80.22 KB, text/plain)
2003-08-29 11:39 EDT, Louis-Dominique Dubeau CLA
no flags Details
Patch to KeysPreferencePage (1.45 KB, patch)
2003-09-04 11:36 EDT, Douglas Pollock CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Teppo Jalava CLA 2003-08-29 06:10:24 EDT
When opening Key Preferences Page from workbench preferences, Eclipse creates a
following log entry:
-------------
!MESSAGE Failed to execute runnable (java.lang.StackOverflowError)
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable
(java.lang.StackOverflowError)
        at org.eclipse.swt.SWT.error(SWT.java:2367)
        ...
-------------

The key preferences page eventually opens, but when attempting to change
selected category from the category dropdown, eclipse ends up with a stack
overflow error. Same happend with other dropdown boxes as well.
The stack trace:
-------------
*** Stack trace of contained exception ***
!ENTRY org.eclipse.ui 4 0 Aug 29, 2003 12:37:57.480
!MESSAGE java.lang.StackOverflowError
!STACK 0
java.lang.StackOverflowError
        at org.eclipse.swt.events.SelectionEvent.<init>(SelectionEvent.java:92)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:88)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:953)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:977)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:958)
        at org.eclipse.swt.widgets.Combo.gtk_changed(Combo.java:745)
        at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1174)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:2344)
        at org.eclipse.swt.internal.gtk.OS.gtk_entry_set_text(Native Method)
        at org.eclipse.swt.widgets.Combo.setText(Combo.java:1216)
        at org.eclipse.swt.widgets.Combo.select(Combo.java:1050)
        at
org.eclipse.ui.internal.commands.KeysPreferencePage.setCommandId(KeysPreferencePage.java:1270)
        at
org.eclipse.ui.internal.commands.KeysPreferencePage.setCommandsForCategory(KeysPreferencePage.java:1285)
        at
org.eclipse.ui.internal.commands.KeysPreferencePage.update(KeysPreferencePage.java:1353)
        at
org.eclipse.ui.internal.commands.KeysPreferencePage.selectedComboCommand(KeysPreferencePage.java:1160)
        at
org.eclipse.ui.internal.commands.KeysPreferencePage.access$2(KeysPreferencePage.java:1159)
        at
org.eclipse.ui.internal.commands.KeysPreferencePage$3.widgetSelected(KeysPreferencePage.java:637)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
        .....
--------------
Comment 1 Louis-Dominique Dubeau CLA 2003-08-29 11:37:53 EDT
I also get this error.  I'm attaching the full error log I get from starting
eclipse to eclipse crashing.  This was with eclipse 3.0M3 build ID 200308281813
running on RH Linux 9.  The sequence of events from the user's perspective is:

1. Start Eclipse
2. Select Window->Preferences in the menu bar.
3. Go to the Workbench/Keys preferences.
4. Open the "Category: " combo and select "Search".
5. *boom*  (A dialog box appears giving the choice between exiting or trying to
continue.)

This is 100% reproducible.
Comment 2 Louis-Dominique Dubeau CLA 2003-08-29 11:39:49 EDT
Created attachment 5907 [details]
The full error log.  Knock yourself out.

Here's the log.
Comment 3 Douglas Pollock CLA 2003-09-03 14:09:40 EDT
*** Bug 42387 has been marked as a duplicate of this bug. ***
Comment 4 Douglas Pollock CLA 2003-09-04 11:36:09 EDT
Created attachment 5988 [details]
Patch to KeysPreferencePage

The problem is caused by multiple invocations of update().  The root cause is
that the select(int) and setItems(Object[]) methods on the combo boxes are
being called during the update ... which triggers another update.  The problem
is further complicated by other things, like GTK not updating the selection
index until the call to select(int) completes successfully.

This patch modifies the update method so that the method can only appear once
on the stack at any time.  The entry and exit to the method are controlled by a
flag.  This way the method can only be executing once in the system at any
point in time.	The update method is not thread-safe anyway, so no synchronized
blocks have been added.
Comment 5 Douglas Pollock CLA 2003-09-04 11:36:51 EDT
chris: review/apply.
Comment 6 Douglas Pollock CLA 2003-09-04 11:38:02 EDT
*** Bug 42432 has been marked as a duplicate of this bug. ***
Comment 7 Douglas Pollock CLA 2003-09-04 16:15:32 EDT
Grant has committed a fix to SWT that fixes this problem as well.  Waiting on
his response.  This patch may not be necessary.
Comment 8 Grant Gayed CLA 2003-09-04 16:53:10 EDT
The swt fix is adequate for fixing this (actually it wasn't me that committed 
the fix).  I tested it by self-hosting the M3 build with swt's current HEAD 
contents.

If you wish you can verify that the change at your level is not needed by 
getting tonight's nightly build.
Comment 9 Chris McLaren CLA 2003-09-05 08:50:51 EDT
cool. i'd prefer not to apply the patch if possible. (safer fix would be to 
wrap update in a try-finally block to make sure that flag will be set false in 
case of runtime exception..)

our update method should never be reentrant anyway, this was an swt problem. 
doug please close when swt fix is confirmed..
Comment 10 Douglas Pollock CLA 2003-09-05 09:41:27 EDT
update:  the nightly Eclipse build (0905) failed to compile.  will check later....
Comment 11 Douglas Pollock CLA 2003-09-05 09:53:33 EDT
*** Bug 42286 has been marked as a duplicate of this bug. ***
Comment 12 Douglas Pollock CLA 2003-09-09 09:46:25 EDT
This bug was fixed by SWT.

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